How to run Car License Recognition?

How to run Car License Recognition?

Jetson AGX Xavier | Jetson Nano | Jetson TX2 NX | Jetson Xavier NX

13 August 2021
WHAT YOU WILL LEARN?

1- How to download TLT-converter?

2- How to download Project?

3- How to build and run car license plate recognition Project?

ENVIRONMENT

Hardware: DSBOX-N2

OS: Jetpack 4.5



This project is to show how to identify and classify license plates of cars in US and China with DeepStream SDK version 5.0.1.

This sample application only supports mp4 files containing H264 videos as input files.


How to download TLT-converter?


First, you need to have DeepStream SDK 5.0.1 installed on your computer. You must have an NVIDIA® account for this. The important part of the project is DeepStream SDK 5.0.1.


If DeepStream SDK 5.0.1 is not installed, you can install it from the link below.

https://developer.nvidia.com/deepstream-getting-started


Now let's install TLT-converter.

https://developer.nvidia.com/cuda102-trt71-jp45


We should put the downloaded tlt-converter file into the deepstream_lpr_app file as seen in the figure.


How to download the Project?


Download the Project with HTTPS


git clone https://github.com/NVIDIA-AI-IOT/deepstream_lpr_app.git 





Prepare Models and TensorRT engine

cd deepstream_lpr_app/ 


• For US car plate recognition

./download_us.sh 







./tlt-converter -k nvidia_tlt -p image_input,1x3x48x96,4x3x48x96,16x3x48x96 \models/LP/LPR/us_lprnet_baseline18_deployable.etlt -t fp16 -e models/LP/LPR/lpr_us_onnx_b16.engine 






• For Chinese car plate recognition.

./download_ch.sh 

./tlt-converter -k nvidia_tlt -p image_input,1x3x48x96,4x3x48x96,16x3x48x96 \models/LP/LPR/ch_lprnet_baseline18_deployable.etlt -t fp16 -e models/LP/LPR/lpr_ch_onnx_b16.engine


The figures are given below clearly show how the codes are run. If you examine it, you can easily conclude.

How to Build and Run Car License Plate Recognition Project?


In this part, we will do the final steps to run our project. The codes are given in order. At the end, the stages are indicated with figures.

  We start with ;


make 







cd deepstream-lpr-app 


 For US car plate recognition:

cp dict_us.txt dict.txt 


 For Chinese car plate recognition


•	cp dict_ch.txt dict.txt 


 Start to run the application by following the instructions above.

./deepstream-lpr-app <1:US car plate model|2: Chinese car plate model> \<1: output as h264 file| 2:fakesink 3:display output> <0:ROI disable|1:ROI enable> \ ... 


 A sample of US car plate recognition:

./deepstream-lpr-app 1 2 0 parking_sfm.mp4 output.264 


• A sample of Chinese car plate recognition:

./deepstream-lpr-app 2 2 0 ch_car_test.mp4 ch_car_test.mp4 output.264 


The meaning of the 3 numbers written in the sample A of US car plate recognition section is explained in the beginning in “run the application” section. 

We use digit 1 for US car plate model and digit 2 for Chinese car plate model. For the second digit 1: output shown as h264 file, for the second digit 2: fakesink, for the second digit 3: Display output. For the third digit 1: ROI enables, For the third digit 0: ROI disables.


In the figures below, it is shown step by step how it looks on the terminal.



In this example, we use US license plates.


Running our file may take a couple of minutes. You can see how it works below.



At the end of the project, you should see the results as below.







Thank you for reading our blog post. 


Türkçe