Git Product home page Git Product logo

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

View Code? Open in Web Editor NEW
473.0 16.0 119.0 18.94 MB

Automatic License Plate Recognition (ALPR) or Automatic Number Plate Recognition (ANPR) software that works with any camera.

Home Page: https://platerecognizer.com/

License: MIT License

Python 21.72% C# 0.88% C 32.43% C++ 43.46% Java 0.12% JavaScript 0.72% CSS 0.08% Dockerfile 0.24% Batchfile 0.11% Shell 0.24%
ocr machine-learning deep-learning anpr alpr plate-detection bounding-boxes license-plate-recognition number-plate-recognition

deep-license-plate-recognition's Introduction

Automatic License Plate Recognition Software (ALPR, ANPR)

Get high-accuracy, developer-friendly automatic license plate recognition (ALPR) or automatic number plate recognition (ANPR) software! The core of our ALPR, ANPR system is based on state of the art deep neural networks architectures.

Our machine-learning software:

Snapshot : Get license plate reader from images in under 60 minutes:

Stream : Get number plate recognition from camera or video feed:

  • Returns license plate results via CSV file or Webhooks.
  • Handles 4 cameras simultaneously on mid-range PC.
  • Runs on-premise on Linux, Windows , Mac and Jetson.

ALPR, ANPR software is ideal for parking, highway monitoring, toll, police surveillance, community security, and other use cases. Our license plate recognition (LPR) software can also forward results to our full ALPR Dashboard and Parking Management software solution, ParkPow. Sign up for a Free Trial now (no credit card required) or learn more at https://platerecognizer.com.




Reading License Plates from Images

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

For setup instructions of the script, checkout our guides here

# Getting started!
git clone https://github.com/parkpow/deep-license-plate-recognition.git
cd deep-license-plate-recognition
pip install requests pillow

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

Running the ALPR Locally (SDK)

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




Blurring License Plates and Redaction

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. It returns the bounding boxes of all the license plates. They can be used to blur or mask the license plates.

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.

The option --save-blurred lets you save blurred images. They are saved to a new file with _blurred suffix.

The option --ignore-regexp lets you specify a regex of plates to ignore from blur. This option can be specified multiple times.

The option --ignore-no-bb lets you ignore recognitions without a vehicle bounding box from blur.

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

python number_plate_redaction.py --api-key 77c### 58C5A57_14965463.jpg --save-blurred --ignore-regexp ^58c5a57$ --ignore-regexp ^[0-9][0-9]c5a57$




Process images from an FTP or SFTP server

You can send images directly to our FTP. See our FTP integration for details.

If you want to use your own FTP or SFTP server, another option is to process images with ftp_and_sftp_processor.py:

For setup instructions of the script, checkout our guides here

python ftp_and_sftp_processor.py --api-key MY_API_KEY --hostname FTP_HOST_NAME --ftp-user FTP_USER --ftp-password FTP_USER_PASSWORD --folder /path/to/server_folder

By default the script is prepared to process images in FTP servers, if you want to process images in an SFTP server, add the argument --protocol sftp.

To remove images from FTP or SFTP server after processing, add the argument --delete.

Arguments Description
-h, --help Show help message
-a, --api-key Your API key.
-r, --regions Match the license plate pattern for a specific region.
-s, --sdk-url URL to self-hosted SDK. For example, http://localhost:8080
-c, --protocol Protocol to use, available choices 'ftp'(default) or 'sftp'
-t, --timestamp Timestamp.
-H, --hostname Host.
-p, --port Port
-U, --ftp-user Transfer protocol server user
-P, --ftp-password Transfer protocol server user's password
-d, --delete Remove images from the FTP server after processing. Optionally specify a timeout in seconds.
-f, --folder Specify a folder with images on the FTP server.
-o, --output-file Save the result to a file.
-i, --interval Periodically fetch new images from the server every interval seconds.
--camera-id Name of the source camera.
--cameras-root Root folder containing dynamic cameras.
--format Format of the result, available choices 'json'(default) or 'csv'
--mmc Predict vehicle make and model (SDK only). It has to be enabled.
--pkey SFTP Private Key Path.




Automatic Image Transfer

Automatic Image Transfer is a command line tool that runs our ALPR Engine. It monitors a folder and automatically process images (Cloud or SDK) as they are added. Once processed, images are moved to an archive directory. 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.

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.