Giter Site home page Giter Site logo

emenjulio / deep-license-plate-recognition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from parkpow/deep-license-plate-recognition

0.0 0.0 0.0 13.17 MB

Deep learning based Automatic License Plate Recognition API

Home Page: https://platerecognizer.com/

License: MIT License

Python 5.16% C# 1.85% C 36.04% C++ 56.80% Java 0.15%

deep-license-plate-recognition's Introduction

Automatic License Plate Recognition API

Accurate, fast and easy to use API for license plate recognition. Trained on data from over 100 countries and regions around the world. The core of our license plate detection system is based on state of the art deep neural networks architectures.

Integrate with our ALPR API in a few lines of code. Get an easy to use JSON response with the number plate value of vehicles and the bounding boxes.

Reading License Plates from Images

Get your API key from Plate Recognizer. Replace MY_API_KEY with your API key and run the following command:

pip install requests
python plate_recognition.py --api-key MY_API_KEY /path/to/vehicle.jpg

The result includes the bounding boxes (rectangle around object) and the plate value for each plate. View the details of the results on our documentation.

[
  {
    "version": 1,
    "results": [
      {
        "box": {
          "xmin": 85,
          "ymin": 85,
          "ymax": 211,
          "xmax": 331
        },
        "plate": "ABC123",
        "score": 0.904,
        "dscore": 0.92
      }
    ],
    "filename": "car.jpg"
  }
]

Lookups For a Specific Region

You can match the license plate patterns of a specific region.

python plate_recognition.py --api-key MY_API_KEY --regions fr --regions it /path/to/car.jpg

Process Multiple Files (Batch Mode)

You can also run the license plate reader on many files at once. To run the script on all the images of a directory, use:

python plate_recognition.py --api-key MY_API_KEY /path/to/car1.jpg /path/to/car2.jpg /path/to/trucks*.jpg

Blurring License Plates and Redaction

You can also blur the license plate with --blur-amount AMOUNT. AMOUNT is a number between 0 and 50. Blurred images are saved to a new file with _blurred suffix. For example:

pip install pillow
python plate_recognition.py --api-key MY_API_KEY --blur-amount 4 --blur-plates /path/to/vehicle.jpg

Redaction Mode

The script number_plate_redaction.py differs from the default prediction script because it also detects plates that are barely readable and/or very small.

In addition, it can split the image in smaller images to better deal with high resolution images. This will use 3 lookups instead of just 1. To use this options add --split-image.

It returns the bounding boxes of all the license plates. They can be used to blur or mask the license plates.

python number_plate_redaction.py --help
python number_plate_redaction.py --sdk-url http://localhost:8080 --split-image vehicels.jpg




To use a locally hosted sdk, pass the url to the docker container as follows:

python plate_recognition.py --sdk-url http://localhost:8080 /path/to/vehicle.jpg




Number Plate Recognition on a Video

To do ANPR on videos, you will also need to install OpenCV. Here are the installation instructions. Those 2 python packages are also needed:

pip install requests
pip install pillow

The script alpr_video.py lets you perform license plate recognition on a video file. It looks at each frame of the video and reads license plates. If you are only interested in one part of the video, you may use the --start and --end arguments. Additionally, you can use the --skip argument to read 1 in every N frames. It will speed up the analysis of large videos. Here's an example:

python alpr_video.py --api MY_API_KEY --start 900 --end 2000 --skip 3 /path/to/cars.mp4

OpenCV is also capable of reading live video streams. See this page for an example.




Number Plate Recognition on a Live Camera Stream

Follow the instructions above to install OpenCV including the installation of dependencies requests and pillow. Then run the script as shown below.

Usage:

python anpr_campera_stream.py --help

For example:

python anpr_camera_stream.py --show-image --camera rtsp://192.168.x.x:5554/camera --api-key MY_TOKEN --regions fr --output /path/to/save.csv

CSV output example:

date,license_plate,score,dscore,vehicle_type
12/19/19 05:33:10,nwk652,0.675,0.704,Car
12/19/19 05:33:12,nmk669,0.625,0.823,Car

For testing purposes when you don't have a camera, you can install CamOn Live Streaming app from the Google Play Store and use its RTSP url to stream your mobile phone's camera.




Automatic Image Transfer

Monitor a folder and automatically process images (Cloud or SDK) as they are added. It can also forward the results to our parking management service Parkpow.

To get started: python transfer.py --help




Code Samples

See our sample projects to easily get started with the API.





Have questions? Let us know how we can help.

Provided by Plate Recognizer, a subsidiary of ParkPow.

deep-license-plate-recognition's People

Contributors

calebmuhia avatar chniter avatar marcbelmont 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.