pragnakalp commited on
Commit
1391011
1 Parent(s): f23bd0b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -60
Dockerfile CHANGED
@@ -2,7 +2,6 @@ FROM ubuntu:latest
2
 
3
  WORKDIR /content
4
 
5
- # Install essential system packages
6
  RUN apt-get update && apt-get install -y \
7
  python3 \
8
  python3-pip \
@@ -24,93 +23,56 @@ RUN apt-get update && apt-get install -y \
24
  libgtk2.0-0 \
25
  jq \
26
  libraw1394-dev \
27
- libopenblas-dev \
28
- ffmpeg
29
 
30
- # Alias python3 to python
31
  RUN alias python=python3
32
 
33
- # Add universe repository
 
34
  RUN apt-add-repository -y universe
35
 
36
- # Create and activate Python virtual environment
37
  RUN python3 -m venv /content/venv
38
 
39
- # Install required Python packages
40
- RUN /content/venv/bin/pip install \
41
- git+https://github.com/One-sixth/fairseq.git \
42
- setuptools \
43
- pandas \
44
- scipy \
45
- matplotlib \
46
- torch \
47
- torchvision \
48
- ffmpeg-python \
49
- imageio[ffmpeg] \
50
- tensorboardX \
51
- huggingface-hub \
52
- g2p_en \
53
- opencv-python \
54
- imageio \
55
- torchaudio \
56
- gradio \
57
- gtts \
58
- soundfile \
59
- numpy==2.2.0 \
60
- mediapipe \
61
- gfpgan \
62
- cmake==3.24.1.1 \
63
- altair \
64
- imageio-ffmpeg \
65
- pocketsphinx \
66
- jq \
67
- nltk
68
-
69
- # Clone and install PyVideoFramesExtractor
70
- RUN git clone https://github.com/chi0tzp/PyVideoFramesExtractor && \
71
- cd PyVideoFramesExtractor && \
72
- /content/venv/bin/pip install -r requirements.txt
73
 
74
- # Install git-lfs and clone additional repositories
75
- RUN git lfs install
76
- RUN git clone https://huggingface.co/camenduru/pocketsphinx-20.04-t4 pocketsphinx && \
77
- cd pocketsphinx && \
78
- cmake -S . -B build && \
79
- cmake --build build --target install
 
 
 
 
 
80
 
81
- RUN git clone https://huggingface.co/camenduru/one-shot-talking-face-20.04-t4 one-shot-talking-face && \
82
- cd one-shot-talking-face && \
83
- /content/venv/bin/pip install -r requirements.txt && \
84
- chmod 755 OpenFace/FeatureExtraction
85
 
86
- # Update one-shot-talking-face scripts to use CPU
 
 
87
  RUN sed -i 's/.cuda()/ /' one-shot-talking-face/test_script.py
88
  RUN sed -i 's/.cuda()/ /' one-shot-talking-face/tools/interface.py
89
  RUN sed -i 's/.load(checkpoint_path)/.load(checkpoint_path,map_location=torch.device("cpu")) /' one-shot-talking-face/tools/interface.py
90
  RUN sed -i 's/.load(audio2pose)/.load(audio2pose,map_location=torch.device("cpu")) /' one-shot-talking-face/tools/interface.py
91
-
92
- # Prepare output directory
93
  RUN mkdir /content/out
94
 
95
- # Copy application code
96
  COPY app.py /content/app.py
97
 
98
- # Set up admin user
99
  RUN adduser --disabled-password --gecos '' admin
100
  RUN adduser admin sudo
101
  RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
102
 
103
- # Set permissions
104
  RUN chown -R admin:admin /content
105
  RUN chmod -R 777 /content
106
  RUN chown -R admin:admin /home
107
  RUN chmod -R 777 /home
108
-
109
- # Switch to admin user
110
  USER admin
111
 
112
- # Expose application port
113
  EXPOSE 7860
114
 
115
- # Run application
116
  CMD ["/content/venv/bin/python", "app.py"]
 
2
 
3
  WORKDIR /content
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
  python3 \
7
  python3-pip \
 
23
  libgtk2.0-0 \
24
  jq \
25
  libraw1394-dev \
26
+ libopenblas-dev
 
27
 
 
28
  RUN alias python=python3
29
 
30
+ RUN apt-get install -y gnupg wget htop sudo git git-lfs software-properties-common build-essential cmake curl
31
+ RUN apt-get install -y ffmpeg libavcodec-dev libavformat-dev libavdevice-dev libgl1 libgtk2.0-0 jq libraw1394-dev libopenblas-dev
32
  RUN apt-add-repository -y universe
33
 
 
34
  RUN python3 -m venv /content/venv
35
 
36
+ RUN /content/venv/bin/pip install git+https://github.com/One-sixth/fairseq.git
37
+ RUN /content/venv/bin/pip install setuptools pandas scipy matplotlib torch torchvision ffmpeg-python imageio[ffmpeg] tensorboardX huggingface-hub g2p_en opencv-python imageio torchaudio gradio gtts soundfile fairseq huggingface-hub g2p_en altair imageio-ffmpeg pocketsphinx ffmpeg jq
38
+ # RUN /content/venv/bin/pip install setuptools pandas scipy matplotlib torch torchvision ffmpeg-python imageio[ffmpeg] tensorboardX huggingface-hub g2p_en opencv-python imageio torchaudio gradio gtts soundfile fairseq huggingface-hub g2p_en altair imageio-ffmpeg pocketsphinx ffmpeg jq nltk
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ RUN /content/venv/bin/pip install numpy==2.2.0
41
+ RUN /content/venv/bin/pip install cmake==3.24.1.1
42
+ RUN /content/venv/bin/pip install gfpgan
43
+ RUN /content/venv/bin/pip install mediapipe
44
+ # RUN git clone https://github.com/TencentARC/GFPGAN.git && \
45
+ # cd GFPGAN && \
46
+ # /content/venv/bin/pip install basicsr && \
47
+ # /content/venv/bin/pip install facexlib && \
48
+ # /content/venv/bin/pip install -r requirements.txt && \
49
+ # python3 setup.py develop && \
50
+ # /content/venv/bin/pip install realesrgan
51
 
52
+ RUN git clone https://github.com/chi0tzp/PyVideoFramesExtractor && cd PyVideoFramesExtractor && /content/venv/bin/pip install -r requirements.txt
 
 
 
53
 
54
+ RUN git lfs install
55
+ RUN git clone https://huggingface.co/camenduru/pocketsphinx-20.04-t4 pocketsphinx && cd pocketsphinx && cmake -S . -B build && cmake --build build --target install
56
+ RUN git clone https://huggingface.co/camenduru/one-shot-talking-face-20.04-t4 one-shot-talking-face && cd one-shot-talking-face && /content/venv/bin/pip install -r requirements.txt && chmod 755 OpenFace/FeatureExtraction
57
  RUN sed -i 's/.cuda()/ /' one-shot-talking-face/test_script.py
58
  RUN sed -i 's/.cuda()/ /' one-shot-talking-face/tools/interface.py
59
  RUN sed -i 's/.load(checkpoint_path)/.load(checkpoint_path,map_location=torch.device("cpu")) /' one-shot-talking-face/tools/interface.py
60
  RUN sed -i 's/.load(audio2pose)/.load(audio2pose,map_location=torch.device("cpu")) /' one-shot-talking-face/tools/interface.py
 
 
61
  RUN mkdir /content/out
62
 
 
63
  COPY app.py /content/app.py
64
 
65
+
66
  RUN adduser --disabled-password --gecos '' admin
67
  RUN adduser admin sudo
68
  RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
69
 
 
70
  RUN chown -R admin:admin /content
71
  RUN chmod -R 777 /content
72
  RUN chown -R admin:admin /home
73
  RUN chmod -R 777 /home
 
 
74
  USER admin
75
 
 
76
  EXPOSE 7860
77
 
 
78
  CMD ["/content/venv/bin/python", "app.py"]