Nisha56 commited on
Commit
4edd459
·
1 Parent(s): 8665410

Fix SAM2 installation for Docker build

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -1
Dockerfile CHANGED
@@ -25,7 +25,16 @@ RUN pip install --no-cache-dir \
25
 
26
  # install all other dependencies
27
  COPY requirements.txt .
28
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
29
 
30
  # copy backend code
31
  COPY . .
 
25
 
26
  # install all other dependencies
27
  COPY requirements.txt .
28
+
29
+ # Install everything except SAM2
30
+ RUN grep -v "facebookresearch/sam2" requirements.txt > requirements_no_sam.txt && \
31
+ pip install --no-cache-dir -r requirements_no_sam.txt
32
+
33
+ # SAM2 officially requires torch>=2.5.1, but this project was
34
+ # developed and validated with torch==2.4.1. Install SAM2 without dependency resolution to preserve the tested environment
35
+
36
+ RUN pip install --no-cache-dir --no-deps \
37
+ git+https://github.com/facebookresearch/sam2.git@2b90b9f5ceec907a1c18123530e92e794ad901a4
38
 
39
  # copy backend code
40
  COPY . .