dashdoas commited on
Commit
47873b7
·
verified ·
1 Parent(s): 2ee1ccf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -17
Dockerfile CHANGED
@@ -1,41 +1,42 @@
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"]
 
1
  FROM python:3.10-slim
2
 
3
+ # 1. 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
+ # 2. CREATE A FRESH WORKDIR (This avoids the "directory not empty" error)
9
+ WORKDIR /puppeteer_root
10
 
11
+ # 3. EXACT GITHUB INSTRUCTION: Clone with recursive submodules
12
+ # We clone into the current directory (.)
13
+ RUN git clone --recursive https://github.com/Seed3D/Puppeteer.git .
 
 
14
 
15
+ # 4. VERIFY: Fail the build immediately if the script isn't there
16
+ RUN if [ ! -f "demo_rigging.sh" ]; then echo "CLONE FAILED" && exit 1; fi
17
 
18
+ # 5. EXACT GITHUB INSTRUCTION: Install Torch & Requirements
19
  RUN pip install torch==2.1.1 torchvision==0.16.1 torchaudio==2.1.1 --index-url https://download.pytorch.org/whl/cpu
20
  RUN pip install -r requirements.txt
21
  RUN pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.1+cpu.html
22
  RUN pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py310_cpu_pyt211/download.html
23
  RUN pip install gradio==5.23.1 tetgen mesh2sdf
24
 
25
+ # 6. WEIGHTS: Download the missing brain file
26
  RUN mkdir -p third_partys/Michelangelo/checkpoints/aligned_shape_latents/ && \
27
  curl -L -o third_partys/Michelangelo/checkpoints/aligned_shape_latents/shapevae-256.ckpt \
28
  https://huggingface.co/ZixiangZ/Michelangelo/resolve/main/aligned_shape_latents/shapevae-256.ckpt
29
 
30
+ # 7. CPU PATCH: Change .cuda() to .to('cpu') in all files
31
+ RUN find . -type f -name "*.py" -exec sed -i 's/\.cuda()/.to("cpu")/g' {} +
32
+ RUN find . -type f -name "*.py" -exec sed -i "s/'cuda'/ 'cpu'/g" {} +
33
  RUN chmod +x demo_rigging.sh
34
 
35
+ # 8. ENVIRONMENT
36
+ ENV PYTHONPATH="/puppeteer_root:/puppeteer_root/skeleton:/puppeteer_root/skinning"
37
  ENV CUDA_VISIBLE_DEVICES=""
38
 
39
+ # 9. COPY YOUR APP.PY INTO THE NEW ROOT
40
+ COPY app.py /puppeteer_root/app.py
41
+
42
  CMD ["python", "app.py"]