Skip to content

Commit fca2266

Browse files
committed
fix segment anything model
1 parent 7820e34 commit fca2266

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

label_studio_ml/examples/segment_anything_model/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@ RUN --mount=type=cache,target="/var/cache/apt",sharing=locked \
2323
apt-get update; \
2424
apt-get upgrade -y; \
2525
apt install --no-install-recommends -y \
26-
wget git libopencv-dev python3-opencv cmake protobuf-compiler; \
26+
wget git libopencv-dev cmake protobuf-compiler; \
2727
apt-get autoremove -y
2828

2929
# Copy and run the model download script
3030
COPY download_models.sh .
3131
RUN bash /app/download_models.sh
3232

33+
# Install numpy first to avoid conflicts with system numpy
34+
RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked \
35+
pip install --upgrade pip && \
36+
pip install "numpy>=2,<2.3.0"
37+
3338
# install base requirements
3439
COPY requirements-base.txt .
3540
RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked \
36-
pip install --upgrade pip && \
3741
pip install -r requirements-base.txt
3842

3943
# install custom requirements
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
numpy>=2,<2.3.0
12
label_studio_converter
2-
opencv-python
3+
opencv-python-headless>=4.12.0,<5.0.0
34
onnxruntime==1.15.1
4-
onnx
5+
onnx==1.12.0
56
torch==2.0.1
67
torchvision==0.15.2
78
gunicorn==22.0.0
@@ -11,5 +12,3 @@ timm==0.4.12
1112
segment_anything @ git+https://github.com/facebookresearch/segment-anything.git
1213
mobile-sam @ git+https://github.com/ChaoningZhang/MobileSAM.git
1314
label-studio-ml @ git+https://github.com/heartexlabs/label-studio-ml-backend.git
14-
15-
numpy<2

0 commit comments

Comments
 (0)