简体   繁体   English

在 Android Studio 中使用 OpenCV 和 Tensorflow 进行实时情绪检测

[英]Real time emotion detection with OpenCV and Tensorflow in Android Studio

I am trying to build an Android app with Android Studio(Java), that based on a tensorflow model(pretrained in python) is able to classify the emotion of the person standing in front of the device's camera.我正在尝试使用 Android Studio(Java)构建一个 Android 应用程序,该应用程序基于 tensorflow 模型(在 python 中预训练)能够对站在相机前面的人的情绪进行分类。 My app needs to take the frame, apply some opencv operations like facedetection, grayscale, resize, crop, and histogram equlisation, and after that, giving the result to the model, it will predict the emotion.我的应用需要取帧,应用一些 opencv 操作,如面部检测、灰度、调整大小、裁剪和直方图均衡,然后将结果提供给 model,它将预测情绪。 I have an activity that is showing the camera, but i dont know how to do all this frame manipulation and prediction in the background, when on the phone's screen the preview of the camera and the tags of the predictions, are the only things showing.我有一个显示相机的活动,但我不知道如何在后台进行所有这些帧操作和预测,当在手机屏幕上时,相机的预览和预测的标签是唯一显示的东西。

I managed to do this on PC very easly, running on the max FPS of the webcam, so i think it should be possible on the phone too.我很容易在 PC 上做到这一点,在网络摄像头的最大 FPS 上运行,所以我认为在手机上也应该可以。

Is there any similar project that i can get inspiration from?是否有任何类似的项目可以让我从中获得灵感? or does anyone know a bit of documentation or a way to do something like this?或者有没有人知道一些文档或做这样的事情的方法?

I would suggest checking out the Google ML Vision API's, they can easily be integrated into an Android App and are very accurate.我建议查看 Google ML Vision API,它们可以轻松集成到 Android 应用程序中,并且非常准确。 There are many API's like the image labeller and facial labeller.有许多 API,例如图像标注器和面部标注器。 Just check them out here: https://developers.google.com/ml-kit/vision/face-detection/android只需在此处查看它们: https://developers.google.com/ml-kit/vision/face-detection/android

Hope I could help!希望我能帮上忙!

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM