ultralytics 8.0.20 CLI yolo simplifications, DDP and ONNX fixes (#608)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sid Prabhakaran <s2siddhu@gmail.com>
This commit is contained in:
parent
59d4335664
commit
15b3b0365a
17 changed files with 242 additions and 139 deletions
|
|
@ -1,6 +1,7 @@
|
|||
# Ultralytics YOLO 🚀, GPL-3.0 license
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
|
@ -232,11 +233,17 @@ class DetectionValidator(BaseValidator):
|
|||
return stats
|
||||
|
||||
|
||||
def val(cfg=DEFAULT_CFG):
|
||||
cfg.model = cfg.model or "yolov8n.pt"
|
||||
cfg.data = cfg.data or "coco128.yaml"
|
||||
validator = DetectionValidator(args=cfg)
|
||||
validator(model=cfg.model)
|
||||
def val(cfg=DEFAULT_CFG, use_python=False):
|
||||
model = cfg.model or "yolov8n.pt"
|
||||
data = cfg.data or "coco128.yaml"
|
||||
|
||||
args = dict(model=model, data=data, verbose=True)
|
||||
if use_python:
|
||||
from ultralytics import YOLO
|
||||
YOLO(model).val(**args)
|
||||
else:
|
||||
validator = DetectionValidator(args=args)
|
||||
validator(model=args['model'])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue