dashdoas commited on
Commit
95fe39f
·
verified ·
1 Parent(s): 44c42c8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -16
Dockerfile CHANGED
@@ -1,42 +1,41 @@
1
  FROM python:3.10-slim
2
 
3
- # Install system tools needed for the build
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
- # STEP 1 FROM GITHUB: Clone with recursive submodules
11
- # We use '.' at the end to force it into the current folder (/app)
12
- RUN git clone https://github.com/Seed3D/Puppeteer.git . --recursive
 
 
13
 
14
- # STEP 2 FROM GITHUB: Install Torch
15
- # (Note: We use the 'cpu' link because HF Free Tier has no GPU,
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
- # STEP 3 FROM GITHUB: Install requirements
 
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
- # --- MANDATORY FIXES FOR CLOUD DEPLOYMENT ---
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
- # Patch the code to run on CPU (sed replaces .cuda() with .to("cpu"))
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 your UI handler
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"]