简体   繁体   English

我怎样才能只从 firebase ML Kit 人脸检测中获得情绪?

[英]How can I only get the emotion from firebase ML Kit face detection?

may I know how can I only got the emotion type on the label?我可以知道我怎么能只得到标签上的情绪类型吗? And may I know how many emotion type can ML Kit detect?我可以知道 ML Kit 可以检测多少种情绪类型吗? Here are my code:这是我的代码:

public void generateLabels(View v) {
    Bitmap bitmap = ((BitmapDrawable)image_holder.getDrawable()).getBitmap();
    InputImage image = InputImage.fromBitmap(bitmap, 0);
    ImageLabeler laber = ImageLabeling.getClient(ImageLabelerOptions.DEFAULT_OPTIONS);

    laber.process(image).addOnSuccessListener(new OnSuccessListener<List<ImageLabel>>() {
        @Override
        public void onSuccess(@NonNull List<ImageLabel> labels) {
            String labelText = "Result";
            for (ImageLabel label: labels) {
                String text = label.getText();
                float confidence = label.getConfidence();
                labelText += ("\n" + text + ": " + confidence);
            }
            final String finalLabelText = labelText;
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    textView.setText(finalLabelText);
                }
            });
        }
    });
}

I have some ideas on the label.getText to get all the value from ML Kit, but how can I handle only one type of it?我在 label.getText 上有一些想法可以从 ML Kit 中获取所有值,但是我怎么能只处理一种类型呢? Since I want to get the emotion type and doing the next.因为我想获得情感类型并做下一个。

If you consider training the emotion classifier for a specific person, you can use the result of MLKit Face Detection and calculate the features like (eye width/height), (eye-cheek distance/height of face) to feed the algorithms like KNN.如果您考虑为特定人训练情感分类器,您可以使用 MLKit 人脸检测的结果并计算(眼睛宽度/高度)、(眼颊距离/人脸高度)等特征来馈送 KNN 等算法。

And for the future plan of ML Kit SDKs, could you provide the potential use case for the emotion recognition and the potential usage if possible?对于 ML Kit SDK 的未来计划,您能否提供情感识别的潜在用例和可能的潜在用途?

Thanks!谢谢!

Julie from ML Kit来自 ML Kit 的 Julie

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过 Firebase ML Kit 人脸检测检测多个人脸的轮廓 - Detecting contours of multiple faces via Firebase ML Kit face detection 如何从 Android firebase ML-Kit BarcodeScannerProcessor onSuccess 找到上下文并启动新活动 - How can I find context and start a new Activity from Android firebase ML-Kit BarcodeScannerProcessor onSuccess 当人脸位于所需帧时,如何实时启动 ML Kit 人脸检测 - how to start ML Kit Face Detection in real time, when face is located in desired frame 为什么 Google 的 ML 人脸检测工具包在.process() 上崩溃 - Why is Google's ML Face Detection Kit crashing on .process() 如何使用Firebase ML套件识别地标? - How to recognize landmarks using Firebase ML kit? Microsoft Face API(使用Android)中缺少属性类型。 我如何使用Emotion属性? - Missing attribute types in Microsoft Face API (with Android). How can I use the Emotion attribute? 如何在 ML Kit Translation 中获取下载的模型 - How to get downloaded models in ML Kit Translation 为什么 Firebase ML Kit 每次都检测同一张脸的不同轮廓值 - Why Firebase ML Kit detect different contour values each time for same face 如何在 Windows 上的 Java 中使用 Firebase ML-Kit 文本识别 - How to use Firebase ML-Kit text recognition in java on windows 如何使用Firebase ML Kit创建用于条形码扫描的模块化类 - How to create a modular class for barcode scanning using Firebase ML Kit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM