File size: 1,748 Bytes
392065a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM tensorflow/tensorflow:latest-gpu

WORKDIR /home/gradio_demos

# resolve error related to opencv (ImportError: libGL.so.1: cannot open shared object file: No such file or directory)
RUN apt update
RUN apt -y upgrade
RUN apt install -y libgl1-mesa-glx

# install pip
# RUN apt install python3-pip

# install tensorflow
RUN pip3 install tensorflow

# install gradio module
RUN pip3 install gradio

# install module related to neural style transfer function
RUN pip3 install tensorflow_hub

# install module related to background removal function
RUN pip3 install rembg

# install module related to object removal function
RUN pip3 install simple_lama_inpainting

# install module related to in-painting function
COPY PowerPaint ./PowerPaint
RUN pip3 install -r PowerPaint/requirements/requirements.txt
RUN apt install -y git-lfs
RUN git lfs install
RUN git lfs clone https://huggingface.co/JunhaoZhuang/PowerPaint-v1/ ./checkpoints/ppt-v1

# install module related to upscaling function
RUN git clone https://github.com/xinntao/Real-ESRGAN.git
RUN pip3 install basicsr
RUN sed -i 's/torchvision.transforms.functional_tensor/torchvision.transforms.functional/g' /usr/local/lib/python3.11/dist-packages/basicsr/data/degradations.py
RUN pip3 install facexlib
RUN pip3 install gfpgan
RUN pip3 install -r Real-ESRGAN/requirements.txt
WORKDIR /home/gradio_demos/Real-ESRGAN
RUN python3 setup.py develop
WORKDIR /home/gradio_demos

# upgrade gradio to support newest components
RUN pip3 install --upgrade gradio

# copy dependency files and scripts
COPY images ./images
COPY images2 ./images2
COPY images3 ./images3
COPY images4 ./images4
COPY style_images ./style_images
COPY gradio_dynamic.py .

# run main script
CMD ["python3", "gradio_dynamic.py"]