Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ data:
"name": "filter-pipeline",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} name=source ! decodebin3 ! gvadetect model=/models/person-vehicle-bike-detection-2004/FP32/person-vehicle-bike-detection-2004.xml model-proc=/home/pipeline-server/person-vehicle-bike-detection-2004.json inference-interval=3 threshold=0.4 model-instance-id=detect1 device=CPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 name=classification model-instance-id=infer1 device=CPU ! queue ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"pipeline": "{auto_source} name=source ! decodebin3 ! gvadetect model=/models/public/yolo11s/FP16/yolo11s.xml batch_size=1 inference-interval=1 nireq=2 threshold=0.7 model-instance-id=instcpu0 name=detection device=CPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 name=classification model-instance-id=infer1 device=CPU ! queue ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is inference interval changed? reducing it would impact throughput adversely

"auto_start": false,
"mqtt_publisher": {
"publish_frame": true,
Expand All @@ -61,7 +61,7 @@ data:
"name": "filter-pipeline",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} ! decodebin3 ! gvadetect model=/models/person-vehicle-bike-detection-2004/FP32/person-vehicle-bike-detection-2004.xml model-proc=/home/pipeline-server/person-vehicle-bike-detection-2004.json inference-interval=3 threshold=0.4 model-instance-id=detect1 device=GPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 device=GPU model-instance-id=classify1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"pipeline": "{auto_source} name=source ! decodebin3 ! gvadetect model=/models/public/yolo11s/FP16/yolo11s.xml batch_size=1 inference-interval=1 inference-region=0 nireq=2 threshold=0.7 model-instance-id=instgpu0 name=detection device=GPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 device=GPU model-instance-id=classify1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"auto_start": false,
"mqtt_publisher": {
"publish_frame": true,
Expand All @@ -77,6 +77,30 @@ data:
]
}
}
config.npu.json: |
{
"config": {
"pipelines": [
{
"name": "filter-pipeline",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} ! decodebin3 ! gvadetect model=/models/public/yolo11s/FP16/yolo11s.xml batch_size=1 inference-interval=1 nireq=2 threshold=0.7 model-instance-id=instnpu0 name=detection device=NPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 device=NPU model-instance-id=infer1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"auto_start": false,
"mqtt_publisher": {
"publish_frame": true,
"topic": "edge_video_analytics_results"
}
},
{
"name": "search_image",
"source": "image_ingestor",
"queue_maxsize": 50,
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=NPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
}
]
}
}
person-vehicle-bike-detection-2004.json: |
{
"json_schema_version": "2.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,50 @@ spec:
omz_downloader --name resnet-50-pytorch --output_dir models &&
omz_converter --name resnet-50-pytorch --download_dir models --output_dir models &&
cp -r ./models/public/resnet-50-pytorch /output
) &&
test -d /output/person-vehicle-bike-detection-2004 || (
rm -fr /output/person-vehicle-bike-detection-2004 &&
omz_downloader --name person-vehicle-bike-detection-2004 --output_dir models &&
omz_converter --name person-vehicle-bike-detection-2004 --download_dir models --output_dir models &&
cp -r ./models/intel/person-vehicle-bike-detection-2004 /output
)
)
volumeMounts:
- name: '{{ include "image_based_video_search.fullname" . }}-dlstreamer-pipeline-server-models'
mountPath: /output
- name: model-downloader
image: intel/dlstreamer:2025.1.2-ubuntu24
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
env:
- name: http_proxy
value: {{ $.Values.httpProxy }}
- name: https_proxy
value: {{ $.Values.httpsProxy }}
- name: no_proxy
value: "{{ $.Values.noProxy }}"
command:
- /bin/sh
- -c
- |
mkdir -p /output
cd /tmp/repo/
git clone --depth 1 --filter=blob:none --sparse \
{{- if eq $.Values.dlstreamerpipelineserver.modelDownloader.gitSource.type "tag" }}
--branch {{ $.Values.dlstreamerpipelineserver.modelDownloader.gitSource.ref }} \
{{- else }}
--branch {{ $.Values.dlstreamerpipelineserver.modelDownloader.gitSource.ref }} \
{{- end }}
https://github.com/open-edge-platform/edge-ai-suites.git

cd edge-ai-suites
git sparse-checkout set \
metro-ai-suite/metro-vision-ai-app-recipe/smart-parking/src/dlstreamer-pipeline-server/models
cp -r metro-ai-suite/metro-vision-ai-app-recipe/smart-parking/src/dlstreamer-pipeline-server/models/* /output/
cd /home/dlstreamer/dlstreamer/samples
rm -rf /tmp/repo/edge-ai-suites
export MODELS_PATH=/output
./download_public_models.sh yolo11s coco128
volumeMounts:
- name: '{{ include "image_based_video_search.fullname" . }}-dlstreamer-pipeline-server-models'
mountPath: /output
- name: repo-volume
mountPath: /tmp/repo
containers:
- envFrom:
- configMapRef:
Expand Down Expand Up @@ -134,6 +168,8 @@ spec:
- name: '{{ include "image_based_video_search.fullname" . }}-dlstreamer-pipeline-server-models'
emptyDir:
sizeLimit: 10Gi
- name: repo-volume
emptyDir: {}
- name: dev-gpu
hostPath:
path: /dev/dri
Expand Down
9 changes: 9 additions & 0 deletions metro-ai-suite/image-based-video-search/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ dlstreamerpipelineserver:
# key: dlstreamerpipelineserver.serviceAccount
serviceAccount: ""

# Model downloader config
modelDownloader:
# Git source configuration for downloading models
gitSource:
# Use 'tag' for releases or 'branch' for branches
type: branch # Options: 'tag' or 'branch'
# Name of the tag or branch
ref: main # e.g., 'v1.0.0' for tag or 'main' for branch

# mediamtx configuration
mediamtx:
# key: mediamtx.repository
Expand Down
4 changes: 2 additions & 2 deletions metro-ai-suite/image-based-video-search/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ services:
- "/dev:/dev"
- dlstreamer-pipeline-server-tmp:/tmp
# - "../mr_models:/home/pipeline-server/mr_models:rw"
- "./src/dlstreamer-pipeline-server/models/person-vehicle-bike-detection-2004:/models/person-vehicle-bike-detection-2004"
- "./src/dlstreamer-pipeline-server/models/resnet-50-pytorch:/models/resnet50"
- "./src/dlstreamer-pipeline-server/models/public:/models/public"
- "./src/dlstreamer-pipeline-server/models/resnet-50-pytorch:/models/resnet-50-pytorch"
group_add:
# render group ID for ubuntu 20.04 host OS
- "109"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,30 @@ By following this guide, you will learn how to:
cp -r ./models/public/resnet-50-pytorch /output && \
chown -R $(id -u):$(id -g) /output"

# Download and convert the Person-Vehicle-Bike Detection model
docker run --rm \
--user=root \
-e http_proxy -e https_proxy -e no_proxy \
-v "$MODELS_PATH:/output" \
openvino/ubuntu22_dev:2024.6.0 bash -c \
"omz_downloader --name person-vehicle-bike-detection-2004 --output_dir models && \
omz_converter --name person-vehicle-bike-detection-2004 --download_dir models --output_dir models && \
cp -r ./models/intel/person-vehicle-bike-detection-2004 /output && \
chown -R $(id -u):$(id -g) /output"
# Download and quantize the yolov11s model
docker run --rm --user=root \
-e http_proxy -e https_proxy -e no_proxy \
-v "$MODELS_PATH:/output" \
intel/dlstreamer:2025.1.2-ubuntu24 bash -c "$(cat <<EOF

mkdir -p src/dlstreamer-pipeline-server/models/public

export MODELS_PATH=/output
chmod +x /home/dlstreamer/dlstreamer/samples/download_public_models.sh
if [ ! -e "src/dlstreamer-pipeline-server/models/public/yolo11s/INT8/yolo11s.xml" ]; then
for attempt in {1..3}; do
echo "Attempt $attempt: Running model download and quantization..."
if /home/dlstreamer/dlstreamer/samples/download_public_models.sh yolo11s coco128; then
echo "Model download and quantization successful!"
break
else
echo "Download attempt $attempt failed. Retrying..."
sleep 2
fi
done
fi
EOF
)"
```

</details>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "filter-pipeline",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} name=source ! decodebin3 ! gvadetect model=/models/person-vehicle-bike-detection-2004/FP32/person-vehicle-bike-detection-2004.xml model-proc=/models/person-vehicle-bike-detection-2004/person-vehicle-bike-detection-2004.json inference-interval=3 threshold=0.4 model-instance-id=detect1 device=CPU ! queue ! gvainference model=/models/resnet50/FP32/resnet-50-pytorch.xml inference-region=1 name=classification model-instance-id=infer1 device=CPU ! queue ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"pipeline": "{auto_source} name=source ! decodebin3 ! gvadetect model=/models/public/yolo11s/FP16/yolo11s.xml batch_size=1 inference-interval=1 nireq=2 threshold=0.7 model-instance-id=instcpu0 name=detection device=CPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 name=classification model-instance-id=infer1 device=CPU ! queue ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"auto_start": false,
"mqtt_publisher": {
"publish_frame": true,
Expand All @@ -16,7 +16,7 @@
"name": "search_image",
"source": "image_ingestor",
"queue_maxsize": 50,
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet50/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=CPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=CPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "filter-pipeline",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} ! decodebin3 ! gvadetect model=/models/person-vehicle-bike-detection-2004/FP32/person-vehicle-bike-detection-2004.xml model-proc=/models/person-vehicle-bike-detection-2004/person-vehicle-bike-detection-2004.json inference-interval=3 threshold=0.4 model-instance-id=detect1 device=GPU ! queue ! gvainference model=/models/resnet50/FP32/resnet-50-pytorch.xml inference-region=1 device=GPU model-instance-id=classify1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"pipeline": "{auto_source} name=source ! decodebin3 ! gvadetect model=/models/public/yolo11s/FP16/yolo11s.xml batch_size=1 inference-interval=1 inference-region=0 nireq=2 threshold=0.7 model-instance-id=instgpu0 name=detection device=GPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 device=GPU model-instance-id=classify1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"auto_start": false,
"mqtt_publisher": {
"publish_frame": true,
Expand All @@ -16,7 +16,7 @@
"name": "search_image",
"source": "image_ingestor",
"queue_maxsize": 50,
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet50/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=GPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=GPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "filter-pipeline",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} ! decodebin3 ! gvadetect model=/models/person-vehicle-bike-detection-2004/FP32/person-vehicle-bike-detection-2004.xml model-proc=/models/person-vehicle-bike-detection-2004/person-vehicle-bike-detection-2004.json inference-interval=3 threshold=0.4 model-instance-id=detect1 device=NPU ! queue ! gvainference model=/models/resnet50/FP32/resnet-50-pytorch.xml inference-region=1 device=NPU model-instance-id=classify1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"pipeline": "{auto_source} ! decodebin3 ! gvadetect model=/models/public/yolo11s/FP16/yolo11s.xml batch_size=1 inference-interval=1 nireq=2 threshold=0.7 model-instance-id=instnpu0 name=detection device=NPU ! queue ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml inference-region=1 device=NPU model-instance-id=infer1 ! queue ! vapostproc ! videoconvertscale ! gvametaconvert add-tensor-data=true name=metaconvert ! jpegenc ! appsink name=destination",
"auto_start": false,
"mqtt_publisher": {
"publish_frame": true,
Expand All @@ -16,7 +16,7 @@
"name": "search_image",
"source": "image_ingestor",
"queue_maxsize": 50,
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet50/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=NPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
"pipeline": "appsrc name=source ! decodebin3 ! gvainference model=/models/resnet-50-pytorch/FP32/resnet-50-pytorch.xml model-instance-id=infer2 device=NPU ! gvametaconvert add-tensor-data=true ! appsink name=destination"
}
]
}
Expand Down
Loading