Spaces:
Runtime error
Runtime error
weihuang11
commited on
Commit
•
5969f43
1
Parent(s):
2c0272c
ADD Dockerfile
Browse files- Dockerfile +80 -0
- README.md +4 -5
- app.py +0 -7
Dockerfile
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official PyTorch image with CUDA support as the base image
|
2 |
+
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
|
3 |
+
|
4 |
+
# Add NVIDIA CUDA GPG key
|
5 |
+
# Add NVIDIA CUDA GPG key using a different key server
|
6 |
+
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key A4B469963BF863CC
|
7 |
+
|
8 |
+
# Install Git and system libraries required for OpenGL without interactive prompts
|
9 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
10 |
+
|
11 |
+
# Install Git, OpenGL libraries, and libglib2.0
|
12 |
+
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0
|
13 |
+
|
14 |
+
RUN apt-get update && apt-get install -y ninja-build
|
15 |
+
|
16 |
+
# Install necessary dependencies, including CMake, a C++ compiler, and others
|
17 |
+
RUN apt-get update && apt-get install -y unzip ffmpeg cmake g++ build-essential aria2
|
18 |
+
|
19 |
+
# Set up a new user named "user" with user ID 1000
|
20 |
+
RUN useradd -m -u 1000 user
|
21 |
+
|
22 |
+
# Switch to the "user" user
|
23 |
+
USER user
|
24 |
+
|
25 |
+
# Set environment variables
|
26 |
+
ENV HOME=/home/user \
|
27 |
+
CUDA_HOME=/usr/local/cuda \
|
28 |
+
PATH=/home/user/.local/bin:$PATH \
|
29 |
+
LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} \
|
30 |
+
LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH} \
|
31 |
+
PYTHONPATH=$HOME/app \
|
32 |
+
PYTHONUNBUFFERED=1 \
|
33 |
+
GRADIO_ALLOW_FLAGGING=never \
|
34 |
+
GRADIO_NUM_PORTS=1 \
|
35 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
36 |
+
GRADIO_THEME=huggingface \
|
37 |
+
GRADIO_SHARE=False \
|
38 |
+
SYSTEM=spaces
|
39 |
+
|
40 |
+
# Set the working directory to the user's home directory
|
41 |
+
WORKDIR $HOME/app
|
42 |
+
|
43 |
+
# Clone your repository or add your code to the container
|
44 |
+
RUN git clone -b main https://github.com/fffiloni/video-retalking $HOME/app
|
45 |
+
|
46 |
+
# Install specific versions of PyTorch and TorchVision
|
47 |
+
RUN pip install torch==2.0.0+cu117 torchvision==0.15.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html
|
48 |
+
|
49 |
+
# Install dependencies
|
50 |
+
#COPY requirements.txt $HOME/app/requirements.txt
|
51 |
+
RUN pip install --no-cache-dir -r requirements.txt gradio moviepy
|
52 |
+
|
53 |
+
# Download checkpoint files using aria2
|
54 |
+
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
|
55 |
+
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
|
56 |
+
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
|
57 |
+
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
|
58 |
+
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
|
59 |
+
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
|
60 |
+
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
|
61 |
+
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
|
62 |
+
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
|
63 |
+
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
|
64 |
+
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
|
65 |
+
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
|
66 |
+
RUN unzip -d $HOME/app/checkpoints/BFM $HOME/app/checkpoints/BFM.zip
|
67 |
+
|
68 |
+
# Ensure the compiled CUDA code can be found
|
69 |
+
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
|
70 |
+
|
71 |
+
# Update package lists and install other dependencies as needed
|
72 |
+
# Ensure that CUDA components are correctly installed and configured
|
73 |
+
# Install any other required packages
|
74 |
+
|
75 |
+
# Set the environment variable to specify the GPU device
|
76 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
77 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
78 |
+
|
79 |
+
# Run your app.py script
|
80 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1 |
---
|
2 |
-
title: LipSync
|
3 |
emoji: 🌍
|
4 |
colorFrom: gray
|
5 |
colorTo: purple
|
6 |
-
sdk:
|
7 |
-
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
1 |
---
|
2 |
+
title: LipSync from Algmon
|
3 |
emoji: 🌍
|
4 |
colorFrom: gray
|
5 |
colorTo: purple
|
6 |
+
sdk: docker
|
7 |
+
pinned: true
|
|
|
|
|
8 |
---
|
9 |
|
10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
11 |
+
arxiv.org/abs/2211.14758
|
app.py
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
-
|
6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|