Skip to content

Commit

Permalink
Update transforms handling in Dataset (cvat-ai#297)
Browse files Browse the repository at this point in the history
* Update builtin transforms

* Optimize dataset length computation when no source

* Add filter test

* Fix transforms affecting categories

* Optimize categories transforms

* Update filters

* fix imports

* Avoid using default docstrings in plugins

* Fix patch saving in VOC, add keep_empty export parameter

* Fix flush_changes

* Fix removed images and subsets in dataset patch

* Update changelog

* Update voc doc

* Skip item transform base class in plugins
  • Loading branch information
Maxim Zhiltsov authored Jun 20, 2021
1 parent 9a2f3f2 commit ed7706e
Show file tree
Hide file tree
Showing 14 changed files with 925 additions and 196 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Subformat importers for VOC and COCO (<https://github.com/openvinotoolkit/datumaro/pull/281>)
- Support for KITTI dataset segmentation and detection format (<https://github.com/openvinotoolkit/datumaro/pull/282>)
- Updated YOLO format user manual (<https://github.com/openvinotoolkit/datumaro/pull/295>)
- `ItemTransform` class, which describes item-wise dataset `Transform`s (<https://github.com/openvinotoolkit/datumaro/pull/297>)
- `keep-empty` export parameter in VOC format (<https://github.com/openvinotoolkit/datumaro/pull/297>)
- A base class for dataset validation plugins (<https://github.com/openvinotoolkit/datumaro/pull/299>)

### Changed
Expand All @@ -26,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Incorrect image layout on saving and a problem with ecoding on loading (<https://github.com/openvinotoolkit/datumaro/pull/284>)
- An error when xpath fiter is applied to the dataset or its subset (<https://github.com/openvinotoolkit/datumaro/issues/259>)
- Tracking of `Dataset` changes done by transforms (<https://github.com/openvinotoolkit/datumaro/pull/297>)
- Improved CLI startup time in several cases (<https://github.com/openvinotoolkit/datumaro/pull/306>)

### Security
Expand Down
12 changes: 11 additions & 1 deletion datumaro/components/cli_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ def _get_name(cls):

@staticmethod
def _get_doc(cls):
return getattr(cls, '__doc__', "")
doc = getattr(cls, '__doc__', "")
if doc:
from datumaro.components.launcher import Launcher
from datumaro.components.extractor import Extractor, Transform, \
Importer
from datumaro.components.converter import Converter
base_classes = [Launcher, Extractor, Transform, Importer, Converter]

if any(getattr(t, '__doc__', '') == doc for t in base_classes):
doc = ''
return doc

@classmethod
def build_cmdline_parser(cls, **kwargs):
Expand Down
Loading

0 comments on commit ed7706e

Please sign in to comment.