Compose

class paddle.vision.transforms. Compose ( transforms ) [source]

Composes several transforms together use for composing list of transforms together for a dataset transform.

Parameters

transforms (list|tuple) – List/Tuple of transforms to compose.

Returns

A compose object which is callable, __call__ for this Compose object will call each given transforms sequently.

Examples

>>> from paddle.vision.datasets import Flowers
>>> from paddle.vision.transforms import Compose, ColorJitter, Resize
>>> transform = Compose([ColorJitter(), Resize(size=608)])
>>> flowers = Flowers(mode='test', transform=transform)
>>> for i in range(3):
...     sample = flowers[i]
...     print(sample[0].size, sample[1])
(916, 608) [1]
(758, 608) [1]
(811, 608) [1]