@@ -154,19 +154,14 @@ class Cars196(tfds.core.GeneratorBasedBuilder):
154
154
155
155
VERSION = tfds .core .Version ('2.0.0' )
156
156
157
- SUPPORTED_VERSIONS = [
158
- tfds .core .Version ('1.1.0' ), # Version with no test labels.
159
- ]
160
-
161
157
def _info (self ):
162
158
"""Define the dataset info."""
163
- names = _NAMES + ['test' ] if self .version < '2.0.0' else _NAMES
164
159
return tfds .core .DatasetInfo (
165
160
builder = self ,
166
161
description = (_DESCRIPTION ),
167
162
features = tfds .features .FeaturesDict ({
168
163
'image' : tfds .features .Image (),
169
- 'label' : tfds .features .ClassLabel (names = names ),
164
+ 'label' : tfds .features .ClassLabel (names = _NAMES ),
170
165
'bbox' : tfds .features .BBoxFeature (),
171
166
}),
172
167
supervised_keys = ('image' , 'label' ),
@@ -219,10 +214,7 @@ def _generate_examples(self, split_name, data_dir_path,
219
214
mat = tfds .core .lazy_imports .scipy .io .loadmat (f )
220
215
for example in mat ['annotations' ][0 ]:
221
216
image_name = example [- 1 ].item ().split ('.' )[0 ]
222
- if self .version < '2.0.0' and split_name == 'test' :
223
- label = - 1
224
- else :
225
- label = _NAMES [example [4 ].item () - 1 ]
217
+ label = _NAMES [example [4 ].item () - 1 ]
226
218
image = image_dict [image_name ]
227
219
bbox = bbox_dict [image_name ]
228
220
yield image_name , {
0 commit comments