Welcome to Jetson Orin NX Developer Kit repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
04.Vehicle model classification
TAO VehicleTypeNet vehicle model classification
TAO VehicleTypeNet vehicle model classification1. Case goal and processing flow2. The checks before running it3. Start the detection4. The real-time detection with a USB camera5. The real-time detection with a CSI camera6. Frequently asked questions7. References
Applicable environment: Jetson Orin NX, JetPack 7.2.1, DeepStream 9.1.
1. Case goal and processing flow
VehicleTypeNet classifies the cropped region of a vehicle; it does not replace the vehicle detector. The previous stage TrafficCamNet produces the vehicle boxes, DeepStream crops them and sends them into the vehicle model classification model.
Video/USB/CSI → TrafficCamNet → the vehicle crop → VehicleTypeNet→ the model category is overlaid → the preview/the video output
2. The checks before running it
xcd ~/deepstream_tao_apps/deepstream_app_tao_configs# Confirm the configuration and the input sourcegrep -E "uri=|config-file=" run_vehicletype.txt# Confirm that all the config-file paths are valid (the path trap was hit before)for f in run_vehicletype.txt run_vehicletype_usb.txt run_vehicletype_csi.txt; doecho "--- $f ---"grep "config-file=" "$f" | while read line; dopath=$(echo "$line" | cut -d= -f2)[ -f "$path" ] && echo "OK $path" || echo "MISS $path"donedone
When you need the real-time camera, confirm that the camera is connected and that it is not used by another application.
3. Start the detection
To run the vehicle model classification alone (the video version):
xxxxxxxxxxexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh vehicletype video

The input is the sample_720p.h264 that comes with DeepStream. Running the cascade combination run_vehicles.txt runs the brand and the model classification at the same time.
When you replace the test video, modify the uri=file:// of the [source0] section in run_vehicletype.txt to the absolute path of the MP4/H.264 file on the Jetson. Use gst-discoverer-1.0 to confirm that the encoding can be decoded.
4. The real-time detection with a USB camera
Connect the USB camera, look at the device and the formats and then start the vehicle model branch:
xxxxxxxxxxls -l /dev/video*v4l2-ctl -d /dev/video0 --list-formats-extexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh vehicletype usb

The script detects the USB camera node automatically through ~/deepstream_tao_demo/find_usb_cam.sh.
Watch the real-time vehicle boxes, the Tracker ID and the model labels in the Jetson desktop/VNC. The camera entry only previews and it does not produce an offline MP4.
To stop it, press Ctrl+C once and wait for the application to exit and for the camera to be released. The model label is only produced after TrafficCamNet has detected a vehicle.
5. The real-time detection with a CSI camera
Connect a compatible camera, confirm that the driver and the Argus service work normally and run the following in a graphical terminal of the Jetson desktop/VNC:
Start:
xxxxxxxxxxexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh vehicletype csi

The CSI mode supports the real-time preview and it does not produce an offline video output. To stop it, press Ctrl+C once and wait for the program to release the camera.
6. Frequently asked questions
| Symptom | The check and the handling |
|---|---|
There is only car + ID and no model label | Check network-type=1, is-classifier=1, operate-on-gie-id=1 and operate-on-class-ids=0 in the vehicle model configuration, and confirm that the second-level engine is b4. |
Failed to load config file | Start it with run_case.sh; all three entries have been unified to the config-file= path of TrafficCamNet + Tracker + VehicleTypeNet. |
| The model does not match the expectation | The set of the categories is limited and it depends on the region/the distribution of the data; evaluate it with the target material first. |
| The USB device cannot be opened | Check /dev/video*, the supported formats, the permissions and the occupancy. |
| There is no image with CSI | Check the compatible module, the ribbon cable, the sensor driver, the Argus service and whether the camera is in use; this entry directly uses the Argus type=5. |
| There is no video file in the camera mode | The camera entry only previews; the video output is only accepted in the offline branch in which the file sink is configured. |
nvv4l2h264enc has no property named 'gpu-id' | It is a known non-blocking warning of DS 9.1 and it does not affect the inference or the display. |
7. References
The NVIDIA DeepStream TAO application examples: https://github.com/NVIDIA/DeepStream/tree/main/src/apps/tao_apps
The DeepStream TAO integration documentation: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_TAO_integration.html