Coder Social home page Coder Social logo

bobarna / yolov7-number-plates Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 33.78 MB

Transfer learning for recognizing number plates on vehicles. Main repository of the project: https://github.com/bobarna/bme-image-processing

License: GNU General Public License v3.0

Python 1.03% Shell 0.01% Jupyter Notebook 98.96% Dockerfile 0.01%

yolov7-number-plates's Introduction

Transfer Learning to Number Plate Recognition

Main repository of the project: https://github.com/bobarna/bme-image-processing

TLDR usage for cutting out all deteted number plates

  1. Download some dataset of cars into the number-plates-hun/images folder.
  2. Download yolov7 weights trained for number plate recognition:
  3. Run inference with trained yolov7 weights: python detect.py --weights yolov7-number-plates-trained.pt --img-size 448 --source number-plates-hun/images --name number-plates-recognition --save-txt --save-conf --nosave --project inference --exist-ok
  4. Move detected *.txt labels into folder inference/labels: mv number-plates-hun/number-plates/recognition/labels number-plates-hun/labels
  5. Cut out all detected objects: python cutout.py number-plates-hun
  6. Results are in the number-plates-hun/found-classes folder.

Running inference (detecting licence plates)

python detect.py --weights weights-number-plates.pt --img-size 448 --source number-plates-hun/ --name test-number-plates --save-txt --save-conf
  • --weights: pretrained weights (result of the transfer learning)
  • --img-size: size used for the inference
  • --source: folder containing the images
  • --name: name for this inference
  • --save-txt: also saves the labels as *.txt files
  • --save-conf: also saves the confidence in the *.txt files

(detect.py could also take in single images instead of a whole directory.)

Each line of a detection (image_name.txt) takes the following form:

object_id x_min x_max y_min y_max confidence
  • object_id: describes which object is detected (in our case, this is always 0 for the number plate class)
  • x_min, x_max, y_min, y_max: describe the dimension of the bounding box
  • confidence: 0..1 value for the confidence of the given detection.

(We modified detect.py to output detections in image-space, instead of the original relative dimensions.)

Run transfer learning (for reproducibility)

python3 train.py --workers 8 --device 0 --batch-size 8 --data data/number-plates.yaml --img 420 --cfg cfg/training/yolov7-number-plates.yaml --weights yolov7_training.pt --name yolov7-custom --hyp data/hyp.scratch.custom.yaml

Forked from the official YOLOv7 implementation

For more details, see:

yolov7-number-plates's People

Contributors

bobarna avatar

Watchers

 avatar

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.