Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -16
Dockerfile
CHANGED
|
@@ -1,42 +1,41 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
# Install system
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential git git-lfs ffmpeg libsm6 libxext6 cmake libgl1 libglib2.0-0 curl \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
# but the version 2.1.1 is exactly what they asked for)
|
| 17 |
-
RUN pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cpu
|
| 18 |
|
| 19 |
-
#
|
|
|
|
| 20 |
RUN pip install -r requirements.txt
|
| 21 |
-
|
| 22 |
-
# STEP 4 FROM GITHUB: Install specific 3D dependencies
|
| 23 |
RUN pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.1+cpu.html
|
| 24 |
RUN pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cpu_pyt211/download.html
|
|
|
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
# These are the "missing pieces" that a local user would do manually
|
| 28 |
RUN mkdir -p third_partys/Michelangelo/checkpoints/aligned_shape_latents/ && \
|
| 29 |
curl -L -o third_partys/Michelangelo/checkpoints/aligned_shape_latents/shapevae-256.ckpt \
|
| 30 |
https://huggingface.co/ZixiangZ/Michelangelo/resolve/main/aligned_shape_latents/shapevae-256.ckpt
|
| 31 |
|
| 32 |
-
#
|
| 33 |
RUN find . -type f -name "*.py" -print0 | xargs -0 sed -i 's/\.cuda()/.to("cpu")/g'
|
|
|
|
| 34 |
RUN chmod +x demo_rigging.sh
|
| 35 |
|
| 36 |
-
# Environment Setup
|
| 37 |
ENV PYTHONPATH="${PYTHONPATH}:/app:/app/skeleton:/app/skinning"
|
| 38 |
ENV CUDA_VISIBLE_DEVICES=""
|
| 39 |
|
| 40 |
-
# Copy
|
| 41 |
COPY app.py .
|
| 42 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
build-essential git git-lfs ffmpeg libsm6 libxext6 cmake libgl1 libglib2.0-0 curl \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
+
# THE FIX: Clone to a temp folder, THEN move files to /app
|
| 11 |
+
RUN git clone --depth 1 --recursive https://github.com/Seed3D/Puppeteer.git /tmp/puppeteer \
|
| 12 |
+
&& cp -r /tmp/puppeteer/* /app/ \
|
| 13 |
+
&& cp -r /tmp/puppeteer/.[!.]* /app/ \
|
| 14 |
+
&& rm -rf /tmp/puppeteer
|
| 15 |
|
| 16 |
+
# Verify the file is actually there now
|
| 17 |
+
RUN if [ ! -f "demo_rigging.sh" ]; then echo "CRITICAL: demo_rigging.sh still missing!" && exit 1; fi
|
|
|
|
|
|
|
| 18 |
|
| 19 |
+
# Official Steps (CPU Optimized)
|
| 20 |
+
RUN pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cpu
|
| 21 |
RUN pip install -r requirements.txt
|
|
|
|
|
|
|
| 22 |
RUN pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.1+cpu.html
|
| 23 |
RUN pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cpu_pyt211/download.html
|
| 24 |
+
RUN pip install gradio==5.23.1 tetgen mesh2sdf
|
| 25 |
|
| 26 |
+
# Weights (Missing from GitHub)
|
|
|
|
| 27 |
RUN mkdir -p third_partys/Michelangelo/checkpoints/aligned_shape_latents/ && \
|
| 28 |
curl -L -o third_partys/Michelangelo/checkpoints/aligned_shape_latents/shapevae-256.ckpt \
|
| 29 |
https://huggingface.co/ZixiangZ/Michelangelo/resolve/main/aligned_shape_latents/shapevae-256.ckpt
|
| 30 |
|
| 31 |
+
# CPU Patch
|
| 32 |
RUN find . -type f -name "*.py" -print0 | xargs -0 sed -i 's/\.cuda()/.to("cpu")/g'
|
| 33 |
+
RUN find . -type f -name "*.py" -print0 | xargs -0 sed -i "s/'cuda'/ 'cpu'/g"
|
| 34 |
RUN chmod +x demo_rigging.sh
|
| 35 |
|
|
|
|
| 36 |
ENV PYTHONPATH="${PYTHONPATH}:/app:/app/skeleton:/app/skinning"
|
| 37 |
ENV CUDA_VISIBLE_DEVICES=""
|
| 38 |
|
| 39 |
+
# Copy YOUR app.py over the one from the repo
|
| 40 |
COPY app.py .
|
| 41 |
CMD ["python", "app.py"]
|