FlattenDict

class hybrid_learning.datasets.transforms.dict_transforms.FlattenDict(selected_key)[source]

Bases: DictTransform

Return the value of the annotations dict at selected key.

Public Data Attributes:

settings

Settings to reproduce the instance.

Inherited from : py: class:DictTransform

settings

Settings to reproduce the instance.

Inherited from : py: class:Transform

IDENTITY_CLASS

The identity class or classes for composition / addition.

settings

Settings to reproduce the instance.

Public Methods:

apply_to(annotations)

Flatten annotations dict to its value at the configured key.

Inherited from : py: class:DictTransform

apply_to(annotations)

Flatten annotations dict to its value at the configured key.

Inherited from : py: class:Transform

apply_to(annotations)

Flatten annotations dict to its value at the configured key.

Special Methods:

__init__(selected_key)

Init.

Inherited from : py: class:DictTransform

__call__(annotations)

Call method modifying a given dictionary.

Inherited from : py: class:Transform

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

__copy__()

Return a shallow copy of self using settings.

__add__(other)

Return a flat composition of self with other.

__radd__(other)

Return a flat composition of other and self.

__call__(annotations)

Call method modifying a given dictionary.


Parameters

selected_key (str) –

__init__(selected_key)[source]

Init.

Parameters

selected_key (str) – see selected_key

apply_to(annotations)[source]

Flatten annotations dict to its value at the configured key. The configured key is stored in selected_key.

Parameters

annotations (Dict[str, Any]) –

Return type

Any

selected_key: str

The key of the annotation value to return.

property settings: Dict[str, Any]

Settings to reproduce the instance.