facenet-pytorch
facenet-pytorch copied to clipboard
Poor performance speed on CPU
I followed this part in the README and executed the kaggle notebook for performance comparison. I'm using MacBook Pro with the following processor : 2.6 GHz 6-Core Intel Core i7.
The facenet-pytorch was the slowest detector (by far), as opposed to the results shown on your readme. Can you explain this surprising difference when switching from GPU to CPU ?
I can't add photos so i will just copy the output from the notebook:
facenet-pytorch
Detecting faces in 540x960 frames, 109.412 seconds Detecting faces in 720x1280 frames, 180.797 seconds Detecting faces in 1080x1920 frames, 298.694 seconds
facenet-pytorch (non batched)
Detecting faces in 540x960 frames, 79.293 seconds Detecting faces in 720x1280 frames, 127.121 seconds Detecting faces in 1080x1920 frames, 239.866 seconds
dlib
Detecting faces in 540x960 frames, 10.327 seconds Detecting faces in 720x1280 frames, 18.395 seconds Detecting faces in 1080x1920 frames, 38.444 seconds
mtcnn package
Detecting faces in 540x960 frames, 43.172 seconds Detecting faces in 720x1280 frames, 71.451 seconds Detecting faces in 1080x1920 frames, 146.714 seconds
the packages i'm using are :
torch 1.4.0
facenet-pytorch 2.2.9
dlib 19.19.99
tensorflow 2.1.0
mtcnn 0.1.0
I used it. It was real quick using gpu.
I am facing the similar issue on face detection. Even in GPU I am not able to attain the real time speed on the live feed. I am using open-cv to read the camera feed and passing to facenet-pytorch mtcnn
module. The bottleneck I see is in the mtcnn.detect()
which takes 0.08 to 0.1 second per frame which is like 10 to 12.5 FPS. Could anyone suggest on how attain real-time speed?