Welcome to Jetson Orin NX Developer Kit repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
02.License plate detection and recognition
DeepStream license plate detection and recognition (LPR)
DeepStream license plate detection and recognition (LPR)1. NVIDIA official deployment (for reference only)2. Case goal and processing chain3. Model version and applicable scope4. Course script entry5. Run with a local video6. Real-time run with the USB camera7. Real-time run with the CSI camera8. Stopping and basic troubleshooting
Applicable environment: JetPack 7.2.1, Ubuntu 24.04, DeepStream 9.1, Jetson Orin NX 16GB.
The factory environment already has the China and the US license plate models, the TensorRT engines, the LPR program and the course entry. In normal use you start directly from section 4; redeployment is only needed when the program or the models are missing.
1. NVIDIA official deployment (for reference only)
The current factory system has already completed the deployment described above, so you do not need to repeat the following operations.
Official source code and documentation: https://github.com/NVIDIA/DeepStream/tree/main/src/apps/tao_apps/apps/tao_others/deepstream_lpr_app
The official LPR sample is located in the DeepStream source tree. Only when the program, the models or the engines are missing and the environment has to be restored, execute the following steps in this order:
x# Download the TAO models; the first download requires network accesscd ~/deepstream_tao_apps~/deepstream_tao_apps/download_models.sh# Build the LPR application and the custom text parsercd ~/deepstream_tao_apps/apps/tao_others/deepstream_lpr_appmake
The model download location:
xxxxxxxxxx~/deepstream_tao_apps/models
On the first actual run, DeepStream automatically generates the TensorRT engine according to the GPU, CUDA and TensorRT versions of the local machine. The official manual run method:
xxxxxxxxxxcd ~/deepstream_tao_apps/apps/tao_others/deepstream_lpr_app# China versioncp dict_ch.txt dict.txt./deepstream-lpr-app ../../../configs/app/lpr_app_ch_config.yml# US versioncp dict_us.txt dict.txt./deepstream-lpr-app ../../../configs/app/lpr_app_us_config.yml
download_models.sh is located in the root directory ~/deepstream_tao_apps/, not in the deepstream_lpr_app subdirectory. At the end the script may try to download an additional model into the old Tracker path; that model does not belong to the three-stage LPR chain of vehicle, license plate and text recognition.
2. Case goal and processing chain
This case recognizes the license plate on a vehicle and displays the result in real time on the Jetson device itself or on the VNC desktop.
The current implementation uses the three-stage chain of the official NVIDIA TAO LPR:
xxxxxxxxxxTrafficCamNet vehicle detection↓LPD license plate location detection↓LPR license plate character recognition
Therefore the LPD only looks for the license plate inside the regions of the vehicles that have already been detected. When a license plate is filmed on its own, detached from a vehicle, the preceding vehicle detection produces no result, and the subsequent license plate detection and text recognition are not executed.
3. Model version and applicable scope
| Parameter | Model used | Suitable license plates |
|---|---|---|
--cn | LPD_ch + LPR_ch | Mainland China license plates, including the province abbreviation, such as 粤A83288 and 皖A52718 |
--us | LPD_us + LPR_us | US state license plates |
The China version keeps the UTF-8 Chinese province abbreviation; the stabilization processing must not reduce it to only the trailing letters and digits.
The US version does not suit long European plates such as the Romanian one. Adjusting the threshold can improve the recall and the stability, but it cannot compensate for the fundamental differences in the model's region, the plate proportion and the character layout.
4. Course script entry
The current unified startup script is located in ~/deepstream_tao_demo/:
xxxxxxxxxxcd ~/deepstream_tao_demo
| Input source | China version | US version |
|---|---|---|
| Local video | ./run_lpr_cn.sh | ./run_lpr_us.sh |
| USB camera | ./run_lpr_cn_usb.sh | ./run_lpr_us_usb.sh |
| CSI camera | ./run_lpr_cn_csi.sh | ./run_lpr_us_csi.sh |
All three entries:
Switch to the corresponding character dictionary:
dict_ch.txtordict_us.txt.Use the corresponding China or US model configuration.
Set the DeepStream/CUDA runtime library path.
Display the real-time window on the desktop of the Jetson device itself or on the VNC desktop.
Before running USB/CSI, confirm that no other program is occupying the corresponding camera.
Output rule: the local video entry displays in real time and saves an MP4 at the same time; the USB and CSI entries only display in real time and do not generate a recording file.
5. Run with a local video
Run:
xxxxxxxxxxcd ~/deepstream_tao_demo && export DISPLAY=:0 && ./run_lpr_cn.sh# US version: cd ~/deepstream_tao_demo && export DISPLAY=:0 && ./run_lpr_us.sh

The video location of the current configuration:
| Version | Configuration file | Default video |
|---|---|---|
| China version | ~/deepstream_tao_apps/deepstream_app_tao_configs/run_lpr_china.txt | file:///home/jetson/Videos/Video007.mp4 |
| US version | ~/deepstream_tao_apps/deepstream_app_tao_configs/run_lpr_us.txt | Prefer ~/Videos/us.mp4, otherwise use the bundled Test cases/us.mp4 of the course |
To replace the video, pass the absolute path directly to run_lpr_cn.sh or run_lpr_us.sh; the script generates a temporary configuration and does not modify the repository template. The file input of this example supports MP4/H.264 only.
After the video finishes playing naturally, lpr_cn.mp4 or lpr_us.mp4 with the recognition boxes and the text is generated. After the script exits, it uses ffprobe to verify the container of the file.
To stop, press Ctrl+C only once and wait for the application to exit before you check the file; do not interrupt repeatedly and do not use kill -9.
6. Real-time run with the USB camera
Run:
xxxxxxxxxxcd ~/deepstream_tao_demo && export DISPLAY=:0 && ./run_lpr_cn_usb.sh# US version: cd ~/deepstream_tao_demo && export DISPLAY=:0 && ./run_lpr_us_usb.sh

7. Real-time run with the CSI camera
Run:
xxxxxxxxxxcd ~/deepstream_tao_demo && export DISPLAY=:0 && ./run_lpr_cn_csi.sh# US version: cd ~/deepstream_tao_demo && export DISPLAY=:0 && ./run_lpr_us_csi.sh

8. Stopping and basic troubleshooting
The real-time window is displayed on the Jetson device itself or on the VNC desktop. To stop it, go back to the terminal where the startup command runs and press Ctrl+C once.
| Symptom | What to check first |
|---|---|
| Only vehicle boxes, no license plate boxes | Whether the license plate is clear, complete and large enough; whether the model version matches the region of the plate. |
| The China plate shows only letters and digits | Make sure that run_lpr_cn.sh is used, not run_lpr_us.sh. |
| The USB fails to start | Run v4l2-ctl -d /dev/video0 --list-formats-ext and confirm that the camera is not occupied by another program. |
| No picture with CSI | Check sensor-id=0, the Argus and the camera occupancy; the script directly uses type=5 and does not wrongly open /dev/video10. |