File size: 2,176 Bytes
0ccb481
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9d39eee
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
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

ENV DEBIAN_FRONTEND=noninteractive

#RUN apt-get update && apt-get install -y \
#    git wget libgl1-mesa-glx libglib2.0-0 ffmpeg libx264-dev \
#    && rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y \
    git make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
    libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev \
    libxmlsec1-dev libffi-dev liblzma-dev git-lfs ffmpeg libsm6 libxext6 cmake \
    libgl1-mesa-glx \
    && rm -rf /var/lib/apt/lists/* && git lfs install

RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH \
    PYTHONPATH=$HOME/app \
	PYTHONUNBUFFERED=1 \
	GRADIO_ALLOW_FLAGGING=never \
	GRADIO_NUM_PORTS=1 \
	GRADIO_SERVER_NAME=0.0.0.0 \
	GRADIO_THEME=huggingface \
    GRADIO_SHARE=False \
	SYSTEM=spaces

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Clone your repository or add your code to the container
RUN git clone https://github.com/sczhou/ProPainter.git $HOME/app

# Install specific versions of PyTorch and TorchVision
RUN pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 -f https://download.pytorch.org/whl/torch_stable.html

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt \
    gradio==3.50.2 opencv-python transformers supervision

# Download weights
RUN mkdir -p $HOME/app/weigths
RUN wget -c -O $HOME/app/weigths/i3d_rgb_imagenet.pt https://huggingface.co/camenduru/ProPainter/resolve/main/i3d_rgb_imagenet.pt
RUN wget -c -O $HOME/app/weights/raft-things.pth https://huggingface.co/camenduru/ProPainter/resolve/main/raft-things.pth
RUN wget -c -O $HOME/app/weights/recurrent_flow_completion.pth https://huggingface.co/camenduru/ProPainter/resolve/main/recurrent_flow_completion.pth
RUN wget -c -O $HOME/app/weights/ProPainter.pth https://huggingface.co/camenduru/ProPainter/resolve/main/ProPainter.pth

COPY app.py .

RUN find $HOME/app

# Set the environment variable to specify the GPU device
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
ENV CUDA_VISIBLE_DEVICES=0

# Run your app.py script
CMD ["python", "app.py"]