Update dataset names from array to dictionary (#9000)
* Migrate dataset names to dictionary * fix check * backwards compat * predict fix * val fix * Keep dataset stats behavior identical Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
1 parent
e8f24d5748
commit
e83b422a69
15 files changed
+1646
-227
No files matched your search
+1
-1
@@ -449,7 +449,7 @@ class DetectMultiBackend(nn.Module):
|
||||
|
||||
# class names
|
||||
if 'names' not in locals():
|
||||
names = yaml_load(data)['names'] if data else [f'class{i}' for i in range(999)]
|
||||
names = yaml_load(data)['names'] if data else {i: f'class{i}' for i in range(999)}
|
||||
if names[0] == 'n01440764' and len(names) == 1000: # ImageNet
|
||||
names = yaml_load(ROOT / 'data/ImageNet.yaml')['names'] # human-readable names
|
||||
|
||||
|
||||
Reference in new issue
Block a user