Spaces:
Running
Running
| FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # Set the MKL_THREADING_LAYER environment variable to GNU | |
| ENV MKL_THREADING_LAYER=GNU | |
| # Install system dependencies including those required for dlib | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| wget \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| ffmpeg \ | |
| libx264-dev \ | |
| build-essential \ | |
| cmake \ | |
| libopenblas-dev \ | |
| liblapack-dev \ | |
| libx11-dev \ | |
| libgtk-3-dev \ | |
| python3-dev | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PYTHONPATH=$HOME/app \ | |
| PYTHONUNBUFFERED=1 \ | |
| GRADIO_ALLOW_FLAGGING=never \ | |
| GRADIO_NUM_PORTS=1 \ | |
| GRADIO_SERVER_NAME=0.0.0.0 \ | |
| GRADIO_THEME=huggingface \ | |
| GRADIO_SHARE=False \ | |
| SYSTEM=spaces | |
| # Set the working directory to the user's home directory | |
| WORKDIR $HOME/app | |
| # Print detailed Python information | |
| RUN python -c "import sys; print(f'Python {sys.version}')" | |
| # Clone the repository | |
| RUN git clone -b dev https://github.com/fffiloni/dreamtalk $HOME/app | |
| # Download model checkpoints | |
| RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/denoising_network.pth -O $HOME/app/checkpoints/denoising_network.pth | |
| RUN wget https://huggingface.co/camenduru/dreamtalk/resolve/main/damo/dreamtalk/checkpoints/renderer.pt -O $HOME/app/checkpoints/renderer.pt | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir \ | |
| urllib3==1.26.6 \ | |
| transformers==4.28.1 \ | |
| yacs==0.1.8 \ | |
| scipy==1.10.1 \ | |
| scikit-image==0.20.0 \ | |
| scikit-learn==1.2.2 \ | |
| PyYAML==6.0 \ | |
| Pillow==9.5.0 \ | |
| numpy==1.24.2 \ | |
| opencv-python==4.7.0.72 \ | |
| imageio==2.27.0 \ | |
| ffmpeg-python \ | |
| av==11.0.0 \ | |
| moviepy==1.0.3 | |
| RUN pip install gradio | |
| # Install dlib with verbose output | |
| RUN pip install --verbose --no-cache-dir dlib-bin | |
| COPY app.py . | |
| # Set the environment variable to specify the GPU device | |
| ENV CUDA_DEVICE_ORDER=PCI_BUS_ID | |
| ENV CUDA_VISIBLE_DEVICES=0 | |
| # Run your app.py script | |
| CMD |