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) – List of transforms to compose.

Returns

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

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(10):
    sample = flowers[i]
    print(sample[0].shape, sample[1])