From 5b2eeefeea0d010a4a04a817148ee2b870df3021 Mon Sep 17 00:00:00 2001 From: Giuseppe Quaratino Date: Sun, 25 Feb 2024 12:34:31 -0500 Subject: [PATCH] Added GroundingDINO and Dockerfile --- ros/docker/ObjectDetection/Dockerfile | 33 ++++++++++++++++++++++++ ros/docker/ObjectDetection/GroundingDINO | 1 + 2 files changed, 34 insertions(+) create mode 100644 ros/docker/ObjectDetection/Dockerfile create mode 160000 ros/docker/ObjectDetection/GroundingDINO diff --git a/ros/docker/ObjectDetection/Dockerfile b/ros/docker/ObjectDetection/Dockerfile new file mode 100644 index 000000000..02dc14231 --- /dev/null +++ b/ros/docker/ObjectDetection/Dockerfile @@ -0,0 +1,33 @@ +FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-devel + +# Arguments to build Docker Image using CUDA +ARG USE_CUDA=0 +ARG TORCH_ARCH= +ARG DEBIAN_FRONTEND=noninteractive + +ENV AM_I_DOCKER True +ENV BUILD_WITH_CUDA "${USE_CUDA}" +ENV TORCH_CUDA_ARCH_LIST "${TORCH_ARCH}" +ENV CUDA_HOME /usr/local/cuda-12.1 + +RUN mkdir -p /home/appuser/GrouningDINO +COPY ./GroundingDINO /home/appuser/GrouningDINO/ + +RUN apt-get update && apt-get install --no-install-recommends wget ffmpeg \ + libsm6 libxext6 git nano vim libxrender1 libxtst6 -y \ + && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/* + +# Enable "universe" repository +RUN sed -i 's/main$/main universe/' /etc/apt/sources.list + +# Install required packages +RUN apt-get update && apt-get install --no-install-recommends -y \ + libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 + +ENV PATH /usr/local/cuda-12.1/bin:${PATH} +ENV LD_LIBRARY_PATH /usr/local/cuda-12.1/lib64:${LD_LIBRARY_PATH} + +# Set environment variables for X11 +ENV DISPLAY=:0 + +WORKDIR /home/appuser/GrouningDINO diff --git a/ros/docker/ObjectDetection/GroundingDINO b/ros/docker/ObjectDetection/GroundingDINO new file mode 160000 index 000000000..2b62f419c --- /dev/null +++ b/ros/docker/ObjectDetection/GroundingDINO @@ -0,0 +1 @@ +Subproject commit 2b62f419c292ca9c518daae55512fabc3fead4a4