Skip to content

Commit 2494562

Browse files
author
cnn
authored
update document of paddle.vision.dataset, test=document (#30415)
1 parent 138a71b commit 2494562

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

python/paddle/vision/datasets/cifar.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ class Cifar10(Dataset):
4747
4848
Args:
4949
data_file(str): path to data file, can be set None if
50-
:attr:`download` is True. Default None
50+
:attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/cifar
5151
mode(str): 'train', 'test' mode. Default 'train'.
52-
transform(callable): transform to perform on image, None for on transform.
53-
download(bool): whether to download dataset automatically if
54-
:attr:`data_file` is not set. Default True
52+
transform(callable): transform to perform on image, None for no transform.
53+
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
5554
backend(str, optional): Specifies which type of image to be returned:
5655
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
5756
If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,
@@ -181,11 +180,10 @@ class Cifar100(Cifar10):
181180
182181
Args:
183182
data_file(str): path to data file, can be set None if
184-
:attr:`download` is True. Default None
183+
:attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/cifar
185184
mode(str): 'train', 'test' mode. Default 'train'.
186-
transform(callable): transform to perform on image, None for on transform.
187-
download(bool): whether to download dataset automatically if
188-
:attr:`data_file` is not set. Default True
185+
transform(callable): transform to perform on image, None for no transform.
186+
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
189187
backend(str, optional): Specifies which type of image to be returned:
190188
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
191189
If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,

python/paddle/vision/datasets/flowers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,14 @@ class Flowers(Dataset):
4747
4848
Args:
4949
data_file(str): path to data file, can be set None if
50-
:attr:`download` is True. Default None
50+
:attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/flowers/
5151
label_file(str): path to label file, can be set None if
5252
:attr:`download` is True. Default None
5353
setid_file(str): path to subset index file, can be set
5454
None if :attr:`download` is True. Default None
5555
mode(str): 'train', 'valid' or 'test' mode. Default 'train'.
56-
transform(callable): transform to perform on image, None for on transform.
57-
download(bool): whether to download dataset automatically if
58-
:attr:`data_file` is not set. Default True
56+
transform(callable): transform to perform on image, None for no transform.
57+
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
5958
backend(str, optional): Specifies which type of image to be returned:
6059
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
6160
If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,

python/paddle/vision/datasets/folder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ def make_fake_dir():
111111
return data_dir
112112
113113
temp_dir = make_fake_dir()
114+
# temp_dir is root dir
115+
# temp_dir/class_1/img1_1.jpg
116+
# temp_dir/class_2/img2_1.jpg
114117
data_folder = DatasetFolder(temp_dir)
115118
116119
for items in data_folder:

python/paddle/vision/datasets/mnist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ class MNIST(Dataset):
3333
3434
Args:
3535
image_path(str): path to image file, can be set None if
36-
:attr:`download` is True. Default None
36+
:attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/mnist
3737
label_path(str): path to label file, can be set None if
38-
:attr:`download` is True. Default None
38+
:attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/mnist
3939
mode(str): 'train' or 'test' mode. Default 'train'.
40-
download(bool): whether to download dataset automatically if
40+
download(bool): download dataset automatically if
4141
:attr:`image_path` :attr:`label_path` is not set. Default True
4242
backend(str, optional): Specifies which type of image to be returned:
4343
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.

python/paddle/vision/datasets/voc2012.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ class VOC2012(Dataset):
4646
4747
Args:
4848
data_file(str): path to data file, can be set None if
49-
:attr:`download` is True. Default None
49+
:attr:`download` is True. Default None, default data path: ~/.cache/paddle/dataset/voc2012
5050
mode(str): 'train', 'valid' or 'test' mode. Default 'train'.
51-
download(bool): whether to download dataset automatically if
52-
:attr:`data_file` is not set. Default True
51+
download(bool): download dataset automatically if :attr:`data_file` is None. Default True
5352
backend(str, optional): Specifies which type of image to be returned:
5453
PIL.Image or numpy.ndarray. Should be one of {'pil', 'cv2'}.
5554
If this option is not set, will get backend from ``paddle.vsion.get_image_backend`` ,

0 commit comments

Comments
 (0)