fffiloni commited on
Commit
b904635
1 Parent(s): ef906df

Create DockerFile

Browse files
Files changed (1) hide show
  1. DockerFile +66 -0
DockerFile ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official PyTorch image with CUDA support as the base image
2
+ FROM pytorch/pytorch:1.9.0-cuda11.1-cudnn8-runtime
3
+
4
+ # Install Git and OpenGL libraries, and libglib2.0
5
+ RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
6
+
7
+ # Install the unzip and ffmpeg utilities (if not already installed)
8
+ RUN apt-get update && apt-get install -y unzip ffmpeg
9
+
10
+ # Set up a new user named "user" with user ID 1000
11
+ RUN useradd -m -u 1000 user
12
+
13
+ # Switch to the "user" user
14
+ USER user
15
+
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH \
18
+ PYTHONPATH=$HOME/app \
19
+ PYTHONUNBUFFERED=1 \
20
+ GRADIO_ALLOW_FLAGGING=never \
21
+ GRADIO_NUM_PORTS=1 \
22
+ GRADIO_SERVER_NAME=0.0.0.0 \
23
+ GRADIO_THEME=huggingface \
24
+ GRADIO_SHARE=False \
25
+ SYSTEM=spaces
26
+
27
+ # Set the working directory to the user's home directory
28
+ WORKDIR $HOME/app
29
+
30
+ # Clone your repository or add your code to the container
31
+ RUN git clone -b main https://github.com/fffiloni/video-retalking $HOME/app
32
+
33
+ # Install specific versions of PyTorch, TorchVision
34
+ RUN pip install torch==1.9.0 torchvision==0.10.0
35
+
36
+ # Install dependencies
37
+ RUN pip install --no-cache-dir -r requirements.txt gradio
38
+
39
+ USER root
40
+ # Update package lists and install aria2 without sudo
41
+ RUN apt-get update && apt-get install -y aria2
42
+ USER user
43
+
44
+ # Download checkpoint files using aria2
45
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/30_net_gen.pth -d $HOME/app/checkpoints -o 30_net_gen.pth
46
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/BFM.zip -d $HOME/app/checkpoints -o BFM.zip
47
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/DNet.pt -d $HOME/app/checkpoints -o DNet.pt
48
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/ENet.pth -d $HOME/app/checkpoints -o ENet.pth
49
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/GFPGANv1.3.pth -d $HOME/app/checkpoints -o GFPGANv1.3.pth
50
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/GPEN-BFR-512.pth -d $HOME/app/checkpoints -o GPEN-BFR-512.pth
51
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/LNet.pth -d $HOME/app/checkpoints -o LNet.pth
52
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/ParseNet-latest.pth -d $HOME/app/checkpoints -o ParseNet-latest.pth
53
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/RetinaFace-R50.pth -d $HOME/app/checkpoints -o RetinaFace-R50.pth
54
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/expression.mat -d $HOME/app/checkpoints -o expression.mat
55
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/face3d_pretrain_epoch_20.pth -d $HOME/app/checkpoints -o face3d_pretrain_epoch_20.pth
56
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/video-retalking/resolve/main/shape_predictor_68_face_landmarks.dat -d $HOME/app/checkpoints -o shape_predictor_68_face_landmarks.dat
57
+ RUN unzip -d $HOME/app/checkpoints/BFM $HOME/app/checkpoints/BFM.zip
58
+
59
+ RUN find $HOME/app
60
+
61
+ # Set the environment variable to specify the GPU device
62
+ ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
63
+ ENV CUDA_VISIBLE_DEVICES=0
64
+
65
+ # Run your app.py script
66
+ CMD ["python", "webUI.py"]