-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add count in zone guide to supervision docs
#549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Hi @capjamesg 👋🏻 Could you make the changes listed below?
|
|
I have responded to your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new documentation guide that demonstrates how to count objects within defined zones using supervision's PolygonZone functionality. The guide walks through counting cars in a traffic video using YOLOv8 and supervision's zone detection features.
- Adds a new "Count in Zone" entry to the documentation navigation
- Creates a comprehensive tutorial with code examples for zone-based object counting
- Includes practical examples using video processing and the PolygonZone web utility
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| mkdocs.yml | Adds "Count in Zone" guide to the navigation menu under the how-to section |
| docs/how_to/count_in_zone.md | New tutorial guide demonstrating zone-based object counting with code examples and video demonstrations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| color=colors.by_idx(index), | ||
| thickness=4, | ||
| text_thickness=4, | ||
| text_scale=2 |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comma after text_scale parameter. This will cause a syntax error.
|
|
||
| [View the notebook that accompanies this tutorial](https://github.com/roboflow/notebooks/blob/main/notebooks/how-to-use-polygonzone-annotate-and-supervision.ipynb). | ||
|
|
||
| To make it easier for you to follow our tutorial download the video we will use as an example. You can do this using supervision[assets] extension. |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text refers to "supervision[assets] extension" but this appears to be a package extra/dependency specification that should be formatted differently. Consider revising to clarify that users need to install supervision with the assets extra, or if it's included by default, simply remove the bracketed notation and refer to it as "supervision's asset downloading functionality" or similar.
| To make it easier for you to follow our tutorial download the video we will use as an example. You can do this using supervision[assets] extension. | |
| To make it easier for you to follow our tutorial download the video we will use as an example. You can do this using the `supervision.assets` module: |
|
|
||
| model = YOLO('yolov8s.pt') | ||
|
|
||
| VIDEO = "video.mp4" |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable VIDEO is set to "video.mp4" but earlier in the guide (line 10) the downloaded asset is VideoAssets.VEHICLES_2. There's a disconnect between the downloaded asset and the VIDEO variable assignment. Either update the VIDEO variable to use the actual path of the downloaded asset, or provide guidance on how users should reference the downloaded video file.
| VIDEO = "video.mp4" | |
| VIDEO = str(VideoAssets.VEHICLES_2) |
Description
This PR adds a guide on how to count objects in a zone using the
PolygonZonefunction in supervision.Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
This change was tested by opening the new docs page to make sure all content rendered properly.
Any specific deployment considerations
N/A
Docs
See above.