[英]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.