generated from shade-archive/template-semantic-segmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (27 loc) · 1.18 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ARG ROS_VERSION=humble
FROM shaderobotics/huggingface:${ROS_VERSION}
ARG ROS_VERSION=humble
ENV ROS_VERSION=$ROS_VERSION
ARG ORGANIZATION=thing
ARG MODEL_VERSION=2
ENV MODEL_NAME="$ORGANIZATION"/"$MODEL_VERSION"
WORKDIR /home/shade/shade_ws
# install additional dependencies here
RUN apt update && \
apt install -y \
python3-colcon-common-extensions \
python3-pip \
ros-${ROS_VERSION}-cv-bridge \
ros-${ROS_VERSION}-vision-opencv && \
echo "#!/bin/bash" >> /home/shade/shade_ws/start.sh && \
echo "source /opt/shade/setup.sh" >> /home/shade/shade_ws/start.sh && \
echo "source /opt/ros/${ROS_VERSION}/setup.sh" >> /home/shade/shade_ws/start.sh && \
echo "source ./install/setup.sh" >> ./start.sh && \
echo "ros2 run dpt_seg dpt_seg" >> /home/shade/shade_ws/start.sh && \
chmod +x ./start.sh
COPY . ./src/dpt_seg
RUN pip3 install ./src/dpt_seg && \
: "Install the model" && \
python3 -c "from transformers import AutoFeatureExtractor, DPTForSemanticSegmentation; AutoFeatureExtractor.from_pretrained('${MODEL_NAME}'); DPTForSemanticSegmentation.from_pretrained('${MODEL_NAME}')" && \
colcon build
ENTRYPOINT ["/home/shade/shade_ws/start.sh"]