Skip to content

Repository files navigation

Our facial recognition algorithm is globally top-ranked by NIST in the FRVT 1:1 leaderboards. badge

Latest NIST FRVT evaluation report 2024-12-20

FRVT Sheet

🆔 ID Document Liveness Detection - Linux - Here badge

🤗 Hugging Face - Here

📚 Product & Resources - Here

🛟 Help Center - Here

💼 KYC Verification Demo - Here

🙋‍♀️ Docker Hub - Here

sudo docker pull kbyai/license-plate-recognition:latest
sudo docker run -v ./license.txt:/home/openvino/kby-ai-alpr/license.txt -p 8081:8080 -p 9001:9000 kbyai/license-plate-recognition:latest

Automatic-License-Plate-Recognition

Overview

This repository demonstrates ANPR/ALPR(Automatic Number/License Plate Recognition) server SDK with unmatched accuracy and precision by applying cutting-edge deep learning techniques.
KBY-AI's LPR solutions utilizes artificial intelligence and machine learning to greatly surpass legacy solutions. Now, in real-time, users can receive a vehicle's plate number through API.

We can customize the SDK to align with customer's specific requirements.

◾License Plate Recognition SDK Product List

No. Repository SDK Details Status
➡️ LPR - Linux License Plate Recognition Linux SDK Available
2 LPR - Docker License Plate Recognition Docker Image Available
3 LPR - Flutter License Plate Recognition Flutter SDK Available
4 LPR - C# License Plate Recognition C# SDK Available
5 LPR - Android License Plate Recognition Android SDK Available
6 LPR - iOS License Plate Recognition iOS SDK Available

To get more products, please visit products here:

Try the API

Online Demo

To try KBY-AI ALPR online, please visit here

Please select tab 'ALPR/ANPRfor thisSDK` image

Gradio Demo

To test the Gradio demo from the Docker image, access it at http://127.0.0.1:9001 or http://localhost:9001. image

Postman

The API can be evaluated through Postman tool. Here are the endpoints for testing:

SDK License

This project demonstrates KBY-AI's License Plate Recognition Server SDK, which requires a license per machine.

  • The code below shows how to use the license:
    machineCode = getMachineCode()
    print("\nmachineCode: ", machineCode.decode('utf-8'))
    try:
    with open(licensePath, 'r') as file:
    license = file.read().strip()
    except IOError as exc:
    print("failed to open license.txt: ", exc.errno)
    print("\nlicense: ", license)
    ret = setActivation(license.encode('utf-8'))
  • To request the license, please provide us with the machine code obtained from the getMachineCode function.

Please contact us:

🧙Email: contact@kby-ai.com
🧙Telegram: @kbyaisupport
🧙WhatsApp: +13348402323
🧙Discord: KBY-AI
🧙Teams: KBY-AI

How to run

1. System Requirements

  • CPU: 2 cores or more (Recommended: 2 cores)
  • RAM: 4 GB or more (Recommended: 8 GB)
  • HDD: 4 GB or more (Recommended: 8 GB)
  • OS: Ubuntu 20.04 or later
  • Dependency: OpenVINO™ Runtime (Version: 2022.3)

2. Setup and Test

  • Clone the project:
    git clone https://github.com/kby-ai/Automatic-License-Plate-Recognition-Docker.git
    cd Automatic-License-Plate-Recognition-Docker
  • Build the Docker image:
    sudo docker build --pull --rm -f Dockerfile -t kby-ai-alpr:latest .
  • Read machine code
    sudo docker run -e LICENSE="xxxxx" kby-ai-alpr:latest
    
  • Send us machine code obtained. image
  • Update the license.txt file by overwriting the license key that you received from KBY-AI team.
  • Run the Docker container:
    sudo docker run -v ./license.txt:/home/openvino/kby-ai-alpr/license.txt -p 8081:8080 -p 9001:9000 kby-ai-alpr

image

  • Here are the endpoints to test the API through Postman:
    Test with an image file: Send a POST request to http://{xx.xx.xx.xx}:8081/alpr.
    Test with a base64-encoded image: Send a POST request to http://{xx.xx.xx.xx}:8081/alpr_base64.

About SDK

1. Initializing the SDK

  • Import SDK python script
    from alprsdk import initSDK, getLicensePlate, getMachineCode, freeLicenseResults, setActivation
  • Obtain the machine code to activate and request a license
    machineCode = getMachineCode()
    print("\nmachineCode: ", machineCode.decode('utf-8'))
  • Activate the SDK using the license key
    ret = setActivation(license.encode('utf-8'))
    print("\nactivation: ", ret)
  • Initializing SDK
    ret = initSDK()
    Once ret value is zero, SDK can get work started

2. APIs

  • Getting License Number & Coordinate

    The SDK provides a single API for getting license plate number and its coordinate(x, y, width, height).
    The function can be used as follows:

    recog_array = (c_int * 1024)()  # Assuming a maximum of 256 rectangles
    license_plate_ptr = POINTER(c_char_p)()
    cnt = getLicensePlate(img_byte, len(img_byte), byref(license_plate_ptr), recog_array)
    • recog_array: coordinate(x, y, width, height).
    • img_byte: image data in binary format.
    • license_plate_ptr: pointer to variable with license plate number.
  • Analyzing the result from SDK Result values from SDK inference can be analyzed as follows.

    license_plate = [license_plate_ptr[i].decode('utf-8') for i in range(cnt)]
    rectangles = [
    (recog_array[i * 4], recog_array[i * 4 + 1], recog_array[i * 4 + 2], recog_array[i * 4 + 3])
    for i in range(cnt)]
    
    freeLicenseResults(license_plate_ptr, cnt)
    
    print("number: ", cnt, rectangles, license_plate)
    • cnt: the number of detected license plate.
    • rectangles: list of coordinate.
    • license plate: list of license number.
  • Free Memory

    freeLicenseResults(license_plate_ptr, cnt)

Performance Video

You can visit our YouTube video for ANPR/ALPR model's performance here to see how well our demo app works.

ANPR/ALPR Demo

About

Automatic Number/License Plate Recognition Server, ALPR Docker, ANPR Docker, LPR Docker, Vehicle Number Plate Recognition, Vehicle Detection and Vehicle Tracking

Topics

Resources

Stars

25 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages