Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 3.7 KB

File metadata and controls

72 lines (46 loc) · 3.7 KB

License Plate Recognition

Introduction

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.

Run

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 from az_ocr_ssdmobilenetv1_2.onnx and ready to run the demo. If you want to try recompiling the file az_ocr_ssdmobilenetv1_2.onnx, just delete the file az_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:

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

Training

You can retrain your License PLate Recognition model with a larger set of data by following the tutorial with Open In Colab.

Download: You can download the ssd.zip file here.