forked from cleardusk/3DDFA_V2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (44 loc) · 1.64 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
ARG CUDA_VERSION=10.2
# See possible types: https://hub.docker.com/r/nvidia/cuda/tags?page=1&ordering=last_updated
ARG IMAGE_TYPE=runtime
FROM nvidia/cudagl:${CUDA_VERSION}-${IMAGE_TYPE}-ubuntu18.04 as builder
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /home
RUN apt update && \
apt install -y gcc g++ \
wget && \
apt autoremove -y && \
apt clean -y
# Install Miniconda
ARG CONDA_VERSION=py38_4.9.2
ARG CONDA_DIR=/opt/conda
ENV PATH=$CONDA_DIR/bin:$PATH
RUN wget -q -O ./miniconda.sh http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh \
&& sh ./miniconda.sh -bfp $CONDA_DIR \
&& rm ./miniconda.sh
ENV PATH=$CONDA_DIR/bin:$PATH
WORKDIR /home/app
COPY ./environment.yml ./
RUN conda env update -n base --file ./environment.yml && conda clean -yfa && rm ./environment.yml
WORKDIR /home/app
COPY ./bfm ./3DDFA_V2/bfm
COPY ./configs ./3DDFA_V2/configs
COPY ./FaceBoxes ./3DDFA_V2/FaceBoxes
COPY ./models ./3DDFA_V2/models
COPY ./Sim3DR ./3DDFA_V2/Sim3DR
COPY ./utils ./3DDFA_V2/utils
COPY ./weights ./3DDFA_V2/weights
COPY ./build.sh ./3DDFA_V2/
RUN cd ./3DDFA_V2 && \
sh ./build.sh
COPY ./demo_video_smooth.py ./demo_video.py ./demo_webcam_smooth.py ./demo.py ./extract_facelabinfo.py \
./latency.py ./speed_cpu.py ./TDDFA_ONNX.py ./TDDFA.py ./3DDFA_V2/
FROM nvidia/cudagl:${CUDA_VERSION}-runtime-ubuntu18.04
ENV DEBIAN_FRONTEND=noninteractive
ARG CONDA_DIR=/opt/conda
COPY --from=builder /opt/conda /opt/conda
ENV PATH=$CONDA_DIR/bin:$PATH
ARG PROJECT_DIR=/home/app/3DDFA_V2
COPY --from=builder ${PROJECT_DIR} ${PROJECT_DIR}
WORKDIR ${PROJECT_DIR}
CMD python ./extract_facelabinfo.py