ahmetozlu/face_recognition_crop

multi face

devileye1 opened this issue · 3 comments

Hi
great work, i have almost 100 different person how i can save after recognition them i need one frame only .... actually i need data for dash ploty for graph how many people recognized by my model counting ........thnx for help

What do you mean exactly? Can you specify your issue better, please? Thanks....

We have 100 students In my class I create flask app using tf opencv n facenet mtcnn model pre train work good …..now I need output images after recognition like 5 friends same time in frame (web,ip whatever), there is any way opencv Extract particular frame and save images with name and if Unkown person detected save his image in Unkown folder with date n time ,I have a CVS file Contain all 100 students name n one folder with name with images , if it’s possible then I can feed data to dash ploty for graph and Heroku for reports….. I really need this please help me in short I need to display a graph and monthly reports if there is any way please guide me sir

You can develop what you mentioned using OpenCV easily!

Here is the algorithm:

1.) Get the specific frames according to your requirements
2.) Perform face recognition model on the frames
3.) Crop each recognized faces and save them under the folders which are named with the recognized person's name
4.) Crop the unrecognized faces and save them under the folder which is named "unknown"
5.) Get the saved images counts and use that information to creating report

You can benefits this code to crop and save faces:

import cv2
img = input_video_frame
crop_img = img[y:y+h, x:x+w] # set the x, y, w, h considering recognized face pixel coordinates
cv2.imshow("cropped", crop_img)
cv2.imwrite(face_name + ".jpg", "./FaceDatabase" + face_name) # face_name comes from face recognizer and FaceDatabase is the location which is for storing cropped face images