mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 13:34:23 +08:00
Update val.py
Fixed a bug in yolov10's verification of the MAP of the COCO test2017
This commit is contained in:
parent
aad320dd80
commit
84b18f968c
@ -65,7 +65,7 @@ class DetectionValidator(BaseValidator):
|
||||
def init_metrics(self, model):
|
||||
"""Initialize evaluation metrics for YOLO."""
|
||||
val = self.data.get(self.args.split, "") # validation path
|
||||
self.is_coco = isinstance(val, str) and "coco" in val and val.endswith(f"{os.sep}val2017.txt") # is COCO
|
||||
self.is_coco = isinstance(val, str) and "coco" in val and (val.endswith(f"{os.sep}val2017.txt") or val.endswith(f"{os.sep}test-dev2017.txt")) # is COCO
|
||||
self.class_map = converter.coco80_to_coco91_class() if self.is_coco else list(range(1000))
|
||||
self.args.save_json |= self.is_coco # run on final val if training COCO
|
||||
self.names = model.names
|
||||
|
Loading…
x
Reference in New Issue
Block a user