Allow test-dev2017.txt for val (#14519)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
bfcd85323d
commit
43aeed7356
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue