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 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