yolo val detect data=coco.yaml device=0
yolo val detect data=coco.yaml batch=1 device=0|cpu
Train YOLO11n on the COCO8 dataset for 100 epochs at image size 640. For a full list of available arguments see the Configuration page.
Beispiel
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.yaml") # build a new model from YAML
model = YOLO("yolo11n.pt") # load a pretrained model (recommended for training)
model = YOLO("yolo11n.yaml").load("yolo11n.pt") # build from YAML and transfer weights
# Train the model
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
# Build a new model from YAML and start training from scratch
yolo detect train data=coco8.yaml model=yolo11n.yaml epochs=100 imgsz=640
# Start training from a pretrained *.pt model
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640
# Build a new model from YAML, transfer pretrained weights to it and start training
yolo detect train data=coco8.yaml model=yolo11n.yaml pretrained=yolo11n.pt epochs=100 imgsz=640
YOLO Das Format der Erkennungsdatensätze findest du im Detail im Dataset Guide. Um deinen bestehenden Datensatz aus anderen Formaten (wie COCO usw.) in das Format YOLO zu konvertieren, verwende bitte das JSON2YOLO-Tool von Ultralytics.
Validate trained YOLO11n model accuracy on the COCO8 dataset. No arguments are needed as the model
seine Ausbildung beibehält data
und Argumente als Modellattribute.
Beispiel
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom model
# Validate the model
metrics = model.val() # no arguments needed, dataset and settings remembered
metrics.box.map # map50-95
metrics.box.map50 # map50
metrics.box.map75 # map75
metrics.box.maps # a list contains map50-95 of each category
Use a trained YOLO11n model to run predictions on images.
Beispiel
Siehe voll predict
Modus Details in der Vorhersage Seite.
Export a YOLO11n model to a different format like ONNX, CoreML, etc.
Beispiel
Available YOLO11 export formats are in the table below. You can export to any format using the format
Argument, d.h. format='onnx'
oder format='engine'
. Du kannst exportierte Modelle direkt vorhersagen oder validieren, d.h. yolo predict model=yolo11n.onnx
. Nach Abschluss des Exports werden Anwendungsbeispiele für dein Modell angezeigt.
Format | format Argument | Modell | Metadaten | Argumente |
---|---|---|---|---|
PyTorch | - | yolo11n.pt | ✅ | - |
TorchScript | torchscript | yolo11n.torchscript | ✅ | imgsz , optimize , batch |
ONNX | onnx | yolo11n.onnx | ✅ | imgsz , half , dynamic , simplify , opset , batch |
OpenVINO | openvino | yolo11n_openvino_model/ | ✅ | imgsz , half , int8 , batch |
TensorRT | engine | yolo11n.engine | ✅ | imgsz , half , dynamic , simplify , workspace , int8 , batch |
CoreML | coreml | yolo11n.mlpackage | ✅ | imgsz , half , int8 , nms , batch |
TF SavedModel | saved_model | yolo11n_saved_model/ | ✅ | imgsz , keras , int8 , batch |
TF GraphDef | pb | yolo11n.pb | ❌ | imgsz , batch |
TF Lite | tflite | yolo11n.tflite | ✅ | imgsz , half , int8 , batch |
TF Kante TPU | edgetpu | yolo11n_edgetpu.tflite | ✅ | imgsz |
TF.js | tfjs | yolo11n_web_model/ | ✅ | imgsz , half , int8 , batch |
PaddlePaddle | paddle | yolo11n_paddle_model/ | ✅ | imgsz , batch |
NCNN | ncnn | yolo11n_ncnn_model/ | ✅ | imgsz , half , batch |
Siehe voll export
Details in der exportieren Seite.
Training a YOLO11 model on a custom dataset involves a few steps:
train
Methode in Python oder die yolo detect train
Befehl in CLI.Beispiel
Ausführliche Informationen zu den Konfigurationsoptionen findest du auf der Seite Konfiguration.
Ultralytics YOLO11 offers various pretrained models for object detection, segmentation, and pose estimation. These models are pretrained on the COCO dataset or ImageNet for classification tasks. Here are some of the available models:
Eine detaillierte Liste und Leistungskennzahlen findest du im Abschnitt Modelle.
To validate the accuracy of your trained YOLO11 model, you can use the .val()
Methode in Python oder die yolo detect val
Befehl in CLI. Damit erhältst du Metriken wie mAP50-95, mAP50 und mehr.
Beispiel
Weitere Informationen zur Validierung findest du auf der Val-Seite.
Ultralytics YOLO11 allows exporting models to various formats such as ONNX, TensorRT, CoreML, and more to ensure compatibility across different platforms and devices.
Beispiel
Die vollständige Liste der unterstützten Formate und Anweisungen findest du auf der Seite Export.
Ultralytics YOLO11 is designed to offer state-of-the-art performance for object detection, segmentation, and pose estimation. Here are some key advantages:
Explore our Blog for use cases and success stories showcasing YOLO11 in action.