pythonopencvyoloautomatic-license-plate-recognition

How to make ANPR detection faster by running it on a separate thread from video playback in Python using YOLO


How to play the input video smoothly while doing ANPR on that video using YOLO

I am developing a ANPR solution and the solution need to be work on real time . The detection of number plate , performing OCR on the same is done. I am using YOLO , python and OPenCV. My problem is the video is playing very slowly. It is taking each frame of the video and applying ANPR algorithm on that. I feel that is why it is going too slow. Is there any process to play the video in one thread and do the ANPR algorithm in another thread using python? If yes how that can be done in python. Any help would be appreciated. Thank you.


Solution

  • That requires threads.

    And it requires careful synchronization between the video stream and the vision processing thread.

    The vision processing may not be fast enough to process all frames in real time, so you need to handle that. Or it may be. Then you need to handle that too. And that may change at runtime. That is "careful synchronization".

    The vision processing must never process the same frame twice but it must also not demand to see every frame from the video stream either, because that would choke the entire pipeline or blow up your RAM.