Spaces:
Sleeping
Sleeping
IZERE HIRWA Roger
commited on
Commit
·
95c88d4
1
Parent(s):
34e1a4d
- Dockerfile +16 -10
- app.py +1 -0
Dockerfile
CHANGED
@@ -8,6 +8,15 @@ RUN apt-get update && \
|
|
8 |
wget \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Create checkpoints directory
|
12 |
RUN mkdir -p /app/SadTalker/checkpoints
|
13 |
|
@@ -18,18 +27,15 @@ RUN wget -P /app/SadTalker/checkpoints \
|
|
18 |
https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/epoch_20.pth \
|
19 |
https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/facevid2vid_00189-model.pth.tar
|
20 |
|
21 |
-
#
|
22 |
-
RUN
|
23 |
-
|
24 |
-
WORKDIR /app
|
25 |
|
26 |
-
#
|
27 |
-
COPY
|
28 |
-
RUN pip install --no-cache-dir -r requirements.txt && \
|
29 |
-
pip install /app/SadTalker
|
30 |
|
31 |
-
#
|
32 |
-
|
|
|
33 |
|
34 |
# Force CPU mode
|
35 |
ENV SADTALKER_FORCE_CPU=1
|
|
|
8 |
wget \
|
9 |
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
+
WORKDIR /app
|
12 |
+
|
13 |
+
# Install Python dependencies first
|
14 |
+
COPY requirements.txt .
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
+
|
17 |
+
# Clone SadTalker
|
18 |
+
RUN git clone https://github.com/OpenTalker/SadTalker.git /app/SadTalker
|
19 |
+
|
20 |
# Create checkpoints directory
|
21 |
RUN mkdir -p /app/SadTalker/checkpoints
|
22 |
|
|
|
27 |
https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/epoch_20.pth \
|
28 |
https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/facevid2vid_00189-model.pth.tar
|
29 |
|
30 |
+
# Install SadTalker
|
31 |
+
RUN pip install /app/SadTalker
|
|
|
|
|
32 |
|
33 |
+
# Copy application files
|
34 |
+
COPY . .
|
|
|
|
|
35 |
|
36 |
+
# Create necessary directories
|
37 |
+
RUN mkdir -p /app/static/uploads && chmod -R 777 /app/static/uploads
|
38 |
+
RUN mkdir -p /app/templates && chmod -R 777 /app/templates
|
39 |
|
40 |
# Force CPU mode
|
41 |
ENV SADTALKER_FORCE_CPU=1
|
app.py
CHANGED
@@ -33,6 +33,7 @@ def generate():
|
|
33 |
# Text-to-Speech (using gTTS)
|
34 |
from gtts import gTTS
|
35 |
tts = gTTS(text=text, lang='en')
|
|
|
36 |
tts.save(audio_path)
|
37 |
|
38 |
# Generate video (CPU optimized)
|
|
|
33 |
# Text-to-Speech (using gTTS)
|
34 |
from gtts import gTTS
|
35 |
tts = gTTS(text=text, lang='en')
|
36 |
+
|
37 |
tts.save(audio_path)
|
38 |
|
39 |
# Generate video (CPU optimized)
|