Rajatkalsotra / Face-Recognition-Flutter

Realtime face recognition with Flutter
MIT License
164 stars 85 forks source link

How to recognition only one face? #7

Closed doanbh closed 3 years ago

doanbh commented 3 years ago

Good job and good project. Can you help me how to recognition only face? I don't want to recognition many people at once. Currently, the performance is not very good. I want to ask if it is possible to capture image from camera and send to server and recognition on Python Server to ease the app. On the web I used SocketIO to do this. Do not know with Flutter can do this?

Rajatkalsotra commented 3 years ago

@doanbh For just single face, use map instead of multimap. https://github.com/Rajatkalsotra/Face-Recognition-Flutter/blob/5ab50add873bb9ea20c031fe523ba81cee6a0725/lib/main.dart#L93

Rajatkalsotra commented 3 years ago

@doanbh As far as the performance is concerned, sending real-time images to server would make it slower and inference time of mobile face net model is quite low. The actual lag is due to the processes before it.

doanbh commented 3 years ago

@Rajatkalsotra Many thank you for your help. In your opinion, it seems that using the face net model handled under the app is better than sending it to the server. But it cannot detect face anti-spoofing. Do you have any way?

Rajatkalsotra commented 3 years ago

@doanbh You're welcome. For anti-spoofing you can perform liveness detection by training your classification model and then convert it into tflite.

doanbh commented 3 years ago

Can you tell me more specifically what should I do? I'm having a problem, if the user uses a photo for facial recognition, it's also being accepted.

Rajatkalsotra commented 3 years ago

@doanbh Train a simple classfication model (real /fake image) and convert it into tflite. Refer the following link: https://www.pyimagesearch.com/2019/03/11/liveness-detection-with-opencv/

doanbh commented 3 years ago

@doanbh For just single face, use map instead of multimap. https://github.com/Rajatkalsotra/Face-Recognition-Flutter/blob/5ab50add873bb9ea20c031fe523ba81cee6a0725/lib/main.dart#L93

Many thank, but I use Map, it's not working. I want to identify only one person at a time. Let me know how?