Open AlexeyAB opened 5 years ago
Hi Alexey, thanks for your work.
I'm not sure if this proposal will increasse the speed, at least substantially.
I checked the FPS from the contribution only of the function: detections = darknet.detect_image(netMain, metaMain, darknet_image, thresh=0.25)
And with my card, GeforceGTX 1070TI I get from around FPS=9.7 the full code, to FPS=9.1 aprox. for only the detection.
So my guess is that the bottle neck of speed in Python should be inside detect_image, or do I'm wrong? Where do you think is the slowdown form C++ to Python? In C++ it goes like a 3x faster.
Please let me know your opinion I would be interested to contribute. Regards!
in c++ you get ~27fps and only 9fps with the python?
Yes(even higher in c++), I see the ussage of the GPU-util. differs:
That's shocking! I haven't actually directly compared, myself but I'm getting roughly the results I expect with python. What weights/config are you using? how do you test? I'll try and reproduce your results, I have a python wrapper based on darknet_video.py - maybe I can help work out why it's so bad in your case.
Thanks LukeAI,
I test it with the default version of darknet_video.py loading a mp4 file. In c++ I use ./darknet.exe detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights -ext_output test.mp4 all config is default.
Both are using yolov3.cfg
After looking and playing around the yolo_cpp_dll and its dependencies, I think after I rebuilt it, started to run faster in Python. Now runs around 1/3 faster in c++ than in Python, that's reasonable.
Regards.
@migvel what exactly did you do exactly? because using the python3 script i am getting around 40 fps where using the c++ (detector demo) i am getting 80-90 fps
@AlexeyAB can you explain what is heppening here? does the C++ code use threading or more optimized in anyway?
hello @IbrahimBond did you find an answer about this difference between c++ and python regarding fps please ? Thanks
Improve detection speed on video for python script
darknet_video.py
Use multiple CPU-threads, at least 3 threads:
image
FP32-type