Skip to content

Commit 9cff624

Browse files
authored
Merge pull request #136 from roboflow/0.10.0-release
`0.10.0` release
2 parents 282aa2c + 584c4fe commit 9cff624

File tree

6 files changed

+46
-41
lines changed

6 files changed

+46
-41
lines changed

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cff-version: 1.2.0
22
author: Roboflow
33
message: If you use this software, please cite it as below.
44
title: supervision
5-
version: 0.9.0
5+
version: 0.10.0
66
date-released: 2023-01-19
77
license: MIT
88
repository-code: https://github.com/roboflow/supervision

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,22 @@ pip install -e ".[dev]"
186186
... annotations_directory_path='...'
187187
... )
188188
```
189+
190+
- Load classification datasets in one of supported formats
191+
192+
```python
193+
>>> cs = sv.ClassificationDataset.from_folder_structure(
194+
... root_directory_path='...'
195+
... )
196+
```
197+
198+
- Save classification datasets in one of supported formats
199+
200+
```python
201+
>>> cs.as_folder_structure(
202+
... root_directory_path='...'
203+
... )
204+
```
189205

190206
</details>
191207

docs/changelog.md

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,47 @@
1-
### 0.9.0 <small>June 7, 2023</small>
1+
### 0.10.0 <small>June 14, 2023</small>
22

3-
- Added [[#118](https://github.com/roboflow/supervision/pull/118)]: ability to select [`sv.Detections`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.__getitem__) by index, list of indexes or slice. Here is an example illustrating the new selection methods.
3+
- Added [[#125](https://github.com/roboflow/supervision/pull/125)]: ability to load and save [`sv.ClassificationDataset`](https://roboflow.github.io/supervision/dataset/core/#classificationdataset) in a folder structure format.
44

55
```python
66
>>> import supervision as sv
77

8-
>>> detections = sv.Detections(...)
9-
>>> len(detections[0])
10-
1
11-
>>> len(detections[[0, 1]])
12-
2
13-
>>> len(detections[0:2])
14-
2
8+
>>> cs = sv.ClassificationDataset.from_folder_structure(
9+
... root_directory_path='...'
10+
... )
11+
12+
>>> cs.as_folder_structure(
13+
... root_directory_path='...'
14+
... )
1515
```
1616

17-
- Added [[#101](https://github.com/roboflow/supervision/pull/101)]: ability to extract masks from YOLOv8 result using [`sv.Detections.from_yolov8`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_yolov8). Here is an example illustrating how to extract boolean masks from the result of the YOLOv8 model inference.
17+
- Added [[#125](https://github.com/roboflow/supervision/pull/125)]: support for [`sv.ClassificationDataset.split`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.ClassificationDataset.split) allowing to divide `sv.ClassificationDataset` into two parts.
1818

19-
```python
20-
>>> import cv2
21-
>>> from ultralytics import YOLO
22-
>>> import supervision as sv
19+
- Added [[#110](https://github.com/roboflow/supervision/pull/110)]: ability to extract masks from Roboflow API results using [`sv.Detections.from_roboflow`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_roboflow).
2320

24-
>>> image = cv2.imread(...)
25-
>>> image.shape
26-
(640, 640, 3)
21+
- Added [[commit hash](https://github.com/roboflow/supervision/commit/d000292eb2f2342544e0947b65528082e60fb8d6)]: Supervision Quickstart [notebook](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb) where you can learn more about Detection, Dataset and Video APIs.
2722

28-
>>> model = YOLO('yolov8s-seg.pt')
29-
>>> result = model(image)[0]
30-
>>> detections = sv.Detections.from_yolov8(result)
31-
>>> detections.mask.shape
32-
(2, 640, 640)
33-
```
23+
- Changed [[#135](https://github.com/roboflow/supervision/pull/135)]: `sv.get_video_frames_generator` documentation to better describe actual behavior.
3424

35-
- Added [[#122](https://github.com/roboflow/supervision/pull/122)]: ability to crop image using [`sv.crop`](https://roboflow.github.io/supervision/utils/image/#crop). Here is an example showing how to get a separate crop for each detection in `sv.Detections`.
25+
### 0.9.0 <small>June 7, 2023</small>
26+
27+
- Added [[#118](https://github.com/roboflow/supervision/pull/118)]: ability to select [`sv.Detections`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.__getitem__) by index, list of indexes or slice. Here is an example illustrating the new selection methods.
3628

3729
```python
38-
>>> import cv2
3930
>>> import supervision as sv
4031

41-
>>> image = cv2.imread(...)
4232
>>> detections = sv.Detections(...)
43-
>>> len(detections)
33+
>>> len(detections[0])
34+
1
35+
>>> len(detections[[0, 1]])
4436
2
45-
>>> crops = [
46-
... sv.crop(image=image, xyxy=xyxy)
47-
... for xyxy
48-
... in detections.xyxy
49-
... ]
50-
>>> len(crops)
37+
>>> len(detections[0:2])
5138
2
5239
```
5340

41+
- Added [[#101](https://github.com/roboflow/supervision/pull/101)]: ability to extract masks from YOLOv8 result using [`sv.Detections.from_yolov8`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_yolov8). Here is an example illustrating how to extract boolean masks from the result of the YOLOv8 model inference.
42+
43+
- Added [[#122](https://github.com/roboflow/supervision/pull/122)]: ability to crop image using [`sv.crop`](https://roboflow.github.io/supervision/utils/image/#crop). Here is an example showing how to get a separate crop for each detection in `sv.Detections`.
44+
5445
- Added [[#120](https://github.com/roboflow/supervision/pull/120)]: ability to conveniently save multiple images into directory using [`sv.ImageSink`](https://roboflow.github.io/supervision/utils/image/#imagesink). Here is an example showing how to save every tenth video frame as a separate image.
5546

5647
```python

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ def get_version():
6464
'Operating System :: Unix',
6565
'Operating System :: MacOS'
6666
],
67-
keywords="machine-learning, deep-learning, vision, ML, DL, AI, YOLOv5, YOLOv8, Roboflow",
67+
keywords="machine-learning, deep-learning, vision, ML, DL, AI, YOLOv5, YOLOv8, SAM, Roboflow",
6868
python_requires='>=3.7',
6969
)

supervision/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.9.0"
1+
__version__ = "0.10.0"
22

33
from supervision.classification.core import Classifications
44
from supervision.dataset.core import (

supervision/dataset/core.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def split(
396396
)
397397
return train_dataset, test_dataset
398398

399-
def as_multiclass_folder_structure(self, root_directory_path: str) -> None:
399+
def as_folder_structure(self, root_directory_path: str) -> None:
400400
"""
401401
Saves the dataset as a multi-class folder structure.
402402
@@ -421,9 +421,7 @@ def as_multiclass_folder_structure(self, root_directory_path: str) -> None:
421421
cv2.imwrite(image_path, image)
422422

423423
@classmethod
424-
def from_multiclass_folder_structure(
425-
cls, root_directory_path: str
426-
) -> ClassificationDataset:
424+
def from_folder_structure(cls, root_directory_path: str) -> ClassificationDataset:
427425
"""
428426
Load data from a multiclass folder structure into a ClassificationDataset.
429427
@@ -446,7 +444,7 @@ def from_multiclass_folder_structure(
446444
>>> project = rf.workspace(WORKSPACE_ID).project(PROJECT_ID)
447445
>>> dataset = project.version(PROJECT_VERSION).download("folder")
448446
449-
>>> cd = sv.ClassificationDataset.from_multiclass_folder_structure(
447+
>>> cd = sv.ClassificationDataset.from_folder_structure(
450448
... root_directory_path=f"{dataset.location}/train"
451449
... )
452450
```

0 commit comments

Comments
 (0)