GithubHelp home page GithubHelp logo

barthpaleologue / alpr Goto Github PK

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

Realtime automatic license plate recognition project made at Ecole Polytechnique

License: MIT License

Jupyter Notebook 99.74% Python 0.26%
alpr computer-vision realtime

alpr's Introduction

ALPR

This is the repository of our final project for the X-INF573 course at École Polytechnique.

The goal was to perform realtime automatic european license plate recognition on a video stream in order to match the license plates with a list of potential targets.

Banner

Dataset

The dataset we used is an aggregate of these 3 datasets:

Romanian license plates: https://github.com/RobertLucian/license-plate-dataset

French license plates: https://github.com/qanastek/FrenchLicencePlateDataset

PP4AV (Paris + Strasbourg): https://huggingface.co/datasets/khaclinh/pp4av

Dependencies

You can install the necessary dependencies using pip install -r requirements.txt in a virtual environment.

Features

Image processing

To process a single image, use alprLib/singleImage.py like this:

python3 singleImage.py <path_to_image>

The testImages folder contains some images you can use to test the script.

Video processing

You can process videos both in an offline and realtime fashion.

  • For realtime processing use alprLib/cameraStream.py

  • For offline processing use alprLib/videoToVideo.py

For offline processing, one video is available in the testVideos folder. You can process it like this:

python3 videoToVideo.py testVideos/test.mp4 testVideos/test_out.mp4

Plate detection

We trained a highly performant and accurate YoloV4 Tiny model to detect license plates in images.

The model is abstracted in the Yolo class inside alprLib/yolo.py. Alternative weights can be found inside the yolo_weights folder.

Our model was trained on google colab using this notebook: https://colab.research.google.com/drive/1zi0m3pE3KcWyKATRhqo4wTCSqglzLG3u?usp=sharing You can use it to train your own model.

Plate extraction

Perspective correction and upscaling can be used independently using alprLib/Perspective.py and alprLib/upscale.py. Upscaling models are available in the alprLib/super_resolution folder.

More details about the perspective correction can be found in the warpPerspective folder.

Plate recognition

The TextOCR class from alprLib/TextOCR.py is a backend agnostic class that can be used to recognize text in images with either EasyOCR or Tesseract.

It performs upscaling using ESPCN, alternative models can be found inside the alprLib/super_resolution folder.

Plate matching

We also provide a utility to match the output of the OCR with a list of target license plates using the Levenshtein distance in alprLib/comparePlate.py.

alpr's People

Contributors

barthpaleologue avatar kgghislain 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.