Dlib: Face detection on Video frames is very slow in Python

Created on 21 Apr 2017  路  1Comment  路  Source: davisking/dlib

I have installed and compiled dlib on windows 10 with AVX_Instructions enabled to make code faster. Additionally, when building the project in Visual Studio I compiled it with the release mode x64.
I tested the c++ version of the code and is working perfectly and very fast.

Inside the dlib directory I write the following in cmd:
python setup.py install --yes USE_AVX_INSTRUCTIONS

But, when testing the python version of the code with a video as input, mainly face detection code, face detection was too slow, requiring around 170 ms for each frame.

Please note that I am reading the frames with opencv3.1.
I have anaconda and python3.

Most helpful comment

I have solved it, mainly the problem was with enlarging the frame size. That is, with:
dets = detector(frame, 1). Hence the one should be kept 0.

>All comments

I have solved it, mainly the problem was with enlarging the frame size. That is, with:
dets = detector(frame, 1). Hence the one should be kept 0.

Was this page helpful?
0 / 5 - 0 ratings