diff --git a/CHANGELOG.md b/CHANGELOG.md index a7ba410ed9..4c9cff1e65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,6 +85,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 () - Fix resize transform for RleMask annotation - () +- Fix import YOLO variants from extractor when `urls` is not specified + () ## Jan. 2024 Release 1.5.2 ### Enhancements diff --git a/src/datumaro/plugins/data_formats/yolo/base.py b/src/datumaro/plugins/data_formats/yolo/base.py index 39e5141f5b..1778cc1a9c 100644 --- a/src/datumaro/plugins/data_formats/yolo/base.py +++ b/src/datumaro/plugins/data_formats/yolo/base.py @@ -316,6 +316,15 @@ def __init__( if not osp.isdir(config_path): raise DatasetImportError(f"{config_path} should be a directory.") + if not urls: + raise DatasetImportError( + f"`urls` should be specified for {self.__class__.__name__}, " + f"if you want to import a dataset with using this {self.__class__.__name__} directly. " + "In most case, it happens by giving an incorrect format name to the import interface. " + "Please consider to import your dataset with this format name, 'yolo', " + "such as `Dataset.import_from(..., format='yolo')`." + ) + rootpath = self._get_rootpath(config_path) self._image_info = YoloStrictBase.parse_image_info(rootpath, image_info)