From b8cb704b5973830ef58c6f0b8fd97aaa9d0af0c8 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 27 Aug 2025 01:58:04 +0300 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=F0=9F=90=9E=20update=20README=20for?= =?UTF-8?q?=20correct=20model=20parameter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: ✨ add mask annotator for yoloe-seg models deps: 📦 update requirements.txt file for newer version packages Signed-off-by: Onuralp SEZER --- demos/spot_the_object_demo/README.md | 2 +- demos/spot_the_object_demo/main.py | 5 +++-- demos/spot_the_object_demo/requirements.txt | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demos/spot_the_object_demo/README.md b/demos/spot_the_object_demo/README.md index 33c91931..77a0c90d 100644 --- a/demos/spot_the_object_demo/README.md +++ b/demos/spot_the_object_demo/README.md @@ -128,7 +128,7 @@ python main.py --stream 0 --class_name hazelnut --aux_classes nut "brown ball" By default, the YOLOE-11M model is used. To change this, select another model from the family: ```shell -python main.py --stream 0 --model_name yoloe-11s-seg +python main.py --stream 0 --detection_model yoloe-11s-seg ``` To change the inference device use the `--device` option. By default, AUTO is used. diff --git a/demos/spot_the_object_demo/main.py b/demos/spot_the_object_demo/main.py index aeb4c7bc..eb59d29f 100644 --- a/demos/spot_the_object_demo/main.py +++ b/demos/spot_the_object_demo/main.py @@ -7,7 +7,7 @@ import cv2 import numpy as np -from supervision import BoxCornerAnnotator, LabelAnnotator, TraceAnnotator, LineZoneAnnotator, LineZone, ByteTrack, \ +from supervision import BoxCornerAnnotator, MaskAnnotator, LabelAnnotator, TraceAnnotator, LineZoneAnnotator, LineZone, ByteTrack, \ Point, Detections, Color, ColorLookup, DetectionsSmoother from supervision.annotators.base import BaseAnnotator from ultralytics import YOLOE, YOLO, YOLOWorld @@ -56,11 +56,12 @@ def load_annotators(size: tuple[int, int]) -> tuple[list[BaseAnnotator], LineZon trace_annotator = TraceAnnotator(thickness=box_annotator.thickness, color_lookup=ColorLookup.TRACK) line_zone_annotator = LineZoneAnnotator(thickness=box_annotator.thickness, color=Color.RED, text_scale=label_annotator.text_scale, display_in_count=False, custom_out_text="Count") + mask_annotator = MaskAnnotator(color_lookup=ColorLookup.TRACK) tracker = ByteTrack() smoother = DetectionsSmoother(length=3) - return [box_annotator, label_annotator, trace_annotator, line_zone_annotator], line_zone, tracker, smoother + return [box_annotator, label_annotator, trace_annotator, line_zone_annotator, mask_annotator], line_zone, tracker, smoother def add_box_margin(box: tuple[int], frame_size: tuple[int], margin_ratio: float = 0.15) -> tuple[int]: diff --git a/demos/spot_the_object_demo/requirements.txt b/demos/spot_the_object_demo/requirements.txt index 5c960d10..77d86c8f 100644 --- a/demos/spot_the_object_demo/requirements.txt +++ b/demos/spot_the_object_demo/requirements.txt @@ -2,9 +2,8 @@ openvino==2025.2 onnx==1.18.0 -ultralytics==8.3.161 -supervision==0.25.1 +ultralytics==8.3.186 +supervision==0.26.1 torch==2.8.0 opencv-python==4.10.0.84 -numpy==2.2.6 qrcode[pil]==8.2 From 4f5f94471d1a256da9894d6108e8698656dc2906 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 27 Aug 2025 02:03:46 +0300 Subject: [PATCH 2/2] chore: improve formatting in README --- demos/spot_the_object_demo/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/demos/spot_the_object_demo/README.md b/demos/spot_the_object_demo/README.md index 77a0c90d..65d7abb0 100644 --- a/demos/spot_the_object_demo/README.md +++ b/demos/spot_the_object_demo/README.md @@ -9,24 +9,32 @@ The demo detects, tracks and counts defined objects in front of the webcam. The If you want a **quick setup** without manually installing dependencies, use the provided installer scripts. These scripts will **automatically configure** everything needed to run the Spot the Object Demo. ### **For Windows** + 1. Download the `install.bat` and `run.bat` files to your local directory. 2. Double-click `install.bat` to install dependencies and set up the environment. 3. After installation, double-click `run.bat` to start the demo. ### **For Linux and MacOS** + 1. Download the `install.sh` and `run.sh` files to your local directory. 2. First, ensure the installer scripts have execute permissions: + ```shell chmod +x install.sh run.sh ``` + 3. Run the installer to set up everything: + ```shell ./install.sh ``` + 4. After installation, start the demo by running: + ```shell ./run.sh ``` + These scripts will handle cloning the repository, creating the virtual environment, and installing dependencies automatically. If you prefer a manual setup, follow Steps 1-3 below. ## Manual Environment Setup