🤗 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
This repository demonstrates ANPR/ALPR(Automatic Number/License Plate Recognition)
SDK with unmatched accuracy and precision by applying SOTA(State-of-the-art)
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.
The ALPR
system consists of the following steps:
- Vehicle image capture
- Preprocessing
- Vehicle detection
- Number plate extraction
- Charater segmentation
- Optical Character Recognition(OCR)
The ALPR
system works in these strides, the initial step is the location of the vehicle and capturing a vehicle image of front or back perspective of the vehicle, the second step is the localization of Number Plate and then extraction of vehicle Number Plate is an image. The final stride uses image segmentation strategy, for the segmentation a few techniques neural network, mathematical morphology, color analysis and histogram analysis. Segmentation is for individual character recognition. Optical Character Recognition (OCR) is one of the strategies to perceive the every character with the assistance of database stored for separate alphanumeric character.
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 - Android | License Plate Recognition Android SDK | Developing |
5 | LPR - iOS | License Plate Recognition iOS SDK | Developing |
To get more products, please visit products here:
To try KBY-AI
ALPR
online, please visit here
The API
can be evaluated through Postman
tool. Here are the endpoints for testing:
- Test with an image file: Send a
POST
request tohttp://89.116.159.229:8085/alpr
. - Test with a
base64-encoded
image: Send aPOST
request tohttp://89.116.159.229:8085/alpr_base64
.
This project demonstrates KBY-AI
's Palmprint Recognition Server SDK
, which requires a license per machine.
- The code below shows how to use the license:
Automatic-License-Plate-Recognition-Docker/app.py
Lines 17 to 28 in 06a13d6
- To request the license, please provide us with the
machine code
obtained from thegetMachineCode
function.
🧙Email:
contact@kby-ai.com
🧙Telegram:
@kbyai
🧙WhatsApp:
+19092802609
🧙Skype:
live:.cid.66e2522354b1049b
🧙Facebook:
https://www.facebook.com/KBYAI
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)
-
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 .
-
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
-
Send us the
machine code
and then we will give you a license key to make theSDK
activate.After that, update the
license.txt
file by overwriting thelicense key
that you received. Then, run theDocker
container again. -
Here are the endpoints to test the
API
throughPostman
:Test with an image file: Send a
POST
request tohttp://{xx.xx.xx.xx}:8081/alpr
.Test with a
base64-encoded
image: Send aPOST
request tohttp://{xx.xx.xx.xx}:8081/alpr_base64
.
- Setup
Gradio
Ensure that the necessary dependencies are installed.
Gradio
requiresPython 3.7
or above.
InstallGradio
usingpip
by running the following command:pip install -r requirements.txt
- Run the demo with the following command:
cd gradio python demo.py
SDK
can be tested on the following URL:http://127.0.0.1:9000
- Import SDK python script
from alprsdk import initSDK, getLicensePlate, getMachineCode, freeLicenseResults, setActivation
- Obtain the
machine code
to activate and request a licensemachineCode = getMachineCode() print("\nmachineCode: ", machineCode.decode('utf-8'))
- Activate the
SDK
using the license keyret = setActivation(license.encode('utf-8')) print("\nactivation: ", ret)
- Initializing
SDK
Onceret = initSDK()
ret
value is zero, SDK can get work started
-
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 fromSDK
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 ofcoordinate
.license plate
: list oflicense number
.
-
Free Memory
freeLicenseResults(license_plate_ptr, cnt)
You can visit our YouTube video for ANPR/ALPR
model's performance here to see how well our demo app works.
Automatic license-plate recognition (ALPR)
is a technology that uses OCR(optical character recognition)
on images to read vehicle registration plates. It can use existing closed-circuit television, road-rule enforcement cameras, or cameras specifically designed for the task. ALPR can be used by police forces around the world for law enforcement purposes, including to check if a vehicle is registered or licensed. It is also used for electronic toll collection on pay-per-use roads and as a method of cataloguing the movements of traffic, for example by highways agencies.
ALPR
has many uses including:
- Recovering stolen cars
- Identifying drivers with an open warrant for arrest
- Catching speeders by comparing the average time it takes to get from stationary camera A to stationary camera B
- Determining what cars do and do not belong in a parking garage
- Expediting parking by eliminating the need for human confirmation of parking passes