glenn-jocher
commited on
Commit
•
bcc085d
1
Parent(s):
bfacfc6
Common `is_coco` logic betwen train.py and val.py (#5521)
Browse files
train.py
CHANGED
@@ -107,7 +107,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
|
|
107 |
nc = 1 if single_cls else int(data_dict['nc']) # number of classes
|
108 |
names = ['item'] if single_cls and len(data_dict['names']) != 1 else data_dict['names'] # class names
|
109 |
assert len(names) == nc, f'{len(names)} names found for nc={nc} dataset in {data}' # check
|
110 |
-
is_coco =
|
111 |
|
112 |
# Model
|
113 |
check_suffix(weights, '.pt') # check weights
|
|
|
107 |
nc = 1 if single_cls else int(data_dict['nc']) # number of classes
|
108 |
names = ['item'] if single_cls and len(data_dict['names']) != 1 else data_dict['names'] # class names
|
109 |
assert len(names) == nc, f'{len(names)} names found for nc={nc} dataset in {data}' # check
|
110 |
+
is_coco = isinstance(val_path, str) and val_path.endswith('coco/val2017.txt') # COCO dataset
|
111 |
|
112 |
# Model
|
113 |
check_suffix(weights, '.pt') # check weights
|