fffiloni commited on
Commit
3b79b75
1 Parent(s): 111e012

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +50 -0
Dockerfile ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
6
+
7
+ RUN apt-get update && apt-get install -y unzip build-essential aria2
8
+
9
+ RUN useradd -m -u 1000 user
10
+
11
+ USER user
12
+
13
+ ENV HOME=/home/user \
14
+ PATH=/home/user/.local/bin:$PATH \
15
+ PYTHONPATH=$HOME/app \
16
+ PYTHONUNBUFFERED=1 \
17
+ GRADIO_ALLOW_FLAGGING=never \
18
+ GRADIO_NUM_PORTS=1 \
19
+ GRADIO_SERVER_NAME=0.0.0.0 \
20
+ GRADIO_THEME=huggingface \
21
+ GRADIO_SHARE=False \
22
+ SYSTEM=spaces
23
+
24
+ # Set the working directory to the user's home directory
25
+ WORKDIR $HOME/app
26
+
27
+ COPY app.py .
28
+
29
+ # Clone your repository or add your code to the container
30
+ RUN git clone -b main https://github.com/sczhou/ProPainter $HOME/app
31
+
32
+ # Install specific versions of PyTorch and TorchVision
33
+ RUN pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 -f https://download.pytorch.org/whl/torch_stable.html
34
+
35
+ # Install dependencies
36
+ RUN pip install --no-cache-dir -r requirements.txt gradio
37
+
38
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/ProPainter/resolve/main/i3d_rgb_imagenet.pt -d $HOME/app/weigths -o i3d_rgb_imagenet.pt
39
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/ProPainter/resolve/main/raft-things.pth -d $HOME/app/weights -o raft-things.pth
40
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/ProPainter/resolve/main/recurrent_flow_completion.pth -d $HOME/app/weights -o recurrent_flow_completion.pth
41
+ RUN aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/ProPainter/resolve/main/ProPainter.pth -d $HOME/app/weights -o ProPainter.pth
42
+
43
+ RUN find $HOME/app
44
+
45
+ # Set the environment variable to specify the GPU device
46
+ ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
47
+ ENV CUDA_VISIBLE_DEVICES=0
48
+
49
+ # Run your app.py script
50
+ CMD ["python", "app.py"]