Giter Site home page Giter Site logo

automatic-number-plate-recognition-python-yolov8's People

Contributors

computervisioneng avatar sawlachintan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automatic-number-plate-recognition-python-yolov8's Issues

csv file

When it runs and detect the cars it does not create the csv file.

IndexError: index 1 is out of bounds for axis 1 with size 1

When executing main.py, it works for a while
(0: 384x640 1 license_plate, 133.0ms
Speed: 4.5ms preprocess, 133.0ms inference, 2.5ms postprocess per image at shape (1, 3, 640, 640)

But eventually I get this error:
0: 384x640 (no detections), 90.0ms
Speed: 3.5ms preprocess, 90.0ms inference, 1.0ms postprocess per image at shape (1, 3, 640, 640)
Traceback (most recent call last):
File "C:\Users.....\Downloads\Plate Recognizer\main.py", line 39, in
track_ids = mot_tracker.update(np.asarray(detections_))
File "C:\Users.....\Downloads\Plate Recognizer\sort\sort.py", line 232, in update
matched, unmatched_dets, unmatched_trks = associate_detections_to_trackers(dets,trks, self.iou_threshold)
File "C:\Users.....\Downloads\Plate Recognizer\sort\sort.py", line 163, in associate_detections_to_trackers
iou_matrix = iou_batch(detections, trackers)
File "C:\Users.....\Downloads\Plate Recognizer\sort\sort.py", line 55, in iou_batch
yy1 = np.maximum(bb_test[..., 1], bb_gt[..., 1])
IndexError: index 1 is out of bounds for axis 1 with size 1

Car Ids get mixed and confused

Hello, thanks for your work on this model, I'm trying to rework it to work for Bulgarian license plates.

Frame Number,Car ID,License Plate,License Plate Score
5,1.0,CB8720TB,0.19673294579956319
21,4.0,KH5888BB,0.9785588194941117
28,4.0,KH5888BB,0.9739094052919942
29,1.0,CB8721TB,0.7660037101535193
33,1.0,CB8721TB,0.9926543276777186
35,4.0,KH5888BB,0.727899136655683
40,2.0,KH5838BB,0.5232681246358013
41,2.0,KH5338BB,0.1993557146048851
46,2.0,KH5888BB,0.9483313948229857
47,4.0,KH5888BB,0.8478755559926319
52,2.0,KH5888PB,0.6605058769015101
53,4.0,KH5888BB,0.7585433100466406
109,5.0,CA8978CX,0.18090781188533808
112,5.0,CA8942CX,0.23740360470947774
122,5.0,C8943CX,0.15154307079896012
135,5.0,CA5933CX,0.49990012910380177
136,5.0,CA3243CX,0.5319690946654391
138,5.0,CA8323CY,0.10956470000898931
315,13.0,CA2060AM,0.3455165278029194

The problem is that one car gets confused with different id's. Look at frames 21,28,40,41,46,47 it confuses the ids (2, and 4) Has anyone had this problem? Can someone provide a solution?

loop

I have followed your tutorial. But when iam trying to execute the main.py it did not produce any output. the code is just running forever. any issue i use anaconda prompt to run the main.py file.

test.csv not found

even after cloning the repo, many files were missing as compared to video . where to find them ?

sort algorithm

track_ids = mot_tracker.update(np.asarray(detections_))

I'm getting error here when no detection ..

AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

When running main.py, we will receive a notification:
python3.8/site-packages/easyocr/utils.py", line 576, in compute_ratio_and_resize
img = cv2.resize(img,(int(model_height*ratio),model_height),interpolation=Image.ANTIALIAS)
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

The reason: "Pillow" package higher than v9.5.0

Solution: pip install Pillow==9.5.0

or update this line under "requirement.txt"
Pillow==9.5.0

GPU?

Hello, how can I run this model on my GPU, its using my CPU instead?

.track() instead of SORT

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)

I am facing this issue for indian number plate video please help me

Screenshot (7)

Traceback (most recent call last):
File "c:\automatic-number-plate-recognition-python-yolov8-main\main.py", line 39, in
track_ids = mot_tracker.update(np.asarray(detections_))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\automatic-number-plate-recognition-python-yolov8-main\sort\sort.py", line 232, in update
matched, unmatched_dets, unmatched_trks = associate_detections_to_trackers(dets,trks, self.iou_threshold)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\automatic-number-plate-recognition-python-yolov8-main\sort\sort.py", line 163, in associate_detections_to_trackers
iou_matrix = iou_batch(detections, trackers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\automatic-number-plate-recognition-python-yolov8-main\sort\sort.py", line 54, in iou_batch
xx1 = np.maximum(bb_test[..., 0], bb_gt[..., 0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: operands could not be broadcast together with shapes (0,) (1,2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.