Skip to content

Commit eaeb51a

Browse files
authored
Merge pull request #1655 from roboflow/develop
`supervision-0.25.0` release
2 parents 58e27f4 + 8d562c1 commit eaeb51a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5221
-1016
lines changed

.github/workflows/poetry-test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 🔧 Poetry Check and Installation Test Workflow
2+
on:
3+
push:
4+
paths:
5+
- 'poetry.lock'
6+
- 'pyproject.toml'
7+
pull_request:
8+
paths:
9+
- 'poetry.lock'
10+
- 'pyproject.toml'
11+
workflow_dispatch:
12+
13+
jobs:
14+
poetry-tests:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: 📥 Checkout the repository
23+
uses: actions/checkout@v4
24+
25+
- name: 🐍 Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: 📦 Install the base dependencies
31+
run: python -m pip install --upgrade poetry
32+
33+
- name: 🔍 Check the correctness of the project config
34+
run: poetry check
35+
36+
- name: 🚀 Do Install the package Test
37+
run: poetry install

.github/workflows/publish-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ name: Publish Supervision Pre-Releases to PyPI and TestPyPI
22
on:
33
push:
44
tags:
5-
- '[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]'
6-
- '[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]'
7-
- '[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]'
5+
- "[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]"
6+
- "[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]"
7+
- "[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]"
88

99
workflow_dispatch:
1010

1111
jobs:
1212
build-and-publish-pre-release-pypi:
1313
name: Build and publish to PyPI
1414
runs-on: ubuntu-latest
15+
environment: test
1516
permissions:
1617
id-token: write
1718
strategy:

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ name: Publish Supervision Releases to PyPI and TestPyPI
22
on:
33
push:
44
tags:
5-
- '[0-9]+.[0-9]+[0-9]+.[0-9]'
5+
- "[0-9]+.[0-9]+[0-9]+.[0-9]"
66

77
workflow_dispatch:
88

99
jobs:
1010
build-and-publish-pre-release:
1111
runs-on: ubuntu-latest
12+
environment: release
1213
permissions:
1314
id-token: write
1415
strategy:
@@ -24,7 +25,7 @@ jobs:
2425
with:
2526
python-version: ${{ matrix.python-version }}
2627

27-
- name: 🏗️ Build source and wheel distributions
28+
- name: 🏗️ Build source and wheel distributions
2829
run: |
2930
python -m pip install --upgrade build twine
3031
python -m build

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1313
steps:
1414
- name: 🛎️ Checkout
1515
uses: actions/checkout@v4

.github/workflows/welcome.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ci:
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.6.0
10+
rev: v5.0.0
1111
hooks:
1212
- id: trailing-whitespace
1313
exclude: test/.*\.py
@@ -32,7 +32,7 @@ repos:
3232
additional_dependencies: ["bandit[toml]"]
3333

3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: v0.6.8
35+
rev: v0.7.3
3636
hooks:
3737
- id: ruff
3838
args: [--fix, --exit-non-zero-on-fix]

README.md

Lines changed: 70 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
[![python-version](https://img.shields.io/pypi/pyversions/supervision)](https://badge.fury.io/py/supervision)
2222
[![colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb)
2323
[![gradio](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Roboflow/Annotators)
24-
[![discord](https://img.shields.io/discord/1159501506232451173)](https://discord.gg/GbfgXGJ8Bk)
24+
[![discord](https://img.shields.io/discord/1159501506232451173?logo=discord&label=discord&labelColor=fff&color=5865f2&link=https%3A%2F%2Fdiscord.gg%2FGbfgXGJ8Bk)](https://discord.gg/GbfgXGJ8Bk)
2525
[![built-with-material-for-mkdocs](https://img.shields.io/badge/Material_for_MkDocs-526CFE?logo=MaterialForMkDocs&logoColor=white)](https://squidfunk.github.io/mkdocs-material/)
2626

2727
<div align="center">
@@ -34,8 +34,6 @@
3434

3535
**We write your reusable computer vision tools.** Whether you need to load your dataset from your hard drive, draw detections on an image or video, or count how many detections are in a zone. You can count on us! 🤝
3636

37-
[![supervision-hackfest](https://media.roboflow.com/supervision/supervision-hacktoberfest-banner-2024.png)](https://github.com/roboflow/supervision/issues?q=is%3Aissue+is%3Aopen+label%3Ahacktoberfest)
38-
3937
## 💻 install
4038

4139
Pip install the supervision package in a
@@ -137,88 +135,88 @@ for path, image, annotation in ds:
137135

138136
- load
139137

140-
```python
141-
dataset = sv.DetectionDataset.from_yolo(
142-
images_directory_path=...,
143-
annotations_directory_path=...,
144-
data_yaml_path=...
145-
)
146-
147-
dataset = sv.DetectionDataset.from_pascal_voc(
148-
images_directory_path=...,
149-
annotations_directory_path=...
150-
)
151-
152-
dataset = sv.DetectionDataset.from_coco(
153-
images_directory_path=...,
154-
annotations_path=...
155-
)
156-
```
138+
```python
139+
dataset = sv.DetectionDataset.from_yolo(
140+
images_directory_path=...,
141+
annotations_directory_path=...,
142+
data_yaml_path=...
143+
)
144+
145+
dataset = sv.DetectionDataset.from_pascal_voc(
146+
images_directory_path=...,
147+
annotations_directory_path=...
148+
)
149+
150+
dataset = sv.DetectionDataset.from_coco(
151+
images_directory_path=...,
152+
annotations_path=...
153+
)
154+
```
157155

158156
- split
159157

160-
```python
161-
train_dataset, test_dataset = dataset.split(split_ratio=0.7)
162-
test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5)
158+
```python
159+
train_dataset, test_dataset = dataset.split(split_ratio=0.7)
160+
test_dataset, valid_dataset = test_dataset.split(split_ratio=0.5)
163161

164-
len(train_dataset), len(test_dataset), len(valid_dataset)
165-
# (700, 150, 150)
166-
```
162+
len(train_dataset), len(test_dataset), len(valid_dataset)
163+
# (700, 150, 150)
164+
```
167165

168166
- merge
169167

170-
```python
171-
ds_1 = sv.DetectionDataset(...)
172-
len(ds_1)
173-
# 100
174-
ds_1.classes
175-
# ['dog', 'person']
176-
177-
ds_2 = sv.DetectionDataset(...)
178-
len(ds_2)
179-
# 200
180-
ds_2.classes
181-
# ['cat']
182-
183-
ds_merged = sv.DetectionDataset.merge([ds_1, ds_2])
184-
len(ds_merged)
185-
# 300
186-
ds_merged.classes
187-
# ['cat', 'dog', 'person']
188-
```
168+
```python
169+
ds_1 = sv.DetectionDataset(...)
170+
len(ds_1)
171+
# 100
172+
ds_1.classes
173+
# ['dog', 'person']
174+
175+
ds_2 = sv.DetectionDataset(...)
176+
len(ds_2)
177+
# 200
178+
ds_2.classes
179+
# ['cat']
180+
181+
ds_merged = sv.DetectionDataset.merge([ds_1, ds_2])
182+
len(ds_merged)
183+
# 300
184+
ds_merged.classes
185+
# ['cat', 'dog', 'person']
186+
```
189187

190188
- save
191189

192-
```python
193-
dataset.as_yolo(
194-
images_directory_path=...,
195-
annotations_directory_path=...,
196-
data_yaml_path=...
197-
)
198-
199-
dataset.as_pascal_voc(
200-
images_directory_path=...,
201-
annotations_directory_path=...
202-
)
203-
204-
dataset.as_coco(
205-
images_directory_path=...,
206-
annotations_path=...
207-
)
208-
```
190+
```python
191+
dataset.as_yolo(
192+
images_directory_path=...,
193+
annotations_directory_path=...,
194+
data_yaml_path=...
195+
)
196+
197+
dataset.as_pascal_voc(
198+
images_directory_path=...,
199+
annotations_directory_path=...
200+
)
201+
202+
dataset.as_coco(
203+
images_directory_path=...,
204+
annotations_path=...
205+
)
206+
```
209207

210208
- convert
211209

212-
```python
213-
sv.DetectionDataset.from_yolo(
214-
images_directory_path=...,
215-
annotations_directory_path=...,
216-
data_yaml_path=...
217-
).as_pascal_voc(
218-
images_directory_path=...,
219-
annotations_directory_path=...
220-
)
221-
```
210+
```python
211+
sv.DetectionDataset.from_yolo(
212+
images_directory_path=...,
213+
annotations_directory_path=...,
214+
data_yaml_path=...
215+
).as_pascal_voc(
216+
images_directory_path=...,
217+
annotations_directory_path=...
218+
)
219+
```
222220

223221
</details>
224222

docs/assets.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
comments: true
3+
status: new
34
---
45

56
# Assets
@@ -13,6 +14,7 @@ To install the Supervision assets utility, you can use `pip`. This utility is av
1314
as an extra within the Supervision package.
1415

1516
!!! example "pip install"
17+
1618
```bash
1719
pip install "supervision[assets]"
1820
```

0 commit comments

Comments
 (0)