简体   繁体   English

使用 React Native 进行面部识别 Python

[英]Facial Recognition Python with React Native

I'm working on an application that utilises the cameras of the smartphone for face recognition.我正在开发一个利用智能手机摄像头进行人脸识别的应用程序。

I have used the OpenCV, the face_recognition libs and a blink detection neural network in a Python script to detect and recognise live (real) faces.我在 Python 脚本中使用了 OpenCV、 face_recognition库和眨眼检测神经网络来检测和识别实时(真实)面部。

What would be the best way to execute the facial recognition Python script with the input frames coming from the smartphone camera in realtime?使用来自智能手机摄像头的输入帧实时执行面部识别 Python 脚本的最佳方法是什么? (by an API call?) (通过 API 调用?)

PS I am using React-Native as my frontend. PS 我使用 React-Native 作为我的前端。

Ideal thing would be like,理想的情况是,

1.Capture the frame from device camera 2.Send it to your Python API 3.Process the image in API and return your response, Probably a Boolean flag (eg: 1.Capture the frame from device camera 2.Send it to your Python API 3.Process the image in API and return your response, Probably a Boolean flag (eg:

{ RightFace:true, Blinking: true } { RightFace:真,闪烁:真 }

4.Process the response in your application and trigger next actions based on your response 4.在您的应用程序中处理响应并根据您的响应触发下一步操作

EG:例如:

 CheckFace=()=>{ var Response = //your api call response.parseJson() if(response.rightFace == "true") { login() } if(response.Blinking == "true") { onBlink() } }

This is just an abstract example and has no meaning.这只是一个抽象的例子,没有任何意义。 But this is the way you need to do it.但这是您需要这样做的方式。

Fell free to ask in case of any Query.如有任何疑问,请随时询问。

Thanks谢谢

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

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