diff --git a/label_studio_ml/examples/segment_anything_model/Dockerfile b/label_studio_ml/examples/segment_anything_model/Dockerfile index e660289e..4185a8ba 100644 --- a/label_studio_ml/examples/segment_anything_model/Dockerfile +++ b/label_studio_ml/examples/segment_anything_model/Dockerfile @@ -1,4 +1,3 @@ -# syntax=docker/dockerfile:1 ARG PYTHON_VERSION=3.10 FROM python:${PYTHON_VERSION}-slim AS python-base @@ -34,8 +33,8 @@ RUN bash /app/download_models.sh COPY requirements-base.txt . RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked \ pip install --upgrade pip && \ - pip install -r requirements-base.txt - + pip install gunicorn==22.0.0 pillow==10.3.0 && \ + pip install --no-deps "label-studio-ml @ git+https://github.com/HumanSignal/label-studio-ml-backend.git" # install custom requirements COPY requirements.txt . RUN --mount=type=cache,target=${PIP_CACHE_DIR},sharing=locked \ diff --git a/label_studio_ml/examples/segment_anything_model/data/server/models/cache.db b/label_studio_ml/examples/segment_anything_model/data/server/models/cache.db new file mode 100644 index 00000000..cdef091c Binary files /dev/null and b/label_studio_ml/examples/segment_anything_model/data/server/models/cache.db differ diff --git a/label_studio_ml/examples/segment_anything_model/docker-compose.yml b/label_studio_ml/examples/segment_anything_model/docker-compose.yml index d5f5aecb..970e2804 100644 --- a/label_studio_ml/examples/segment_anything_model/docker-compose.yml +++ b/label_studio_ml/examples/segment_anything_model/docker-compose.yml @@ -17,16 +17,16 @@ services: reservations: memory: 4G # Add this to pass through 1 GPU -# devices: -# - driver: nvidia -# count: 1 -# capabilities: [gpu] + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] environment: # specify these parameters if you want to use basic auth for the model server - BASIC_AUTH_USER= - BASIC_AUTH_PASS= # Change this to your model name: MobileSAM or SAM - - SAM_CHOICE=MobileSAM + - SAM_CHOICE=SAM - LOG_LEVEL=DEBUG # Enable this to use the GPU # - NVIDIA_VISIBLE_DEVICES=all @@ -41,8 +41,8 @@ services: # Do not use 'localhost' as it does not work within Docker containers. # Use prefix 'http://' or 'https://' for the URL always. # Determine the actual IP using 'ifconfig' (Linux/Mac) or 'ipconfig' (Windows). - - LABEL_STUDIO_HOST= - - LABEL_STUDIO_ACCESS_TOKEN= + - LABEL_STUDIO_HOST=http://192.168.110.208:8080 + - LABEL_STUDIO_ACCESS_TOKEN=9c65451a1335c0977d62978df63b6d42c5c5f86c ports: - 9090:9090 diff --git a/label_studio_ml/examples/segment_anything_model/requirements-base.txt b/label_studio_ml/examples/segment_anything_model/requirements-base.txt index 68ce357c..3bdc66fa 100644 --- a/label_studio_ml/examples/segment_anything_model/requirements-base.txt +++ b/label_studio_ml/examples/segment_anything_model/requirements-base.txt @@ -1,2 +1,5 @@ gunicorn==22.0.0 -label-studio-ml @ git+https://github.com/HumanSignal/label-studio-ml-backend.git \ No newline at end of file +# 安装时禁用依赖解析,防止自动装 pillow 和 label-studio-sdk +label-studio-ml @ git+https://github.com/HumanSignal/label-studio-ml-backend.git +pillow==10.3.0 +flask>=2.3,<3.2 diff --git a/label_studio_ml/examples/segment_anything_model/requirements.txt b/label_studio_ml/examples/segment_anything_model/requirements.txt index 84129332..aa8bdd0c 100644 --- a/label_studio_ml/examples/segment_anything_model/requirements.txt +++ b/label_studio_ml/examples/segment_anything_model/requirements.txt @@ -7,9 +7,14 @@ torchvision==0.15.2 gunicorn==22.0.0 rq==1.10.1 timm==0.4.12 +flask>=2.3,<3.2 +pydantic segment_anything @ git+https://github.com/facebookresearch/segment-anything.git mobile-sam @ git+https://github.com/ChaoningZhang/MobileSAM.git -label-studio-ml @ git+https://github.com/heartexlabs/label-studio-ml-backend.git numpy<2 + +label-studio-sdk @ git+https://github.com/HumanSignal/label-studio-sdk.git +colorama +semver