@@ -44,7 +44,6 @@ class ImageNet(ImageFolder):
44
44
imgs (list): List of (image path, class_index) tuples
45
45
targets (list): The class_index value for each image in the dataset
46
46
"""
47
-
48
47
def __init__ (self , root , split = 'train' , download = None , ** kwargs ):
49
48
if download is None :
50
49
download = False
@@ -116,13 +115,13 @@ def extra_repr(self):
116
115
117
116
118
117
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.
120
120
121
121
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
124
124
"""
125
- # FIXME
126
125
import scipy .io as sio
127
126
128
127
def parse_meta (devkit_root ):
@@ -171,15 +170,12 @@ def load_meta_file(root, filename=META_FILE_NAME):
171
170
172
171
173
172
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.
176
175
177
176
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
183
179
"""
184
180
if folder is None :
185
181
folder = os .path .join (os .path .dirname (archive ), "train" )
@@ -191,13 +187,15 @@ def parse_train_archive(archive, folder=None):
191
187
192
188
193
189
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.
196
192
197
193
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
201
199
"""
202
200
root = os .path .dirname (archive )
203
201
if wnids is None :
0 commit comments