Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions demos/spot_the_object_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions demos/spot_the_object_demo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]:
Expand Down
5 changes: 2 additions & 3 deletions demos/spot_the_object_demo/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading