-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (40 loc) · 1.74 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (40 loc) · 1.74 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM nvidia/cuda:10.1-cudnn7-devel
WORKDIR /workspace
RUN mkdir -p /root/.ssh
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
python3-opencv ca-certificates python3-dev python3-pip git wget sudo && \
rm -rf /var/lib/apt/lists/*
# create a non-root user
# ARG USER_ID=1000
# RUN useradd -m --no-log-init --system --uid ${USER_ID} appuser -g sudo
# RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# USER appuser
# WORKDIR /home/appuser
ENV PATH="/home/appuser/.local/bin:${PATH}"
# RUN wget https://bootstrap.pypa.io/get-pip.py && \
# python3 get-pip.py --user && \
# rm get-pip.py
# install dependencies
# See https://pytorch.org/ for other options if you use a different version of CUDA
RUN pip3 install torch torchvision tensorboard cython
RUN pip3 install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
RUN pip3 install 'git+https://github.com/facebookresearch/fvcore'
# install detectron2
# RUN git clone https://github.com/facebookresearch/detectron2 detectron2_repo
RUN mkdir /detectron2_repo
COPY /detectron2_repo /workspace/detectron2_repo
RUN ls -al
ENV FORCE_CUDA="1"
ENV TORCH_CUDA_ARCH_LIST="Kepler;Kepler+Tesla;Maxwell;Maxwell+Tegra;Pascal;Volta;Turing"
RUN pip3 install -e detectron2_repo
RUN pip3 install imantics scikit-image IPython[all]
# Set a fixed model cache directory.
ENV FVCORE_CACHE="/tmp"
WORKDIR /detectron2_repo
# run it, for example:
# wget http://images.cocodataset.org/val2017/000000439715.jpg -O input.jpg
# python3 demo/demo.py \
#--config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml \
#--input input.jpg --output outputs/ \
#--opts MODEL.WEIGHTS detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl