Spaces:
Paused
Paused
Update Dockerfile
Browse files- 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
|
15 |
RUN mkdir -p /weights/FVSM /weights/OMSM /weights/output /weights/assets/manual_poses
|
16 |
|
17 |
-
#
|
18 |
-
RUN
|
|
|
|
|
|
|
19 |
|
20 |
-
#
|
21 |
-
|
|
|
|
|
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 |
-
#
|
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 |
-
#
|
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"]
|