未验证 提交 2494562d 编写于 作者: C cnn 提交者: GitHub

update document of paddle.vision.dataset, test=document (#30415)

上级 138a71b7
...@@ -47,11 +47,10 @@ class Cifar10(Dataset): ...@@ -47,11 +47,10 @@ class Cifar10(Dataset):
Args: Args:
data_file(str): path to data file, can be set None if data_file(str): path to data file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/cifar
mode(str): 'train', 'test' mode. Default 'train'. mode(str): 'train', 'test' mode. Default 'train'.
transform(callable): transform to perform on image, None for on transform. transform(callable): transform to perform on image, None for no transform.
download(bool): whether to download dataset automatically if download(bool): download dataset automatically if :attr:`data_file` is None. Default True
:attr:`data_file` is not set. Default True
backend(str, optional): Specifies which type of image to be returned: backend(str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}. 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`` , If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,
...@@ -181,11 +180,10 @@ class Cifar100(Cifar10): ...@@ -181,11 +180,10 @@ class Cifar100(Cifar10):
Args: Args:
data_file(str): path to data file, can be set None if data_file(str): path to data file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/cifar
mode(str): 'train', 'test' mode. Default 'train'. mode(str): 'train', 'test' mode. Default 'train'.
transform(callable): transform to perform on image, None for on transform. transform(callable): transform to perform on image, None for no transform.
download(bool): whether to download dataset automatically if download(bool): download dataset automatically if :attr:`data_file` is None. Default True
:attr:`data_file` is not set. Default True
backend(str, optional): Specifies which type of image to be returned: backend(str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}. 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`` , If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,
......
...@@ -47,15 +47,14 @@ class Flowers(Dataset): ...@@ -47,15 +47,14 @@ class Flowers(Dataset):
Args: Args:
data_file(str): path to data file, can be set None if data_file(str): path to data file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/flowers/
label_file(str): path to label file, can be set None if label_file(str): path to label file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None
setid_file(str): path to subset index file, can be set setid_file(str): path to subset index file, can be set
None if :attr:`download` is True. Default None None if :attr:`download` is True. Default None
mode(str): 'train', 'valid' or 'test' mode. Default 'train'. mode(str): 'train', 'valid' or 'test' mode. Default 'train'.
transform(callable): transform to perform on image, None for on transform. transform(callable): transform to perform on image, None for no transform.
download(bool): whether to download dataset automatically if download(bool): download dataset automatically if :attr:`data_file` is None. Default True
:attr:`data_file` is not set. Default True
backend(str, optional): Specifies which type of image to be returned: backend(str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}. 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`` , If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,
......
...@@ -111,6 +111,9 @@ class DatasetFolder(Dataset): ...@@ -111,6 +111,9 @@ class DatasetFolder(Dataset):
return data_dir return data_dir
temp_dir = make_fake_dir() temp_dir = make_fake_dir()
# temp_dir is root dir
# temp_dir/class_1/img1_1.jpg
# temp_dir/class_2/img2_1.jpg
data_folder = DatasetFolder(temp_dir) data_folder = DatasetFolder(temp_dir)
for items in data_folder: for items in data_folder:
......
...@@ -33,11 +33,11 @@ class MNIST(Dataset): ...@@ -33,11 +33,11 @@ class MNIST(Dataset):
Args: Args:
image_path(str): path to image file, can be set None if image_path(str): path to image file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/mnist
label_path(str): path to label file, can be set None if label_path(str): path to label file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/mnist
mode(str): 'train' or 'test' mode. Default 'train'. mode(str): 'train' or 'test' mode. Default 'train'.
download(bool): whether to download dataset automatically if download(bool): download dataset automatically if
:attr:`image_path` :attr:`label_path` is not set. Default True :attr:`image_path` :attr:`label_path` is not set. Default True
backend(str, optional): Specifies which type of image to be returned: backend(str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}. PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
......
...@@ -46,10 +46,9 @@ class VOC2012(Dataset): ...@@ -46,10 +46,9 @@ class VOC2012(Dataset):
Args: Args:
data_file(str): path to data file, can be set None if data_file(str): path to data file, can be set None if
:attr:`download` is True. Default None :attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/voc2012
mode(str): 'train', 'valid' or 'test' mode. Default 'train'. mode(str): 'train', 'valid' or 'test' mode. Default 'train'.
download(bool): whether to download dataset automatically if download(bool): download dataset automatically if :attr:`data_file` is None. Default True
:attr:`data_file` is not set. Default True
backend(str, optional): Specifies which type of image to be returned: backend(str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}. 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`` , If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册