Flowers¶
- class paddle.vision.datasets. Flowers ( data_file=None, label_file=None, setid_file=None, mode='train', transform=None, download=True, backend=None ) [source]
-
Implementation of Flowers dataset
- Parameters
-
data_file (str) – path to data file, can be set None if
download
is True. Default None, default data path: ~/.cache/paddle/dataset/flowers/label_file (str) – path to label file, can be set None if
download
is True. Default None, default data path: ~/.cache/paddle/dataset/flowers/setid_file (str) – path to subset index file, can be set None if
download
is True. Default Nonemode (str) – ‘train’, ‘valid’ or ‘test’ mode. Default ‘train’.
transform (callable) – transform to perform on image, None for no transform.
download (bool) – download dataset automatically if
data_file
is None. Default Truebackend (str, optional) – Specifies which type of image to be returned: PIL.Image or numpy.ndarray. Should be one of {‘pil’, ‘cv2’}. If this option is not set, will get backend from
paddle.vsion.get_image_backend
, default backend is ‘pil’. Default: None.
Examples
from paddle.vision.datasets import Flowers flowers = Flowers(mode='test') for i in range(len(flowers)): sample = flowers[i] print(sample[0].size, sample[1])