OAID / FaceRecognition2

FaceRecognition2 is an implementation project of face detection and recognition. The face detection using MTCNN algorithm, and recognition using LightenedCNN algorithm.
20 stars 13 forks source link

How to increase number of simultaneous face detection in one frame #2

Open rahulsharma11 opened 5 years ago

rahulsharma11 commented 5 years ago

Hi, Thanks for the awesome project. Here i tested for the max number of simultaneous face recognition/detection (in one frame) is 3 . Can i increase this number? In older version "FaceRecognition" there is a parameter "maxFaceNum" that can be used to increase simultaneous number of face detection. Is there something same in this project? Thanks.

xcls1117 commented 5 years ago

@rahulsharma11 Yes, see facecaffe/face_demo.cpp: std::string FaceDemo::Recognize(cv::Mat &frame, int face_num) you can see max number is set when it's called, and called here: facecaffe/AlgThread.cpp: line 60 (default set to 3) std::string ss = mFace_demo.Recognize(mRgb, 3);

rahulsharma11 commented 5 years ago

Ok....Thanks. I did change that to "5". Then it was throwing segmantation fault. I also changed here- facecaffe/AlgThread.cpp: line 164 : for(int icount = 3; icount > atoi(sub[1]); icount--) to "icount=5" Then there was no error but as soon it detects 4 faces, it shuts down giving Aborted error msg. Do i need to change somewhere else?

xcls1117 commented 5 years ago

@rahulsharma11 sorry, i forget. you should also change the default setting here: include/AlgThread.h (line 64, Mface m_face[3];) this should work.

rahulsharma11 commented 5 years ago

Hi @xcls1117 , Thanks for that point also. I did that change but same result.:-(

Can you please just verify that only these changes would be sufficient by yourself? if possible?

rahulsharma11 commented 5 years ago

Hi, one more querry is that how can i change the resolution to say (640x480)? There are parameters in demo.conf, VideoWidth and height that are set to 1280x720. I want to change the resolution to 640x480. If i change that then it throws error of assersion failed. I can see that there is a scale parameter that gives 640x360 image size, but on imshow, the output image appears to be small and face detection baundry goes out of frame. Any suggestion?