Shortcuts

Compose

class mmcv.transforms.Compose(transforms: Union[Dict, Callable[[Dict], Dict], Sequence[Union[Dict, Callable[[Dict], Dict]]]])[source]

Compose multiple transforms sequentially.

Parameters

transforms (list[dict | callable]) – Sequence of transform object or config dict to be composed.

Examples

>>> pipeline = [
>>>     dict(type='Compose',
>>>         transforms=[
>>>             dict(type='LoadImageFromFile'),
>>>             dict(type='Normalize')
>>>         ]
>>>     )
>>> ]
transform(results: Dict)Optional[Dict][source]

Call function to apply transforms sequentially.

Parameters

results (dict) – A result dict contains the results to transform.

Returns

Transformed results.

Return type

dict or None