Welcome to Jetson Orin NX Developer Kit repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
09.Person feature extraction and matching (ReID)
TAO ReIdentificationNet person feature extraction and matching
TAO ReIdentificationNet person feature extraction and matching1. Case goal and processing flow2. The checks before running it3. Start the feature extraction4. 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
PeopleNet detects the people, the NvDCF Tracker generates the track ID of the current video, and ReIdentificationNet extracts a 256-dimensional appearance feature for the crop of the person.
Video/USB/CSI → the person detection → the Tracker → ReIdentificationNet├→ the annotated preview/the video output└→ the embedding associated with the track ID
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_reid.txt# Confirm the model directoriesls -la /opt/nvidia/deepstream/deepstream-9.1/samples/models/tao_pretrained/reidentificationnet_vdeployable_v1.2/ls -la /opt/nvidia/deepstream/deepstream-9.1/samples/models/tao_pretrained/peoplenet_vdeployable_quantized_onnx_v2.6.3/
Confirm that the input and the output directories are available. Running the USB/CSI needs the graphical desktop/VNC and a connected camera.
3. Start the feature extraction
The video mode:
xxxxxxxxxxexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh reid video

The input is the sample video that comes with DeepStream; the ReID is a second-level feature extraction that is added on top of the detection + the Tracker. The frame shows the person boxes, the Tracker ID and the detection labels, and the embedding is kept in the metadata.
xxxxxxxxxxls -lh ~/deepstream_tao_apps/deepstream_app_tao_configs/reid_out.mp4ffprobe -v error -show_entries format=duration -of default=nw=1 \~/deepstream_tao_apps/deepstream_app_tao_configs/reid_out.mp4
The Tracker ID is the track number of the current video, not the real personal identity.
To replace the test video: modify the uri=file:// of the [source0] section in run_reid.txt to the absolute path of an MP4/H.264 file on the Jetson itself. The new material should contain visible people and it has to be decodable by the Jetson; keep the original file before you replace it.
4. The real-time detection with a USB camera
The USB entry supports the real-time preview. After checking the node and the formats, run:
xxxxxxxxxxls -l /dev/video*v4l2-ctl -d /dev/video0 --list-formats-extexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh reid usb

The script detects the USB camera node automatically through ~/deepstream_tao_demo/find_usb_cam.sh.
The USB mode is used for the real-time preview, and the frame shows the person boxes and the Tracker ID. The node, the resolution and the frame rate are detected automatically at runtime.
To stop it, press Ctrl+C once and wait for the pipeline to finish and to release the device.
5. The real-time detection with a CSI camera
Start:
xxxxxxxxxx~/deepstream_tao_demo/run_case.sh reid csi

The CSI mode supports the real-time preview. To stop it, press Ctrl+C once and wait for the pipeline to finish and to release the device.
6. Frequently asked questions
| Symptom | The check and the handling |
|---|---|
| There is no feature extraction | Confirm in the order of the detection, the Tracker and the ReID that each stage and each model is running; check that both the pgie and the sgie configurations have loaded successfully (the log should have 2 Load new model entries). |
| The ID changes frequently | The occlusion, the crossing or a lost detection affects the tracker; the ID only makes sense inside the current video. |
| The length of the vector does not match | Check the version of the ReIdentificationNet and the output fields; the course configuration is 256-dimensional. |
Failed to load config file | Start it with the unified script; if you start it manually, check the absolute config-file= path in run_reid_csi.txt. |
| There is no image with USB/CSI | Check the device/the Argus, the format, the permissions, the occupancy and the graphical session. |
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