computervisioneng / automatic-number-plate-recognition-python-yolov8

GNU Affero General Public License v3.0
324 stars 132 forks source link

.track() instead of SORT #16

Open mpolinowski opened 12 months ago

mpolinowski commented 12 months ago

Hi computervisioneng,

thank you for sharing your code and also for the YT tutorial!

I did run into 2 problems when following your guide and wanted to share the solutions that I found:

  1. The SORT repo is no longer maintained (?) or at least not been updated in a long time. I saw that you already fixed some of the deprecation issues to make it work in TF2. But using the newest Version of Tensorflow added even more issues. Also mixing TF with PyTorch inside a single docker container can be a headache.
  2. I am still training my model - but even after an entire night it is still prone to detect false positive license plates. Leading to a lot of false detections that bog down the OCR step.

Solution for 1.)

I just saw in your latest video that you also discovered the YOLO track function - it is the perfect drop-in replacement. I prepared a notebook here - largely based on your code but with a sprinkle of track():

Solution for 2.)

You are using the license plate detector on the entire frame. I now started experimenting with taking the crop of a vehicle bbox instead. So the second model is only triggered if a vehicle was detected by the first one and the search area is limited by the bounding box.

I am still testing how this affecting my detection rate and how this might be improved. But it seems to be working reasonably well in my initial test. (The visualization step is not yet "refined", though)

computervisioneng commented 11 months ago

thank you! I will update this project as soon as possible. Additionally, you are welcome to submit a pull request.