Skip to content

Commit 799e90a

Browse files
author
Philip Meier
committed
add docstrings
1 parent adfa863 commit 799e90a

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

torchvision/datasets/imagenet.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class ImageNet(ImageFolder):
4444
imgs (list): List of (image path, class_index) tuples
4545
targets (list): The class_index value for each image in the dataset
4646
"""
47-
4847
def __init__(self, root, split='train', download=None, **kwargs):
4948
if download is None:
5049
download = False
@@ -116,13 +115,13 @@ def extra_repr(self):
116115

117116

118117
def parse_devkit_archive(archive, meta_file=None):
119-
"""
118+
"""Parse the devkit archive of the ImageNet2012 classification dataset and save
119+
the meta information in a binary file.
120120
121121
Args:
122-
archive:
123-
meta_file:
122+
archive (str): Path to the devkit archive
123+
meta_file (str, optional): Optional name for the meta information file
124124
"""
125-
# FIXME
126125
import scipy.io as sio
127126

128127
def parse_meta(devkit_root):
@@ -171,15 +170,12 @@ def load_meta_file(root, filename=META_FILE_NAME):
171170

172171

173172
def parse_train_archive(archive, folder=None):
174-
# FIXME
175-
"""
173+
"""Parse the train images archive of the ImageNet2012 classification dataset and
174+
prepare it for usage with the ImageNet dataset.
176175
177176
Args:
178-
archive:
179-
folder:
180-
181-
Returns:
182-
177+
archive (str): Path to the train images archive
178+
folder (str, optional): Optional name for train images folder
183179
"""
184180
if folder is None:
185181
folder = os.path.join(os.path.dirname(archive), "train")
@@ -191,13 +187,15 @@ def parse_train_archive(archive, folder=None):
191187

192188

193189
def parse_val_archive(archive, wnids=None, folder=None):
194-
# FIXME
195-
"""
190+
"""Parse the validation images archive of the ImageNet2012 classification dataset
191+
and prepare it for usage with the ImageNet dataset.
196192
197193
Args:
198-
archive:
199-
wnids:
200-
folder:
194+
archive (str): Path to the validation images archive
195+
wnids (list, optional): List of WordNet IDs of the validation images. If None
196+
is given, the IDs are tried to be loaded from the meta information binary
197+
file in the same directory as the archive.
198+
folder (str, optional): Optional name for validation images folder
201199
"""
202200
root = os.path.dirname(archive)
203201
if wnids is None:

0 commit comments

Comments
 (0)