Skip to content

Commit

Permalink
718 RTDETR for L4T (#723)
Browse files Browse the repository at this point in the history
* module image types documentation

* lt4 implementation for rtdetr

* fixed perf module

* updated extra files

* updated rtdetr

* updated rtdetr

* literal fix

---------

Co-authored-by: Denis Medyantsev <denisvmedyantsev@gmail.com>
  • Loading branch information
bwsw and denisvmedyantsev committed Apr 5, 2024
1 parent 5097a71 commit 3b8209d
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 10 deletions.
11 changes: 6 additions & 5 deletions docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@
| [#612](https://github.com/insight-platform/Savant/issues/612) | 430.29 | | 117.03 |
| [#641](https://github.com/insight-platform/Savant/issues/641) | 430.91 | | 111.75 |

### rtdetr
### RTDETR R50

| Savant ver. | A4000 | Xavier NX | Orin Nano |
|---------------------------------------------------------------|--------|-----------|-----------|
| [#558](https://github.com/insight-platform/Savant/issues/558) | 137.41 | | |
| [#612](https://github.com/insight-platform/Savant/issues/612) | 134.47 | | |
| [#641](https://github.com/insight-platform/Savant/issues/641) | 119.21 | | |
|---------------------------------------------------------------|--------|--------|-----------|
| [#558](https://github.com/insight-platform/Savant/issues/558) | 137.41 | | |
| [#612](https://github.com/insight-platform/Savant/issues/612) | 134.47 | | |
| [#641](https://github.com/insight-platform/Savant/issues/641) | 119.21 | | |
| [#718](https://github.com/insight-platform/Savant/issues/718) | 119.21 | | 25 |

### traffic_meter (yolov8m)

Expand Down
3 changes: 2 additions & 1 deletion samples/rtdetr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Weights used: `v0.1/rtdetr_r50vd_6x_coco_from_paddle.pth` from the [RT-DETR rel

Tested on platforms:

- Nvidia Turing.
- Nvidia Turing;
- Nvidia Jetson Orin Nano.

Demonstrated operational modes:

Expand Down
2 changes: 1 addition & 1 deletion samples/rtdetr/build_engines.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
MODULE_CONFIG=samples/rtdetr/module.yml

if [ "$(uname -m)" = "aarch64" ]; then
echo "aarch64 not supported for this demo."
docker compose -f samples/rtdetr/docker-compose.l4t.yml build module
else
docker compose -f samples/rtdetr/docker-compose.x86.yml build module
fi
Expand Down
58 changes: 58 additions & 0 deletions samples/rtdetr/docker-compose.l4t.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: "3.3"
services:

video-loop-source:
image: ghcr.io/insight-platform/savant-adapters-gstreamer-l4t:latest
restart: unless-stopped
volumes:
- zmq_sockets:/tmp/zmq-sockets
- /tmp/video-loop-source-downloads:/tmp/video-loop-source-downloads
environment:
- LOCATION=https://eu-central-1.linodeobjects.com/savant-data/demo/leeds_1080p.mp4
- DOWNLOAD_PATH=/tmp/video-loop-source-downloads
- ZMQ_ENDPOINT=dealer+connect:ipc:///tmp/zmq-sockets/input-video.ipc
- SOURCE_ID=leeds
- SYNC_OUTPUT=True
entrypoint: /opt/savant/adapters/gst/sources/video_loop.sh
depends_on:
module:
condition: service_healthy

module:
build:
context: .
dockerfile: docker/Dockerfile.l4t
volumes:
- zmq_sockets:/tmp/zmq-sockets
- ../../cache:/cache
- ..:/opt/savant/samples
command: samples/rtdetr/module.yml
environment:
- MODEL_PATH=/cache/models/rtdetr
- DOWNLOAD_PATH=/cache/downloads/rtdetr
- ZMQ_SRC_ENDPOINT=router+bind:ipc:///tmp/zmq-sockets/input-video.ipc
- ZMQ_SINK_ENDPOINT=pub+bind:ipc:///tmp/zmq-sockets/output-video.ipc
- CODEC=jpeg
runtime: nvidia

always-on-sink:
image: ghcr.io/insight-platform/savant-adapters-deepstream-l4t:latest
restart: unless-stopped
ports:
- "554:554" # RTSP
- "1935:1935" # RTMP
- "888:888" # HLS
- "8889:8889" # WebRTC
volumes:
- zmq_sockets:/tmp/zmq-sockets
- ../assets/stub_imgs:/stub_imgs
environment:
- ZMQ_ENDPOINT=sub+connect:ipc:///tmp/zmq-sockets/output-video.ipc
- SOURCE_ID=leeds
- FRAMERATE=25/1
- STUB_FILE_LOCATION=/stub_imgs/smpte100_1920x1080.jpeg
- DEV_MODE=True
command: python -m adapters.ds.sinks.always_on_rtsp

volumes:
zmq_sockets:
27 changes: 27 additions & 0 deletions samples/rtdetr/docker/Dockerfile.l4t
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# build nvinfer custom library for yolo models (create engine and parse bbox functions)
# https://github.com/marcoslucianops/DeepStream-Yolo
FROM nvcr.io/nvidia/deepstream:6.4-triton-multiarch as builder

ENV CUDA_VER=12.2
ARG DS_YOLO_VER=5af9da189d91fa8808695c488a417f9f1c920b77
ARG DS_YOLO_PATH=/opt/yolo
ARG NVDSINFER_PATH=/opt/nvidia/deepstream/deepstream/sources/libs/nvdsinfer

RUN git clone https://github.com/marcoslucianops/DeepStream-Yolo.git $DS_YOLO_PATH \
&& cd $DS_YOLO_PATH \
&& git checkout $DS_YOLO_VER \
&& make -C nvdsinfer_custom_impl_Yolo

# patch nvdsinfer_model_builder.cpp: use engine path to place created engine
COPY nvdsinfer_model_builder.patch $NVDSINFER_PATH/
RUN cd $NVDSINFER_PATH && \
patch nvdsinfer_model_builder.cpp < nvdsinfer_model_builder.patch && \
make

FROM ghcr.io/insight-platform/savant-deepstream-l4t:latest

ARG DS_YOLO_PATH=/opt/yolo
ARG NVDSINFER_PATH=/opt/nvidia/deepstream/deepstream/sources/libs/nvdsinfer

COPY --from=builder $DS_YOLO_PATH/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so /opt/savant/lib/
COPY --from=builder $NVDSINFER_PATH/libnvds_infer.so /opt/nvidia/deepstream/deepstream/lib/
4 changes: 1 addition & 3 deletions samples/rtdetr/run_perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ MODULE_CONFIG=samples/rtdetr/module.yml
DATA_LOCATION=data/leeds_1080p.mp4

if [ "$(uname -m)" = "aarch64" ]; then
# docker compose -f samples/rtdetr/docker-compose.l4t.yml build module
echo "L4T benchmark is not implemented"
exit 1
docker compose -f samples/rtdetr/docker-compose.l4t.yml build module
else
docker compose -f samples/rtdetr/docker-compose.x86.yml build module
fi
Expand Down

0 comments on commit 3b8209d

Please sign in to comment.