Skip to content

Commit 7c19428

Browse files
committed
Add yolo11s/yolo26s support and model-proc handling in multistream sample
Add new supported models (yolo11s, yolo26s) to the multi-stream sample and README. Generalize README note to instruct downloading required models to $MODELS_PATH/public/{model_name}/FP16 and list supported models plus an additional example. Update multi_stream_sample.sh help text and defaults to include the new models, add empty model-proc entries for them, and simplify/robustify model-proc handling: only call realpath and append model-proc when a model-proc file is set, otherwise omit the model-proc parameter from model arguments.
1 parent b6e6834 commit 7c19428

2 files changed

Lines changed: 37 additions & 16 deletions

File tree

samples/gstreamer/gst_launch/multi_stream/README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ It combines four pipelines. By default, the first two streams run on NPU [Intel
77
This sample utilizes GStreamer command-line tool `gst-launch-1.0` which can build and run GStreamer pipeline described in a string format.
88
The string contains a list of GStreamer elements separated by exclamation mark `!`, each element may have properties specified in the format `property`=`value`.
99

10-
> **NOTE**: Before running, download the yolov8s model to `$MODELS_PATH/public/yolov8s/FP16/`.
11-
Please follow instruction: [Detection with Yolo](./gst_launch/detection_with_yolo/README.md) how to download Yolov8s model.
10+
> **NOTE**: Before running, download the required models to `$MODELS_PATH/public/{model_name}/FP16/`.
11+
Please follow instruction: [Detection with Yolo](./gst_launch/detection_with_yolo/README.md) how to download YOLO models.
1212

1313
This sample builds for GStreamer a pipeline of the following elements:
1414
* `filesrc`
@@ -17,6 +17,9 @@ This sample builds for GStreamer a pipeline of the following elements:
1717
* [gvadetect](../../../../docs/source/elements/gvadetect.md) uses for full-frame object detection and marking objects with labels
1818
* [gvawatermark](../../../../docs/source/elements/gvawatermark.md) for points and visualization of their connections
1919
* `autovideosink` for rendering output video into screen
20+
21+
**Supported models**: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c, yolo11s, yolo26s
22+
2023
> **NOTE**: Each of the two pipelines can run on CPU or GPU or NPU.
2124
> **NOTE**: `sync=false` property in `autovideosink` element disables real-time synchronization so pipeline runs as fast as possible
2225
@@ -39,6 +42,12 @@ Next example uses CPU device and YOLOv8 model for the first two streams and GPU
3942
./multi_stream_sample.sh video.mp4 CPU GPU yolov8s yolov9c
4043
```
4144

45+
Another example uses NPU device and YOLO11 model for the first two streams and GPU and YOLO26 model for two other streams.
46+
47+
```sh
48+
./multi_stream_sample.sh video.mp4 NPU GPU yolo11s yolo26s
49+
```
50+
4251
## Multi-stream Pipeline Templates
4352
This section lists example command line templates to constructs multi-stream pipelines.
4453

samples/gstreamer/gst_launch/multi_stream/multi_stream_sample.sh

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
2525
echo " INPUT - Input source (default: Pexels video URL)"
2626
echo " DEVICE_STREAM_12 - Device for stream 1 & 2 (default: NPU). Supported: CPU, GPU, NPU"
2727
echo " DEVICE_STREAM_34 - Device for stream 3 & 4 (default: GPU). Supported: CPU, GPU, NPU"
28-
echo " MODEL_1 - Model for stream 1 & 2 (default: yolov8s). Supported: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c"
29-
echo " MODEL_2 - Model for stream 3 & 4 (default: yolov8s). Supported: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c"
28+
echo " MODEL_1 - Model for stream 1 & 2 (default: yolov8s). Supported: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c, yolo11s, yolo26s"
29+
echo " MODEL_2 - Model for stream 3 & 4 (default: yolov8s). Supported: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c, yolo11s, yolo26s"
3030
echo " OUTPUT - Output type (default: file). Supported: file, json"
3131
echo ""
3232
exit 0
@@ -35,8 +35,8 @@ fi
3535
INPUT=${1:-"https://videos.pexels.com/video-files/1192116/1192116-sd_640_360_30fps.mp4"}
3636
DEVICE_STREAM_12=${2:-"NPU"} # Supported values: CPU, GPU, NPU
3737
DEVICE_STREAM_34=${3:-"GPU"} # Supported values: CPU, GPU, NPU
38-
MODEL_1=${4:-"yolov8s"} # Supported values: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c
39-
MODEL_2=${5:-"yolov8s"} # Supported values: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c
38+
MODEL_1=${4:-"yolov8s"} # Supported values: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c, yolo11s, yolo26s
39+
MODEL_2=${5:-"yolov8s"} # Supported values: yolox-tiny, yolox_s, yolov7, yolov8s, yolov9c, yolo11s, yolo26s
4040
OUTPUT=${6:-"file"} # Supported values: file, json
4141
GSTVA="VA"
4242

@@ -57,8 +57,10 @@ declare -A MODEL_PROC_FILES=(
5757
["yolox-tiny"]="../../model_proc/public/yolo-x.json"
5858
["yolox_s"]="../../model_proc/public/yolo-x.json"
5959
["yolov7"]="../../model_proc/public/yolo-v7.json"
60-
["yolov8s"]="../../model_proc/public/yolo-v8.json"
61-
["yolov9c"]="../../model_proc/public/yolo-v8.json"
60+
["yolov8s"]=""
61+
["yolov9c"]=""
62+
["yolo11s"]=""
63+
["yolo26s"]=""
6264
)
6365

6466
if ! [[ "${!MODEL_PROC_FILES[*]}" =~ $MODEL_1 ]]; then
@@ -71,16 +73,16 @@ if ! [[ "${!MODEL_PROC_FILES[*]}" =~ $MODEL_2 ]]; then
7173
fi
7274

7375
#### Model #1
74-
MODEL_1_PROC=""
75-
if ! [ -z ${MODEL_PROC_FILES[$MODEL_1]} ]; then
76-
MODEL_1_PROC=$(realpath "${MODEL_PROC_FILES[$MODEL_1]}")
76+
MODEL_1_PROC="${MODEL_PROC_FILES[$MODEL_1]}"
77+
if [ ! -z "$MODEL_1_PROC" ]; then
78+
MODEL_1_PROC=$(realpath "$MODEL_1_PROC")
7779
fi
7880
MODEL_1_PATH="${MODELS_PATH}/public/$MODEL_1/FP16/$MODEL_1.xml"
7981

8082
#### Model #2
81-
MODEL_2_PROC=""
82-
if ! [ -z ${MODEL_PROC_FILES[$MODEL_2]} ]; then
83-
MODEL_2_PROC=$(realpath "${MODEL_PROC_FILES[$MODEL_2]}")
83+
MODEL_2_PROC="${MODEL_PROC_FILES[$MODEL_2]}"
84+
if [ ! -z "$MODEL_2_PROC" ]; then
85+
MODEL_2_PROC=$(realpath "$MODEL_2_PROC")
8486
fi
8587
MODEL_2_PATH="${MODELS_PATH}/public/$MODEL_2/FP16/$MODEL_2.xml"
8688

@@ -94,8 +96,18 @@ if [ ! -f $MODEL_2_PATH ]; then
9496
exit
9597
fi
9698

97-
MODEL_1_PATH_PROC="model=${MODEL_1_PATH} model-proc=${MODEL_1_PROC}"
98-
MODEL_2_PATH_PROC="model=${MODEL_2_PATH} model-proc=${MODEL_2_PROC}"
99+
# Build model parameters - add model-proc only if it's set
100+
if [ -z "$MODEL_1_PROC" ]; then
101+
MODEL_1_PATH_PROC="model=${MODEL_1_PATH}"
102+
else
103+
MODEL_1_PATH_PROC="model=${MODEL_1_PATH} model-proc=${MODEL_1_PROC}"
104+
fi
105+
106+
if [ -z "$MODEL_2_PROC" ]; then
107+
MODEL_2_PATH_PROC="model=${MODEL_2_PATH}"
108+
else
109+
MODEL_2_PATH_PROC="model=${MODEL_2_PATH} model-proc=${MODEL_2_PROC}"
110+
fi
99111

100112
cd - 1>/dev/null
101113

0 commit comments

Comments
 (0)