datumaro.components.abstracts.merger#
Classes
- class datumaro.components.abstracts.merger.IMatcherContext[source]#
Bases:
ABC
- abstract get_any_label_name(ann: Annotation, label_id: int) str [source]#
- class datumaro.components.abstracts.merger.IMergerContext[source]#
Bases:
IMatcherContext
- abstract merge(sources: Sequence[IDataset]) DatasetItemStorage [source]#
- class datumaro.components.abstracts.merger.ABC[source]#
Bases:
object
Helper class that provides a standard way to create an ABC using inheritance.
- class datumaro.components.abstracts.merger.Annotation(*, id: int = 0, attributes: Dict[str, Any] = _Nothing.NOTHING, group: int = 0, object_id: int = -1)[source]#
Bases:
object
A base annotation class.
Derived classes must define the ‘_type’ class variable with a value from the AnnotationType enum.
Method generated by attrs for class Annotation.
- property type: AnnotationType#
- class datumaro.components.abstracts.merger.DatasetItemStorage[source]#
Bases:
object
- put(item: DatasetItem) bool [source]#
- get(id: str | DatasetItem, subset: str | None = None, dummy: Any | None = None) DatasetItem | None [source]#
- class datumaro.components.abstracts.merger.DatasetItemStorageDatasetView(parent: DatasetItemStorage, infos: Dict[str, Any], categories: Dict[AnnotationType, Categories], media_type: Type[MediaElement] | None, ann_types: Set[AnnotationType] | None)[source]#
Bases:
IDataset
- class Subset(parent: DatasetItemStorageDatasetView, name: str)[source]#
Bases:
IDataset
- class datumaro.components.abstracts.merger.IDataset[source]#
Bases:
object
- subsets() Dict[str, IDataset] [source]#
Enumerates subsets in the dataset. Each subset can be a dataset itself.
- categories() Dict[AnnotationType, Categories] [source]#
Returns metainfo about dataset labels.
- get(id: str, subset: str | None = None) DatasetItem | None [source]#
Provides random access to dataset items.
- media_type() Type[MediaElement] [source]#
Returns media type of the dataset items.
All the items are supposed to have the same media type. Supposed to be constant and known immediately after the object construction (i.e. doesn’t require dataset iteration).
- ann_types() List[AnnotationType] [source]#
Returns available task type from dataset annotation types.
- class datumaro.components.abstracts.merger.MediaElement(crypter: ~datumaro.components.crypter.Crypter = <datumaro.components.crypter.NullCrypter object>, *args, **kwargs)[source]#
Bases:
Generic
[AnyData
]
- datumaro.components.abstracts.merger.abstractmethod(funcobj)[source]#
A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. The abstract methods can be called using any of the normal ‘super’ call mechanisms. abstractmethod() may be used to declare abstract methods for properties and descriptors.
Usage:
- class C(metaclass=ABCMeta):
@abstractmethod def my_abstract_method(self, …):
…