Spaces:
Sleeping
Sleeping
| # Use 3.10 for 3D lib compatibility | |
| FROM python:3.10-slim | |
| # 1. Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| git \ | |
| git-lfs \ | |
| ffmpeg \ | |
| libsm6 \ | |
| libxext6 \ | |
| cmake \ | |
| rsync \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| curl \ | |
| && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | |
| && apt-get install -y nodejs \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && git lfs install | |
| # 2. Setup folder structure (Matches the exact error log paths) | |
| RUN mkdir -p /app/results /app/temp_input /app/skeleton /app/skinning \ | |
| /app/third_partys/Michelangelo/checkpoints/aligned_shape_latents/ | |
| # 3. DOWNLOAD MISSING WEIGHTS | |
| RUN curl -L -o /app/third_partys/Michelangelo/checkpoints/aligned_shape_latents/shapevae-256.ckpt \ | |
| https://huggingface.co/ZixiangZ/Michelangelo/resolve/main/aligned_shape_latents/shapevae-256.ckpt | |
| WORKDIR /app | |
| # 4. PATH FIXES | |
| # We add /app/skeleton to the path so that 'third_partys' is discoverable | |
| # even if the script is running from inside 'skinning' | |
| ENV PYTHONPATH="${PYTHONPATH}:/app:/app/skeleton:/app/skinning" | |
| ENV CUDA_VISIBLE_DEVICES="" | |
| # 5. Upgrade pip and install heavy libs | |
| RUN pip install --no-cache-dir pip -U | |
| RUN pip install --no-cache-dir tetgen mesh2sdf | |
| # 6. Install requirements | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt \ | |
| gradio[oauth]==5.23.1 \ | |
| uvicorn>=0.14.0 \ | |
| websockets>=10.4 \ | |
| spaces | |
| # 7. Copy files and set permissions | |
| COPY . . | |
| # Extra fix: Ensure the third_partys folder is where the code expects it | |
| RUN if [ -d "/app/skeleton/third_partys" ] && [ ! -d "/app/third_partys" ]; then ln -s /app/skeleton/third_partys /app/third_partys; fi | |
| RUN chmod +x demo_rigging.sh | |
| CMD ["python", "app.py"] |