forked from antgroup/ditto-talkinghead
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae7c9e7
commit e0b2fda
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Start from NVIDIA TensorRT base image | ||
FROM nvcr.io/nvidia/tensorrt:24.01-py3 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
git-lfs \ | ||
ffmpeg \ | ||
libsndfile1 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Python packages | ||
RUN pip install --no-cache-dir \ | ||
torch \ | ||
tensorrt==8.6.1 \ | ||
librosa \ | ||
tqdm \ | ||
filetype \ | ||
imageio \ | ||
opencv-python-headless \ | ||
scikit-image \ | ||
cython \ | ||
cuda-python \ | ||
imageio-ffmpeg \ | ||
colored \ | ||
polygraphy \ | ||
numpy==2.0.1 | ||
|
||
# Clone the repository | ||
RUN git clone https://github.com/antgroup/ditto-talkinghead . | ||
|
||
# Download model checkpoints | ||
RUN git lfs install && \ | ||
git clone https://huggingface.co/digital-avatar/ditto-talkinghead checkpoints | ||
|
||
# Build Cython extensions | ||
RUN cd core/utils/blend && \ | ||
python -m cython blend.pyx && \ | ||
gcc -shared -pthread -fPIC -fwrapv -O2 -Wall -fno-strict-aliasing \ | ||
-I/usr/include/python3.10 \ | ||
-o blend_impl.so blend_impl.c | ||
|
||
# Set environment variables | ||
ENV PYTHONPATH=/app:$PYTHONPATH | ||
|
||
# Command to run inference (can be overridden) | ||
CMD ["python", "inference.py", \ | ||
"--data_root", "./checkpoints/ditto_trt_Ampere_Plus", \ | ||
"--cfg_pkl", "./checkpoints/ditto_cfg/v0.4_hubert_cfg_trt.pkl", \ | ||
"--audio_path", "./example/audio.wav", \ | ||
"--source_path", "./example/image.png", \ | ||
"--output_path", "./output/result.mp4"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters