Shortcuts

Compose

class mmcv.transforms.Compose(transforms: Union[Dict, Callable[[Dict], Dict], Sequence[Union[Dict, Callable[[Dict], Dict]]]])[源代码]

Compose multiple transforms sequentially.

参数

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

实际案例

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

Call function to apply transforms sequentially.

参数

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

返回

Transformed results.

返回类型

dict or None