From cdc08c0455e544847d7f7ed6eb474a7828d6415a Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 28 Jun 2023 17:07:02 +0200 Subject: [PATCH 1/3] `0.11.0` release --- CITATION.cff | 2 +- README.md | 24 +++++++++++++++++++++- docs/changelog.md | 44 +++++++++++++++++++++++++++++++++++++++++ supervision/__init__.py | 2 +- 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 093d8807..51200e67 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ cff-version: 1.2.0 author: Roboflow message: If you use this software, please cite it as below. title: supervision -version: 0.10.0 +version: 0.11.0 date-released: 2023-01-19 license: MIT repository-code: https://github.com/roboflow/supervision diff --git a/README.md b/README.md index dd044c69..04ea6c28 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,28 @@ pip install -e ".[dev]" (700, 150, 150) ``` +- Merge multiple datasets together + + ```python + >>> ds_1 = sv.DetectionDataset(...) + >>> len(ds_1) + 100 + >>> ds_1.classes + ['dog', 'person'] + + >>> ds_2 = sv.DetectionDataset(...) + >>> len(ds_2) + 200 + >>> ds_2.classes + ['cat'] + + >>> ds_merged = sv.DetectionDataset.merge([ds_1, ds_2]) + >>> len(ds_merged) + 300 + >>> ds_merged.classes + ['cat', 'dog', 'person'] + ``` + - Save object detection / instance segmentation datasets in one of supported formats ```python @@ -184,7 +206,7 @@ pip install -e ".[dev]" ... ) ``` -- Convert labels between suppoted formats +- Convert labels between supported formats ```python >>> sv.DetectionDataset.from_yolo( diff --git a/docs/changelog.md b/docs/changelog.md index 1224fbc3..03b55b89 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,47 @@ +### 0.10.0 June 28, 2023 + +- Added [[#150](https://github.com/roboflow/supervision/pull/150)]: ability to load and save [`sv.DetectionDataset`](https://roboflow.github.io/supervision/dataset/core/#detectiondataset) in COCO format using [`as_coco`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.as_coco) and [`from_coco`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.from_coco) methods. + +```python +>>> import supervision as sv + +>>> ds = sv.DetectionDataset.from_coco( +... images_directory_path='...', +... annotations_path='...' +... ) + +>>> ds.as_coco( +... images_directory_path='...', +... annotations_path='...' +... ) +``` + +- Added [[#158](https://github.com/roboflow/supervision/pull/158)]: ability to marge multiple [`sv.DetectionDataset`](https://roboflow.github.io/supervision/dataset/core/#detectiondataset) together using [`merge`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.merge) method. + +```python +>>> import supervision as sv + +>>> ds_1 = sv.DetectionDataset(...) +>>> len(ds_1) +100 +>>> ds_1.classes +['dog', 'person'] + +>>> ds_2 = sv.DetectionDataset(...) +>>> len(ds_2) +200 +>>> ds_2.classes +['cat'] + +>>> ds_merged = sv.DetectionDataset.merge([ds_1, ds_2]) +>>> len(ds_merged) +300 +>>> ds_merged.classes +['cat', 'dog', 'person'] +``` + +- Fix [[#157](https://github.com/roboflow/supervision/pull/157)]: incorrect loading of YOLO dataset class names from `data.yaml`. + ### 0.10.0 June 14, 2023 - 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. diff --git a/supervision/__init__.py b/supervision/__init__.py index 3fafef8c..9756d474 100644 --- a/supervision/__init__.py +++ b/supervision/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.10.0" +__version__ = "0.11.0" from supervision.classification.core import Classifications from supervision.dataset.core import ( From ea517642f005ec370ffdc40cf5fda2b580d38686 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 28 Jun 2023 17:12:24 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=96=A4=20make=20black=20happy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/dataset/core.py | 4 ++-- supervision/dataset/formats/coco.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/supervision/dataset/core.py b/supervision/dataset/core.py index 5223d706..7f2626c5 100644 --- a/supervision/dataset/core.py +++ b/supervision/dataset/core.py @@ -409,7 +409,7 @@ class DetectionDataset(BaseDataset): annotations_path: Optional[str] = None, min_image_area_percentage: float = 0.0, max_image_area_percentage: float = 1.0, - approximation_percentage: float = 0.0 + approximation_percentage: float = 0.0, ) -> None: """ Exports the dataset to COCO format. This method saves the images and their corresponding @@ -439,7 +439,7 @@ class DetectionDataset(BaseDataset): classes=self.classes, min_image_area_percentage=min_image_area_percentage, max_image_area_percentage=max_image_area_percentage, - approximation_percentage=approximation_percentage + approximation_percentage=approximation_percentage, ) @classmethod diff --git a/supervision/dataset/formats/coco.py b/supervision/dataset/formats/coco.py index 3fa076d8..51adff01 100644 --- a/supervision/dataset/formats/coco.py +++ b/supervision/dataset/formats/coco.py @@ -161,7 +161,7 @@ def save_coco_annotations( classes: List[str], min_image_area_percentage: float = 0.0, max_image_area_percentage: float = 1.0, - approximation_percentage: float = 0.75 + approximation_percentage: float = 0.75, ) -> None: Path(annotation_path).parent.mkdir(parents=True, exist_ok=True) info = {} From c1d3ab2944fb0db0d9eca1307fdada0e9f878dd3 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 28 Jun 2023 22:43:08 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=AA=B5=20update=20changelog.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 03b55b89..1b4fc099 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,4 +1,4 @@ -### 0.10.0 June 28, 2023 +### 0.11.0 June 28, 2023 - Added [[#150](https://github.com/roboflow/supervision/pull/150)]: ability to load and save [`sv.DetectionDataset`](https://roboflow.github.io/supervision/dataset/core/#detectiondataset) in COCO format using [`as_coco`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.as_coco) and [`from_coco`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.from_coco) methods. @@ -40,6 +40,8 @@ ['cat', 'dog', 'person'] ``` +- Added [[#162](https://github.com/roboflow/supervision/pull/162)]: additional `start` and `end` arguments to [`sv.get_video_frames_generator`](https://roboflow.github.io/supervision/utils/video/#get_video_frames_generator) allowing to generate frames only for a selected part of the video. + - Fix [[#157](https://github.com/roboflow/supervision/pull/157)]: incorrect loading of YOLO dataset class names from `data.yaml`. ### 0.10.0 June 14, 2023