From 28319859a564ed51c82405bbd76c5365a8383055 Mon Sep 17 00:00:00 2001 From: zhursvlevy Date: Thu, 7 Mar 2024 20:57:25 +0300 Subject: [PATCH] add yolo-world pre-annotator example --- label_studio_ml/examples/yolo_world/.env.dev | 15 ++ .../examples/yolo_world/Dockerfile | 15 ++ label_studio_ml/examples/yolo_world/README.md | 27 ++++ label_studio_ml/examples/yolo_world/_wsgi.py | 114 ++++++++++++++ .../yolo_world/assets/yolo-world-example.gif | Bin 0 -> 2265616 bytes .../examples/yolo_world/docker-compose.yml | 16 ++ .../examples/yolo_world/requirements.txt | 13 ++ .../examples/yolo_world/yolo_world.py | 143 ++++++++++++++++++ 8 files changed, 343 insertions(+) create mode 100644 label_studio_ml/examples/yolo_world/.env.dev create mode 100644 label_studio_ml/examples/yolo_world/Dockerfile create mode 100644 label_studio_ml/examples/yolo_world/README.md create mode 100644 label_studio_ml/examples/yolo_world/_wsgi.py create mode 100644 label_studio_ml/examples/yolo_world/assets/yolo-world-example.gif create mode 100644 label_studio_ml/examples/yolo_world/docker-compose.yml create mode 100644 label_studio_ml/examples/yolo_world/requirements.txt create mode 100644 label_studio_ml/examples/yolo_world/yolo_world.py diff --git a/label_studio_ml/examples/yolo_world/.env.dev b/label_studio_ml/examples/yolo_world/.env.dev new file mode 100644 index 000000000..657348cd1 --- /dev/null +++ b/label_studio_ml/examples/yolo_world/.env.dev @@ -0,0 +1,15 @@ +# yolo-world ultralytics configuration +CHECKPOINT="yolov8l-world.pt" +CONF_THRESHOLD=0.1 +IOU_THRESHOLD=0.3 + +# your label studio host and credentals +LABEL_STUDIO_HOST="host_name:port" +LABEL_STUDIO_ACCESS_TOKEN="token" + +# your s3 endpoint +AWS_ENDPOINT_URL="host_name:port" +AWS_ACCESS_KEY="your-access-key" +AWS_SECRET_ACCESS="your-secret-key" + + diff --git a/label_studio_ml/examples/yolo_world/Dockerfile b/label_studio_ml/examples/yolo_world/Dockerfile new file mode 100644 index 000000000..bca50e36a --- /dev/null +++ b/label_studio_ml/examples/yolo_world/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.11-slim + +WORKDIR /app + +RUN apt-get -y update \ + && apt-get install -y git \ + && apt-get install -y wget \ + && apt-get -y install ffmpeg libsm6 libxext6 libffi-dev python3-dev gcc + +# Install Base +COPY requirements.txt . +RUN pip install --upgrade pip +RUN pip install --no-cache-dir -r requirements.txt + +WORKDIR /app diff --git a/label_studio_ml/examples/yolo_world/README.md b/label_studio_ml/examples/yolo_world/README.md new file mode 100644 index 000000000..42f2d940b --- /dev/null +++ b/label_studio_ml/examples/yolo_world/README.md @@ -0,0 +1,27 @@ +# YOLO-WORLD +This is an example of running YOLO-World as a pre-annotator with prompts. The example shows how to make a backend in case if you are using s3 (minio) storage. +### Run pre-annotator +```bash + docker compose up -d +``` +Don't forget change default port on available one in docker-compose.yml. + +### Configure label studio prompt window in project_name/Settings/Labeling Interface: +```html + + + + +