Skip to content

Commit

Permalink
feat: Independent Docker image for low code (DLStreamer) version of t…
Browse files Browse the repository at this point in the history
…he microservice (#603)

---------

Signed-off-by: Brian McGinn <[email protected]>
  • Loading branch information
brian-intel authored Aug 5, 2024
1 parent b0da3d3 commit 31e0078
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 5 deletions.
7 changes: 5 additions & 2 deletions helm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
FROM intel/dlstreamer:2023.0.0-ubuntu22-gpu682-dpcpp as base
USER root

COPY src/requirements.txt /requirements.txt
COPY helm/requirements.txt /requirements.txt
RUN pip3 install --upgrade pip --no-cache-dir -r /requirements.txt
WORKDIR /
COPY src/extensions /home/pipeline-server/extensions
COPY src/pipelines /home/pipeline-server/pipelines
COPY /models /home/pipeline-server/models
COPY /download_models/downloadModels.sh /home/pipeline-server/models/downloadModels.sh
WORKDIR /home/pipeline-server/models
RUN sh downloadModels.sh
WORKDIR /

COPY src/entrypoint.sh /script/entrypoint.sh
RUN mkdir /tmp/results
24 changes: 21 additions & 3 deletions helm/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ services:
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://camera-simulator:8554/camera_0
depends_on:
- camera-simulator
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media

dlstreamer:
image: dlstreamer:deploy
Expand All @@ -45,6 +43,26 @@ services:
- OCR_RECLASSIFY_INTERVAL=5
- BARCODE_RECLASSIFY_INTERVAL=5
- RENDER_MODE=0
- PIPELINE_SCRIPT=yolov5s.sh
- PUBLISH=${PUBLISH:-address=mqtt-broker:1883 topic=inferenceEvent method=mqtt}
depends_on:
- camera-simulator0

mqtt-broker:
command:
- /usr/sbin/mosquitto
- -c
- /mosquitto-no-auth.conf
container_name: mqtt-broker
hostname: mqtt-broker
image: eclipse-mosquitto:2.0.18
ports:
- mode: ingress
host_ip: 127.0.0.1
target: 1883
published: "1883"
protocol: tcp
read_only: true
restart: always
security_opt:
- no-new-privileges:true
user: 2002:2001
3 changes: 3 additions & 0 deletions helm/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pyzbar==0.1.9
zxing-cpp==2.2.0
numpy==1.26.4
1 change: 1 addition & 0 deletions src/pipelines/yolov5s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

PRE_PROCESS="${PRE_PROCESS:=""}" #""|pre-process-backend=vaapi-surface-sharing|pre-process-backend=vaapi-surface-sharing pre-process-config=VAAPI_FAST_SCALE_LOAD_FACTOR=1
AGGREGATE="${AGGREGATE:="gvametaaggregate name=aggregate !"}" # Aggregate function at the end of the pipeline ex. "" | gvametaaggregate name=aggregate
PUBLISH="${PUBLISH:="name=destination file-format=2 file-path=/tmp/results/r$cid\"_gst\".jsonl"}" # address=localhost:1883 topic=inferenceEvent method=mqtt

if [ "$RENDER_MODE" == "1" ]; then
OUTPUT="${OUTPUT:="! videoconvert ! video/x-raw,format=I420 ! gvawatermark ! videoconvert ! fpsdisplaysink video-sink=ximagesink sync=true --verbose"}"
Expand Down
2 changes: 2 additions & 0 deletions src/pipelines/yolov5s_effnetb0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ DETECTION_OPTIONS="${DETECTION_OPTIONS:="gpu-throughput-streams=4 nireq=4 batch-

CLASSIFICATION_OPTIONS="${CLASSIFICATION_OPTIONS:="reclassify-interval=1 $DETECTION_OPTIONS"}" # Extra Classification model parameters ex. "" | reclassify-interval=1 batch-size=1 nireq=4 gpu-throughput-streams=4

PUBLISH="${PUBLISH:="name=destination file-format=2 file-path=/tmp/results/r$cid\"_gst\".jsonl"}" # address=localhost:1883 topic=inferenceEvent method=mqtt

if [ "$RENDER_MODE" == "1" ]; then
OUTPUT="${OUTPUT:="! videoconvert ! video/x-raw,format=I420 ! gvawatermark ! videoconvert ! fpsdisplaysink video-sink=ximagesink sync=true --verbose"}"
else
Expand Down
1 change: 1 addition & 0 deletions src/pipelines/yolov5s_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PARALLEL_PIPELINE="${PARALLEL_PIPELINE:=""}" # Run pipeline in parallel using th
PARALLEL_AGGRAGATE="${PARALLEL_AGGRAGATE:=""}" # Aggregate parallel pipeline results together ex. "" | ! gvametaaggregate name=aggregate ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination file-format=2 file-path=/tmp/results/r$cid_count.jsonl ! fpsdisplaysink video-sink=fakesink sync=true --verbose branch. ! queue !
OCR_RECLASSIFY_INTERVAL="${OCR_RECLASSIFY_INTERVAL:=5}"
BARCODE_RECLASSIFY_INTERVAL="${BARCODE_RECLASSIFY_INTERVAL:=5}"
PUBLISH="${PUBLISH:="name=destination file-format=2 file-path=/tmp/results/r$cid\"_gst\".jsonl"}" # address=localhost:1883 topic=inferenceEvent method=mqtt

if [ "$RENDER_MODE" == "1" ]; then
OUTPUT="${OUTPUT:="! videoconvert ! video/x-raw,format=I420 ! gvawatermark ! videoconvert ! fpsdisplaysink video-sink=ximagesink sync=true --verbose"}"
Expand Down

0 comments on commit 31e0078

Please sign in to comment.