diff --git a/ultralytics/models/yolo/detect/val.py b/ultralytics/models/yolo/detect/val.py index 7414e26e..6efebc12 100644 --- a/ultralytics/models/yolo/detect/val.py +++ b/ultralytics/models/yolo/detect/val.py @@ -68,7 +68,11 @@ 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.is_lvis = isinstance(val, str) and "lvis" in val and not self.is_coco # is LVIS self.class_map = converter.coco80_to_coco91_class() if self.is_coco else list(range(len(model.names))) self.args.save_json |= (self.is_coco or self.is_lvis) and not self.training # run on final val if training COCO