libfacedetection
libfacedetection copied to clipboard
Very low framerate
In my very good laptop it runs at 10 Hz in release mode! Any idea for improvement? Thanks
So how good is your computer? Can you provide details on your hardware setup and running environment, such as CPU model, OS and compiler?
Also note that you should turn on high performance mode when running on a laptop.
my computer: Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, 8 cores, 64GB RAM Ubuntu 20.04 LTS 64bits, GCC 9.3
Looks good. If I understand correctly, '10 Hz' means 10 FPS. But,
- Did you turn on high performance mode?
- Did you compile with multi-threading enabled? You can post your CMAKE command for building the project.
- What is the size of your input images/frames? If your laptop is equiped with a 720P (1280x720) or 1080P (1920x1080) camera, it makes sense to have about 10FPS. Please refer to the table in readme.
yes 10fpd Yes, it is automatically turn on in high performance mode My Video with VGA set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -O3 -mavx2 -mfma -fopenmp")
Did you try our example (https://github.com/ShiqiYu/libfacedetection/blob/master/example/detect-camera.cpp) or compose your own? If you have not try our example, you can change the input from a webcam to your video, and uncomment line84 to verify the input size.
@fengyuentau i tested too your example with video and have the same low FPS!
- Can you confirm the input resolution? Is it 640x480?
- Can you confirm that the mutli-threading is enabled when the example is running? You can run
htopin terminal to monitor the load of each core when running example.
yes, VGA

@fengyuentau is it clear for you to understand my problem?
+1; I have a quite similar problem with the performance, I cannot reach the performance reported in the tables. My PC specs are:
Processor: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz 2.21 GHz Installed RAM: 32.0 GB System type: 64-bit operating system, x64-based processor Graphics card: GeForce Nvidia RTX 2080
@tofis-imverse @fengyuentau Did you find any solution for this?
@Thanh-Binh I was able to reach almost the reported latency (maybe x1.2) using the .lib built in cmake with the suggested flags instead of adding the source files. Did you try that?
@tofis-imverse I am not sure if I understood you well. Could you pls share your cmakefile.txt? Thanks
@Thanh-Binh Yes, you can find it here https://drive.google.com/file/d/1I9DwiPCRac8dhrL8irG5moLHEpNNcdFS/view?usp=sharing.
@tofis-imverse thanks for sharing. I will test it soon
@tofis-imverse same problem here, I used a pretty good i7 9 generation cpu laptop, using the demo: detect-camera, test results: average of 500ms per frame. you mentioned that some cmake flags should be as suggested, BUT after i use your cmake file, the result is same as the default cmake file build version.