roll-ai commited on
Commit
4feab7d
·
verified ·
1 Parent(s): 598cfa5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -14
Dockerfile CHANGED
@@ -1,5 +1,9 @@
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
 
 
 
 
3
  # Install OS-level dependencies
4
  RUN apt-get update && apt-get install -y \
5
  git ffmpeg curl \
@@ -11,28 +15,41 @@ RUN apt-get update && apt-get install -y \
11
  WORKDIR /app
12
  COPY . /app
13
 
14
- # Create directory for weights
15
  RUN mkdir -p /weights/FVSM /weights/OMSM /weights/output /weights/assets/manual_poses
16
 
17
- # Download FVSM model weights
18
- RUN curl -L -o /weights/FVSM/FloVD_FVSM_Controlnet.pt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/FloVD_FVSM_Controlnet.pt
 
 
 
19
 
20
- # Clone OMSM weights from Hugging Face
21
- RUN git clone https://huggingface.co/datasets/mutqa/FloVD-HF-OMSM /weights/OMSM
 
 
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  # Download example camera pose
 
24
  RUN curl -L -o /weights/assets/manual_poses/example.txt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/example.txt
25
 
26
- # Ensure permissions
27
- RUN chmod -R 777 /app
28
-
29
- # Install Python dependencies
30
- RUN pip install --upgrade pip
31
- RUN pip install av # workaround for some ffmpeg+av issues
32
- RUN pip install -r requirements.txt
33
- RUN pip install --no-binary :all: av # optional re-install to ensure compatibility
34
 
35
  EXPOSE 7860
36
 
37
- # Run app
38
  CMD ["python", "app.py"]
 
1
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
2
 
3
+ # Set ARG and ENV for HF token (used in snapshot_download)
4
+ ARG HF_TOKEN
5
+ ENV HF_TOKEN=${HF_TOKEN}
6
+
7
  # Install OS-level dependencies
8
  RUN apt-get update && apt-get install -y \
9
  git ffmpeg curl \
 
15
  WORKDIR /app
16
  COPY . /app
17
 
18
+ # Create weights directory
19
  RUN mkdir -p /weights/FVSM /weights/OMSM /weights/output /weights/assets/manual_poses
20
 
21
+ # Install required Python packages
22
+ RUN pip install --upgrade pip
23
+ RUN pip install av huggingface_hub
24
+ RUN pip install -r requirements.txt
25
+ RUN pip install --no-binary :all: av # optional av re-install
26
 
27
+ # --------------------------
28
+ # Download FloVD FVSM model
29
+ # --------------------------
30
+ RUN curl -L -o /weights/FVSM/FloVD_FVSM_Controlnet.pt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/FloVD_FVSM_Controlnet.pt
31
 
32
+ # --------------------------
33
+ # Download OMSM weights using huggingface_hub (requires HF_TOKEN)
34
+ # --------------------------
35
+ RUN python3 -c "\
36
+ from huggingface_hub import snapshot_download; \
37
+ snapshot_download(\
38
+ repo_id='mutqa/FloVD-HF-OMSM', \
39
+ repo_type='dataset', \
40
+ local_dir='/weights/OMSM', \
41
+ token='${HF_TOKEN}'\
42
+ )"
43
+
44
+ # --------------------------
45
  # Download example camera pose
46
+ # --------------------------
47
  RUN curl -L -o /weights/assets/manual_poses/example.txt https://huggingface.co/datasets/mutqa/FloVD-HF-Assets/resolve/main/example.txt
48
 
49
+ # Set permissions
50
+ RUN chmod -R 777 /weights /app
 
 
 
 
 
 
51
 
52
  EXPOSE 7860
53
 
54
+ # Start the app
55
  CMD ["python", "app.py"]