File size: 1,334 Bytes
a1320d8
 
 
 
 
 
 
 
 
 
95c88d4
 
 
 
 
 
 
 
 
a1320d8
 
 
 
 
 
 
 
 
 
95c88d4
 
a1320d8
9f2a24a
 
 
 
134c911
 
 
a1320d8
 
 
 
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
FROM python:3.9-slim

# Install system dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    ffmpeg \
    git \
    wget \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python dependencies first
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Clone SadTalker
RUN git clone https://github.com/OpenTalker/SadTalker.git /app/SadTalker

# Create checkpoints directory
RUN mkdir -p /app/SadTalker/checkpoints

# Download model weights (official SadTalker releases)
RUN wget -P /app/SadTalker/checkpoints \
    https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/auido2exp_00300-model.pth \
    https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/auido2pose_00140-model.pth \
    https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/epoch_20.pth \
    https://github.com/OpenTalker/SadTalker/releases/download/v0.0.2/facevid2vid_00189-model.pth.tar

# Copy application files
COPY . .

# Create necessary directories with proper permissions
RUN mkdir -p /app/static/uploads && chmod -R 777 /app/static
RUN mkdir -p /app/templates && chmod -R 777 /app/templates

# Add SadTalker to Python path
ENV PYTHONPATH="${PYTHONPATH}:/app/SadTalker/src"

# Force CPU mode
ENV SADTALKER_FORCE_CPU=1
EXPOSE 7860
CMD ["python", "app.py"]