ultralytics / yolov5

YOLOv5 πŸš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.65k stars 16.33k forks source link

About car number recognition using yolov5s #3497

Closed leeyunhome closed 3 years ago

leeyunhome commented 3 years ago

❔Question

Hello,

Thank you for your always good help. We are using yolov5s to recognize car numbers called lpr and anpr. I am deducing from the jetson nano by labeling the number inside the license plate rather than recognizing only the license plate.

The accuracy is very poor. We know that car license plate and number recognition is usually done by object detection up to license plate and numbering using ocr (optical character recognition), but we do not use ocr based on the excellent performance of yolov5s and all objects (license plate, license plate) genus number) by labeling and learning and inferring.

Is this a limitation of the jetson nano? Models over yolov5s are not usable in jetson nano because they are slow. Is it possible to recognize a car number with more than 95% accuracy using yolov5s?

If you know of a project that uses yolov5s to perform license plate recognition and number recognition, can you please let me know?

Thank you.

Additional context

glenn-jocher commented 3 years ago

@leeyunhome I can't comment on your custom dataset, but in general for best results with small objects you'll want to run inference at large image sizes. A full guide on improving training results is below, including commentary on image sizes.

πŸ‘‹ Hello! Thanks for asking about improving training results. Most of the time good results can be obtained with no changes to the models or training settings, provided your dataset is sufficiently large and well labelled. If at first you don't get good results, there are steps you might be able to take to improve, but we always recommend users first train with all default settings before considering any changes. This helps establish a performance baseline and spot areas for improvement.

If you have questions about your training results we recommend you provide the maximum amount of information possible if you expect a helpful response, including results plots (train losses, val losses, P, R, mAP), PR curve, confusion matrix, training mosaics, test results and dataset statistics images such as labels.png. All of these are located in your project/name directory, typically yolov5/runs/train/exp.

We've put together a full guide for users looking to get the best results on their YOLOv5 trainings below.

Dataset

COCO Analysis

Model Selection

Larger models like YOLOv5x and YOLOv5x6 will produce better results in nearly all cases, but have more parameters, require more CUDA memory to train, and are slower to run. For mobile deployments we recommend YOLOv5s/m, for cloud deployments we recommend YOLOv5l/x. See our README table for a full comparison of all models.

YOLOv5 Models

Training Settings

Before modifying anything, first train with default settings to establish a performance baseline. A full list of train.py settings can be found in the train.py argparser.

Further Reading

If you'd like to know more a good place to start is Karpathy's 'Recipe for Training Neural Networks', which has great ideas for training that apply broadly across all ML domains: http://karpathy.github.io/2019/04/25/recipe/

leeyunhome commented 3 years ago

Hello,

Images per class. β‰₯1.5k images per class Instances per class. β‰₯10k instances (labeled objects) per class total

  1. What is the unit of 1.5k? Are you talking about 1500 images?
  2. I don't know what the instance refers to exactly. Can you explain with an example that there is one image?
  3. I have 42000 car license plates and number images that are labeled. Could this be enough?

Thank you.

glenn-jocher commented 3 years ago

@leeyunhome 1.5k indicates 1500 using the metric prefix k for kilo: https://en.wikipedia.org/wiki/Metric_prefix

GGDRriedel commented 3 years ago

Hello,

Images per class. β‰₯1.5k images per class Instances per class. β‰₯10k instances (labeled objects) per class total

1. What is the unit of 1.5k? Are you talking about 1500 images?

2. I don't know what the instance refers to exactly. Can you explain with an example that there is one image?

3. I have 42000 car license plates and number images that are labeled. Could this be enough?

Thank you.

When you have 1000 images with 2 license plates labeled "license plate" per image you have 2k instances on 1k images

If you have 42000 license plates labeled, if we are talking just the numbers 0 to 9 you have ~ on average ~ 4200 instances per class if a license plate would just contain one number.

Here in Germany we have numbers and letters, so 10+26 classes =36 classes for the signs. If one license plate had just one sign you'd have on average 1.166 instances per class.

Best case: your 42000 is not license plates but license plates with labeled signs, so lets say a license plate has 6 signs a-b, 0-9 that would make 420006 labels or 420006/36 7000 instances per class

If however your 42000 labeled images are "just" labeled letters/numbers you'd have 42000/36 = 1166 instances per class

github-actions[bot] commented 3 years ago

πŸ‘‹ Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 πŸš€ resources:

Access additional Ultralytics ⚑ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 πŸš€ and Vision AI ⭐!