Welcome to Jetson Orin NX Developer Kit repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
06.Person semantic segmentation
TAO PeopleSemSegNet person semantic segmentation
TAO PeopleSemSegNet person semantic segmentation1. 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
The semantic segmentation predicts a category for every pixel. This model divides the pixels into person/background; it does not distinguish the instances of adjacent people and it does not output an identity ID.
Video/USB/CSI → the PeopleSemSegNet mask → person/background→ the semi-transparent overlay of the original image → the desktop/VNC preview
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_peoplesem.txt# Confirm the model and the parserls -la /opt/nvidia/deepstream/deepstream-9.1/samples/models/tao_pretrained/peoplesemsegnet_vdeployable_shuffleseg_unet_onnx_v1.0.1/ls -la ~/deepstream_tao_apps/post_processor/libnvds_infercustomparser_tao.so
Operate in the graphical session of the Jetson desktop or of the VNC. The video mode checks that the material exists; the USB/CSI mode uses the real-time camera entry that is already connected.
3. Start the detection
The video mode:
xxxxxxxxxxexport DISPLAY=:0 && deepstream-app -c ~/deepstream_tao_apps/deepstream_app_tao_configs/run_peoplesem.txt

The application loads PeopleSemSegNet and the self-written NvDsInferParseCustomPeopleSemSegNetTAO parser (the parser is compiled in ~/deepstream_tao_apps/post_processor/), the [segvisual] section is enabled in the configuration, and the mask is overlaid in the preview:
The current display mode of [sink0] only previews. When the natural playback ends, wait for the process to exit; to stop early, press Ctrl+C once and wait for the pipeline to wind up.
To replace the test video: modify the uri=file:// of the [source0] section in run_peoplesem.txt to the absolute path of an MP4/H.264 file on the Jetson itself; confirm that the Jetson can decode it before you run it. Keep the original material and avoid overwriting something that cannot be restored directly.
4. The real-time detection with a USB camera
The USB mode supports the real-time preview. After confirming that the USB camera device node exists, run:
xxxxxxxxxxls -l /dev/video*v4l2-ctl -d /dev/video0 --list-formats-extexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh peoplesem usb

The script detects the USB camera node automatically through ~/deepstream_tao_demo/find_usb_cam.sh.
The USB mode is a real-time preview and it does not produce an offline MP4. The input resolution is written dynamically by the script according to the capability of the camera,
and the display is unified with the video mode as the semantic segmentation color effect of 960×544; it does not show the detection boxes or the text.
Press Ctrl+C once and wait for the application to exit and for the camera to be released.
5. The real-time detection with a CSI camera
The CSI mode supports the real-time preview, and the entry captures through the Argus.
Start:
xxxxxxxxxxexport DISPLAY=:0 && ~/deepstream_tao_demo/run_case.sh peoplesem csi

The USB/CSI is a continuous stream and it does not naturally play to the end. To stop it, press Ctrl+C once in the terminal that started it and wait for the application and the camera relay to exit before you start another camera task.
6. Frequently asked questions
| Symptom | The check and the handling |
|---|---|
| There is no preview | Check the graphical session, the input path, the model configuration and the compiled artifact of the parser. |
| The segmented region is missed or it flickers | It is affected by the viewing angle, the occlusion, the size of the person and the domain of the training data; the opacity only changes the display effect. |
Failed to load config file | Check the config-file= path in run_peoplesem.txt (the trap of the path missing the configs/ prefix was hit before); confirm that it points to ~/deepstream_tao_apps/configs/nvinfer/peoplesemsegnet_tao/pgie_peoplesemsegnet_tao_config.txt. |
It reports that NvDsInferParseCustomPeopleSemSegNetTAO cannot be found | Confirm that the function is in ~/deepstream_tao_apps/post_processor/libnvds_infercustomparser_tao.so: nm -D ... \| grep PeopleSemSegNetTAO. |
The [segvisual] section does not take effect | That section only supports 7 keys (enable, batch-size, gpu-id, width, height, nvbuf-memory-type, unique-id); the extra keys cause the parsing to fail. |
| The USB/CSI differs from the result of the tutorial | The three configurations uniformly use 960×544, segvisual, display-text=0 and display-bbox=0, and they do not use the Tracker. |
| There is no image with USB/CSI | Check the device node, the format, the permissions and the occupancy; the CSI entry directly uses the Argus type=5. |
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