MogensR commited on
Commit
0deca70
·
1 Parent(s): f03fb20
Files changed (1) hide show
  1. Dockerfile +13 -4
Dockerfile CHANGED
@@ -44,7 +44,7 @@ RUN python3 -m pip install --no-cache-dir --index-url https://download.pytorch.o
44
  COPY --chown=user requirements.txt ./requirements.txt
45
  RUN python3 -m pip install --no-cache-dir -r requirements.txt
46
  # Optional (recommended) nicer fallback segmentation:
47
- # RUN python3 -m pip install --no-cache-dir mediapipe==0.10.14
48
 
49
  # --- Clone external repos (SAM2 & MatAnyone) ---
50
  RUN mkdir -p third_party
@@ -52,11 +52,19 @@ RUN mkdir -p third_party
52
  RUN git clone https://github.com/facebookresearch/segment-anything-2.git third_party/sam2 && \
53
  cd third_party/sam2 && \
54
  if [ "${SAM2_SHA}" != "__PIN_ME__" ]; then git checkout "${SAM2_SHA}"; fi
 
 
 
 
55
  # MatAnyone (pq-yang fork as per your previous setup)
56
  RUN git clone https://github.com/pq-yang/MatAnyone.git third_party/matanyone && \
57
  cd third_party/matanyone && \
58
  if [ "${MATANYONE_SHA}" != "__PIN_ME__" ]; then git checkout "${MATANYONE_SHA}"; fi
59
 
 
 
 
 
60
  # --- App code ---
61
  COPY --chown=user . /home/user/app
62
 
@@ -76,14 +84,15 @@ ENV PYTHONUNBUFFERED=1 \
76
  THIRD_PARTY_SAM2_DIR=/home/user/app/third_party/sam2 \
77
  THIRD_PARTY_MATANY_DIR=/home/user/app/third_party/matanyone \
78
  \
79
- # --- SAM2 dynamic config (used by pipeline.py) ---
80
  SAM2_MODEL_CFG="configs/sam2/sam2_hiera_l.yaml" \
81
  SAM2_CHECKPOINT="" \
82
  \
83
  # --- MatAnyone dynamic config (used by pipeline.py) ---
84
  MATANY_REPO_ID=PeiqingYang/MatAnyone \
85
- MATANY_CHECKPOINT=""
 
86
 
87
  # --- Networking / Entrypoint ---
88
  EXPOSE 7860
89
- CMD ["python3", "app.py"]
 
44
  COPY --chown=user requirements.txt ./requirements.txt
45
  RUN python3 -m pip install --no-cache-dir -r requirements.txt
46
  # Optional (recommended) nicer fallback segmentation:
47
+ RUN python3 -m pip install --no-cache-dir mediapipe==0.10.14
48
 
49
  # --- Clone external repos (SAM2 & MatAnyone) ---
50
  RUN mkdir -p third_party
 
52
  RUN git clone https://github.com/facebookresearch/segment-anything-2.git third_party/sam2 && \
53
  cd third_party/sam2 && \
54
  if [ "${SAM2_SHA}" != "__PIN_ME__" ]; then git checkout "${SAM2_SHA}"; fi
55
+
56
+ # Install SAM2 requirements
57
+ RUN cd third_party/sam2 && python3 -m pip install --no-cache-dir -e .
58
+
59
  # MatAnyone (pq-yang fork as per your previous setup)
60
  RUN git clone https://github.com/pq-yang/MatAnyone.git third_party/matanyone && \
61
  cd third_party/matanyone && \
62
  if [ "${MATANYONE_SHA}" != "__PIN_ME__" ]; then git checkout "${MATANYONE_SHA}"; fi
63
 
64
+ # Install MatAnyone requirements if they exist
65
+ RUN cd third_party/matanyone && \
66
+ if [ -f requirements.txt ]; then python3 -m pip install --no-cache-dir -r requirements.txt; fi
67
+
68
  # --- App code ---
69
  COPY --chown=user . /home/user/app
70
 
 
84
  THIRD_PARTY_SAM2_DIR=/home/user/app/third_party/sam2 \
85
  THIRD_PARTY_MATANY_DIR=/home/user/app/third_party/matanyone \
86
  \
87
+ # --- SAM2 dynamic config (FIXED: relative path within SAM2 repo) ---
88
  SAM2_MODEL_CFG="configs/sam2/sam2_hiera_l.yaml" \
89
  SAM2_CHECKPOINT="" \
90
  \
91
  # --- MatAnyone dynamic config (used by pipeline.py) ---
92
  MATANY_REPO_ID=PeiqingYang/MatAnyone \
93
+ MATANY_CHECKPOINT="" \
94
+ ENABLE_MATANY=1
95
 
96
  # --- Networking / Entrypoint ---
97
  EXPOSE 7860
98
+ CMD ["python3", "app.py"]