Skip to content

[cherry-pick] cherry-pick #30414 #30415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions python/paddle/vision/datasets/cifar.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ class Cifar10(Dataset):

Args:
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'.
transform(callable): transform to perform on image, None for on transform.
download(bool): whether to download dataset automatically if
:attr:`data_file` is not set. Default True
transform(callable): transform to perform on image, None for no transform.
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
backend(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`` ,
Expand Down Expand Up @@ -181,11 +180,10 @@ class Cifar100(Cifar10):

Args:
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'.
transform(callable): transform to perform on image, None for on transform.
download(bool): whether to download dataset automatically if
:attr:`data_file` is not set. Default True
transform(callable): transform to perform on image, None for no transform.
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
backend(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`` ,
Expand Down
7 changes: 3 additions & 4 deletions python/paddle/vision/datasets/flowers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,14 @@ class Flowers(Dataset):

Args:
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
:attr:`download` is True. Default None
setid_file(str): path to subset index file, can be set
None if :attr:`download` is True. Default None
mode(str): 'train', 'valid' or 'test' mode. Default 'train'.
transform(callable): transform to perform on image, None for on transform.
download(bool): whether to download dataset automatically if
:attr:`data_file` is not set. Default True
transform(callable): transform to perform on image, None for no transform.
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
backend(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`` ,
Expand Down
3 changes: 3 additions & 0 deletions python/paddle/vision/datasets/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ def make_fake_dir():
return data_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)

for items in data_folder:
Expand Down
6 changes: 3 additions & 3 deletions python/paddle/vision/datasets/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class MNIST(Dataset):

Args:
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
: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'.
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
backend(str, optional): Specifies which type of image to be returned:
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
Expand Down
5 changes: 2 additions & 3 deletions python/paddle/vision/datasets/voc2012.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ class VOC2012(Dataset):

Args:
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'.
download(bool): whether to download dataset automatically if
:attr:`data_file` is not set. Default True
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
backend(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`` ,
Expand Down