Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
refactor backend dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cainky committed Sep 23, 2023
1 parent e13f4bb commit 4e318bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
16 changes: 10 additions & 6 deletions backend/docker/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ RUN pip install gdown && \
pip install -r requirements.txt

# Download face detection model
RUN mkdir -p face_detection/detection/sfd && \
wget "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth" -O "face_detection/detection/sfd/s3fd.pth"
RUN if [ ! -f "face_detection/detection/sfd/s3fd.pth" ]; then \
mkdir -p face_detection/detection/sfd && \
wget "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth" -O "face_detection/detection/sfd/s3fd.pth"; \
fi

# Create directory for checkpoints
RUN mkdir -p checkpoints

# Copy the download models script and run it
COPY backend/docker/download_models.py .
RUN chmod +x download_models.py && \
python download_models.py
RUN if [ ! -f "checkpoints/wav2lip_gan.pth" ] || [ ! -f "checkpoints/face_segmentation.pth" ] || [ ! -f "checkpoints/esrgan_max.pth" ]; then \
# Copy the download models script and run it
COPY backend/docker/download_models.py . \
RUN chmod +x download_models.py && \
python download_models.py; \
fi

# Create directories for input and output videos
RUN mkdir -p videos results
Expand Down
3 changes: 2 additions & 1 deletion backend/wav2lip-hq/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
checkpoints/*.pth
temp/*
temp/*.avi
face_detection/detection/sfd/*.pth

0 comments on commit 4e318bf

Please sign in to comment.