Fix YOLOE prompt-free validation example in docs (#21745)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Laughing-q <1185102784@qq.com>
This commit is contained in:
LYUShuai 2025-08-20 20:32:39 +08:00 committed by GitHub
parent 8fb9ef8c20
commit ebb447c681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -448,10 +448,10 @@ Model validation on a dataset is streamlined as follows:
from ultralytics import YOLOE
# Create a YOLOE model
model = YOLOE("yoloe-11l-seg.pt") # or select yoloe-11s/m-seg.pt for different sizes
model = YOLOE("yoloe-11l-seg-pf.pt") # or select yoloe-11s/m-seg-pf.pt for different sizes
# Conduct model validation on the COCO128-seg example dataset
metrics = model.val(data="coco128-seg.yaml")
metrics = model.val(data="coco128-seg.yaml", single_cls=True)
```
### Export Usage

View File

@ -181,7 +181,7 @@ class YOLOEDetectValidator(DetectionValidator):
else:
if refer_data is not None:
assert load_vp, "Refer data is only used for visual prompt validation."
self.device = select_device(self.args.device)
self.device = select_device(self.args.device, verbose=False)
if isinstance(model, (str, Path)):
from ultralytics.nn.tasks import attempt_load_weights