mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
[Fix] Fix ImageNet dataset annotation file parse bug. (#370)
Co-authored-by: mzr1996 <mzr1996@163.com>
This commit is contained in:
parent
c92eefbb4a
commit
db856df43e
@ -1091,7 +1091,7 @@ class ImageNet(BaseDataset):
|
|||||||
self.folder_to_idx = folder_to_idx
|
self.folder_to_idx = folder_to_idx
|
||||||
elif isinstance(self.ann_file, str):
|
elif isinstance(self.ann_file, str):
|
||||||
with open(self.ann_file) as f:
|
with open(self.ann_file) as f:
|
||||||
samples = [x.strip().split(' ') for x in f.readlines()]
|
samples = [x.strip().rsplit(' ', 1) for x in f.readlines()]
|
||||||
else:
|
else:
|
||||||
raise TypeError('ann_file must be a str or None')
|
raise TypeError('ann_file must be a str or None')
|
||||||
self.samples = samples
|
self.samples = samples
|
||||||
|
Loading…
x
Reference in New Issue
Block a user