Compare commits

...

2 Commits

Author SHA1 Message Date
zhiqiang yang
2aafd3e9d9
Merge 84b18f968cbb316787a5fd644efe7454ec50f411 into 6fbaf42b23f6709f4e34a51430587673e70e151d 2024-09-27 22:53:02 +08:00
zhiqiang yang
84b18f968c
Update val.py
Fixed a bug in yolov10's verification of the MAP of the COCO test2017
2024-07-18 10:39:57 +08:00

View File

@ -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