2

I'm having low fps for real-time object detection on my raspberry pi

I trained the yolo-darkflow object detection on my own data set using my laptop running windows 10. When I tested the model for real-time detection on my laptop with webcam it worked fine with high fps.

However when trying to test it on my raspberry pi, which runs on Raspbian OS, it gives very low fps rate that is about 0.3. When I only try to use the webcam without the yolo it works fine with fast frames. Also when I use Tensorflow API for object detection with webcam on my raspberry it also produces low fps rate 0.7.

Can someone suggest me something please? Is the reason related to the yolo models or opencv or python? How can I make the fps rate higher and faster for object detection with webcam?

  • Usually you would offload this heavy work to a real server. It is a fight against latency and accuracy. So you would get your server to connect to the video stream and do the heavy lifting there. By server I mean a machine with cpu that has full extension features which will help with a lot of video and arithmetic loads – Piotr Kula Feb 27 at 14:54
2

You get low FPS because the raspberry can not handle the workload fast enough so that it can produce real-time results.

Here are some ways you can get better performance:

Overclock the CPU

You can overclock the Raspberry Pi's CPU from the configuration menu (sudo raspi-config). Be sure to provide sufficient cooling to avoid damaging the board. It is the most obvious thing to do, but it demands a good cooler.

Optimize your application

Optimize your code so that you don't waste resources. Avoid using a scripting language to execute your code (sorry Python). You should consider the Tensorflow's object detection as the best results you will get (it is supposed to be optimized). Try to achieve that performance of 0.7 fps on your application.

Reduce the workload

By decreasing the workload of your application, you can speed it up. Since your input is a web camera, you can decrease the capturing resolution. Decreasing the resolution may have an impact on the application error rate.


I would first try to reduce the web camera resolution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.