License PLate Recognition is a source code that detects license plates in pictures or videos. This project was developed to work in real time on Jetson Nano
with 39 FPS
. It can detect all kinds of number plates of vehicles in Vietnam.
License PLate Detection is a guide for training a custom model for your own license plate dataset and more.
First, you need to download the full source code and the files are contained in the directory with the following structure:
License PLate Detection/
networks/
-az_plate/
-az_ocr_ssdmobilenetv1_2.onnx
-labels.txt
detectnet-camera.py
requirements.txt
You can download the trained model here.
Recompiled the model with Jetson Nano.
Note: You should see the file
az_ocr_ssdmobilenetv1_2.onnx.1.1.7103.GPU.FP16.engine
, this file is the model compiled fromaz_ocr_ssdmobilenetv1_2.onnx
and ready to run the demo. If you want to try recompiling the fileaz_ocr_ssdmobilenetv1_2.onnx
, just delete the fileaz_ocr_ssdmobilenetv1_2.onnx.1.1.7103.GPU.FP16.engine
.
Below are the commands for running a demo with this project. Use the command that matches the type of camera you are using with the Jetson Nano:
1. MIPI CSI cameras:
MIPI CSI cameras are compact sensors that are acquired directly by the Jetson's hardware CSI/ISP interface. Supported CSI cameras include:
- Raspberry Pi Camera Module v2 (IMX219) for Jetson Nano and Jetson Xavier NX
- OV5693 camera module from the Jetson TX1/TX2 devkits.
- See the Jetson Partner Supported Cameras page for more sensors supported by the ecosystem.
python3 detectnet-camera.py --model=./networks/az_ocr/az_ocr_ssdmobilenetv1_2.onnx --class_labels=./networks/az_ocr/labels.txt --input_blob=input_0 --output_cvg=scores --output_bbox=boxes --camera=csi://0 --width=640 --height=480
2. V4L2 cameras:
USB webcams are most commonly supported as V4L2 devices, for example Logitech C270 or C920.
python3 detectnet-camera.py --model=./networks/az_ocr/az_ocr_ssdmobilenetv1_2.onnx --class_labels=./networks/az_ocr/labels.txt --input_blob=input_0 --output_cvg=scores --output_bbox=boxes --camera=/dev/video0 --width=640 --height=480
3. RTSP:
RTSP network streams are subscribed to from a remote host over UDP/IP.
python3 detectnet-camera.py --model=./networks/az_ocr/az_ocr_ssdmobilenetv1_2.onnx --class_labels=./networks/az_ocr/labels.txt --input_blob=input_0 --input-codec=h264 --output_cvg=scores --output_bbox=boxes --camera=rtsp://username:password@<remote-ip>:1234 --width=640 --height=480
Note: Advanced Video Coding RTSP:
H264
You can retrain your License PLate Recognition model with a larger set of data by following the tutorial with .
Download: You can download the ssd.zip file here.