I am having a problem with catching up while doing object detection with a live stream video using YoloV3 on a CPU. It is hapenning because FPS rate on CPU is around 3-4, because detections are taking too much time and live stream video speed is around 15 FPS. I am doing both detections and tracking of objects, which is why I need to catch up with the speed rather than decreasing the speed of a live stream video. Please, suggest what could be done. I am looking into using smaller Yolov3 model such as ImageAI's TinyYoloV3, but it is affecting the accuracy by a lot. I also have access to a single GPU, but I am not able to run multiple processes on the same GPU, as I need to be processing around 10 camera streams at the same time. Please, advise.
Asked
Active
Viewed 681 times
1
-
Do you really need to do object detection every single frame? Perhaps you could detect objects every fifth frame so the cpu can catch up with the livestream. You can do this with the `multiprocessing` module using either a `Pipe` or `Queue` object. – Sebastian Liendo Aug 14 '20 at 22:13
-
I am not doing detections every 10 frames and I am detecting cars, which means, I will start missing too many cars, if I do it less frequently. I will look into multiprocessing, you are mentioning, but I do not think passing multiple images to the Yolo model would be mean that it will take less time to process them, right? – Sherzod Kariev Aug 14 '20 at 22:25
-
I don't think so, batch processing in cpu doesn't really make things better. And I mean, if you do the detections every five frames on a 15 fps camera, that would mean every **third of a second** you're detecting objects; unless the vehicles are on a highway, I don't think the performance would drop that much. – Sebastian Liendo Aug 14 '20 at 22:41
-
Well, the problem is that even so I am trying to detect twice a second, detection process takes another half a second in best case, which means when I ask for a next frame, I do not get the very next frame, but I get 5-10 frames later frame and this is when my tracking is getting messed up – Sherzod Kariev Aug 14 '20 at 22:53
-
Yeah, that's why you need to fetch frames on one process and do the detection on another process so you get continuous frames. That's where the multiprocessing module comes in really handy! – Sebastian Liendo Aug 14 '20 at 23:16
-
Well, that sounds reasonable. Let me try that! Thanks! – Sherzod Kariev Aug 14 '20 at 23:44
-
Welcome to Stack Overflow. Thank You for a good dialogue on the problem statement. To help you better, please make sure you post your code so we can review and see how we can help. Even if you don't have a fully working code, it is important to share your work as you ask for help – Joe Ferndz Aug 15 '20 at 04:20
-
Not an answer, but I too need to do object detection on a live stream that is coming from a drone, could you please share on your architecture and how exactly are you getting the frames and from where please. https://stackoverflow.com/questions/64328188/how-to-do-object-detection-on-a-video-stream-coming-from-a-websocket-url If you could have a look at this question, I would really appreciate it. – Vikranth Oct 13 '20 at 03:48
-
Have you already find an answer? If you did, could you post it here? I'm with the same problem. – Bruno Fonseca Mar 02 '21 at 13:44