-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
50 lines (40 loc) · 2.68 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /home
COPY 7fa2af80.pub /tmp/
COPY 3bf863cc.pub /tmp/
RUN apt-key add /tmp/7fa2af80.pub &&\
apt-key add /tmp/3bf863cc.pub
RUN echo 'deb http://mirrors.cloud.tencent.com/ubuntu/ focal main restricted universe multiverse\n\
deb http://mirrors.cloud.tencent.com/ubuntu/ focal-security main restricted universe multiverse\n\
deb http://mirrors.cloud.tencent.com/ubuntu/ focal-updates main restricted universe multiverse\n\
#deb http://mirrors.cloud.tencent.com/ubuntu/ focal-proposed main restricted universe multiverse\n\
#deb http://mirrors.cloud.tencent.com/ubuntu/ focal-backports main restricted universe multiverse\n\
deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal main restricted universe multiverse\n\
deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal-security main restricted universe multiverse\n\
deb-src http://mirrors.cloud.tencent.com/ubuntu/ focal-updates main restricted universe multiverse\n'\
> /etc/apt/sources.list && \
apt-get update --fix-missing && DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai && apt-get install -y --no-install-recommends \
git \
npm \
wget \
python3 \
python3-dev \
python3-pip \
python3-opencv && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip3 install --no-cache-dir \
pip \
setuptools && \
python3 -m pip install --upgrade pip
RUN git clone http://deepmaterial.work/git/luziqing/segment_anything_streamlit.git && cd segment_anything_streamlit && \
pip install --no-cache-dir git+https://github.com/facebookresearch/segment-anything.git -i https://pypi.tuna.tsinghua.edu.cn/simple &&\
pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple &&\
cd streamlit_dc/streamlit_drawable_canvas/frontend && npm install && npm run build && cd ../../ && pip install -e . && \
cd /home/segment_anything_streamlit && mkdir checkpoint && \
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth -O checkpoint/sam_vit_b_01ec64.pth && \
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth -O checkpoint/sam_vit_l_0b3195.pth && \
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -O checkpoint/sam_vit_h_4b8939.pth
WORKDIR /home/segment_anything_streamlit