# Áp dụng semantic segmentation cho khung hình của video

Trước khi chạy pipeline cho một model, hãy tuân thủ các [Điều kiện tiên quyết](https://docs.qualcomm.com/doc/80-70020-15BV/topic/ai-hub-qualcomm-im-sdk.html#prerequisites) bắt buộc.

Chạy lệnh sau để đảm bảo kết quả hiển thị trên display được kết nối:

export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1
    Copy to clipboard

## DeepLabV3-Plus\_MobileNet

DeepLabV3 Quantized được thiết kế cho semantic segmentation trên nhiều quy mô và được huấn luyện trên các tập dữ liệu khác nhau.

Model AI Hub dựa trên [việc triển khai DeepLabV3-Plus_MobileNet này](https://github.com/jfzhang95/pytorch-deeplab-xception).

- Model: [DeepLabV3-Plus_MobileNet](https://aihub.qualcomm.com/iot/models/deeplabv3_plus_mobilenet)
- Nhãn: [voc_labels.txt](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/labels/voc_labels.txt)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/deeplabv3_plus_mobilenet_quantized.tflite ! queue ! \
    qtimlvsegmentation module=deeplab-argmax labels=/etc/labels/voc_labels.txt \
    constants="deeplab,q-offsets=<92.0>,q-scales=<0.04518842324614525>;" ! video/x-raw,format=BGRA,width=256,height=144 ! queue ! mixer.
    Copy to clipboard

## FCN-Resnet50

FCN\_ResNet50 là một model học máy được lượng tử hóa có thể phân đoạn hình ảnh từ tập dữ liệu COCO.

Model AI Hub dựa trên [việc triển khai FCN-Resnet50 này](https://github.com/pytorch/vision/blob/main/torchvision/models/segmentation/fcn.py).

- Model: [FCN-Resnet50](https://aihub.qualcomm.com/iot/models/fcn_resnet50)
- Nhãn: [voc_labels.txt](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/labels/voc_labels.txt)

Ghi chú

Chuỗi xử lý này hiện chưa được hỗ trợ trên Qualcomm Dragonwing™ RB3 Gen 2.

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! queue ! waylandsink sync=true fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/fcn_resnet50_quantized.tflite ! queue ! \
    qtimlvsegmentation module=deeplab-argmax labels=/etc/labels/voc_labels.txt \
    constants="deeplab,q-offsets=<0.0>,q-scales=<1.0>;" ! video/x-raw,format=BGRA,width=256,height=144 ! queue ! mixer.
    Copy to clipboard

## FFNet-40S

FFNet-40S là "mạng đơn giản" dùng để phân đoạn ảnh đường phố với các lớp theo pixel như đường, vỉa hè và người đi bộ.

Mạng này được huấn luyện trên tập dữ liệu cảnh quan thành phố.

Model AI Hub dựa trên [việc triển khai FFNet-40S này](https://github.com/Qualcomm-AI-research/FFNet)

- Model: [FFNet-40S](https://aihub.qualcomm.com/iot/models/ffnet_40s)
- Nhãn: [voc_labels.txt](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/labels/voc_labels.txt)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! queue ! waylandsink sync=false fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/ffnet_40s_quantized.tflite ! queue ! \
    qtimlvsegmentation module=deeplab-argmax labels=/etc/labels/voc_labels.txt constants="ffnet,q-offsets=<178.0>,q-scales=<0.31378185749053955>;" ! \
    video/x-raw,format=BGRA,width=256,height=144 ! queue ! mixer.
    Copy to clipboard

## FFNet-54S

FFNet-54S là "mạng đơn giản" dùng để phân đoạn ảnh đường phố với các lớp theo pixel như đường, vỉa hè và người đi bộ.

Mạng này được huấn luyện trên tập dữ liệu cảnh quan thành phố.

Model AI Hub dựa trên [việc triển khai FFNet-54S này](https://github.com/Qualcomm-AI-research/FFNet).

- Model: [FFNet-54S](https://aihub.qualcomm.com/iot/models/ffnet_54s)
- Nhãn: [voc_labels.txt](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/labels/voc_labels.txt)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! queue ! waylandsink sync=false fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/ffnet_54s_quantized.tflite ! queue ! \
    qtimlvsegmentation module=deeplab-argmax labels=/etc/labels/voc_labels.txt constants="ffnet,q-offsets=<178.0>,q-scales=<0.2929433584213257>;" ! \
    video/x-raw,format=BGRA,width=256,height=144 ! queue ! mixer.
    Copy to clipboard

## FFNet-78S

FFNet-78S là "mạng đơn giản" dùng để phân đoạn hình ảnh đường phố với các lớp theo pixel như đường, vỉa hè và người đi bộ.

Mạng này được huấn luyện trên tập dữ liệu cảnh quan thành phố.

Model AI Hub dựa trên [việc triển khai FFNet-78S này](https://github.com/Qualcomm-AI-research/FFNet).

- Model: [FFNet-78S](https://aihub.qualcomm.com/iot/models/ffnet_78s)
- Nhãn: [voc_labels.txt](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/labels/voc_labels.txt)

gst-launch-1.0 -e --gst-debug=2 \
    filesrc location=/etc/media/video.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=4 output-io-mode=4 ! video/x-raw,format=NV12 ! queue ! tee name=split \
    split. ! queue ! qtivcomposer name=mixer sink_1::alpha=0.5 ! queue ! waylandsink sync=false fullscreen=true \
    split. ! queue ! qtimlvconverter ! queue ! qtimltflite delegate=external external-delegate-path=libQnnTFLiteDelegate.so \
    external-delegate-options="QNNExternalDelegate,backend_type=htp;" model=/etc/models/ffnet_78s_quantized.tflite ! queue ! \
    qtimlvsegmentation module=deeplab-argmax labels=/etc/labels/voc_labels.txt constants="ffnet,q-offsets=<171.0>,q-scales=<0.3849360942840576>;" ! \
    video/x-raw,format=BGRA,width=256,height=144 ! queue ! mixer.
    Copy to clipboard

Last Published: Dec 23, 2025

[Previous Topic
Phát hiện đối tượng](https://docs.qualcomm.com/bundle/publicresource/80-70020-15BV/topics/object-detection.md) [Next Topic
Tăng độ phân giải hình ảnh bằng super resolution](https://docs.qualcomm.com/bundle/publicresource/80-70020-15BV/topics/super-resolution.md)