Link to this sectionObjekterkennung#
Objekterkennung ist eine Aufgabe, bei der es darum geht, den Ort und die Klasse von Objekten in einem Bild oder Videostream zu identifizieren.
Das Ergebnis eines Objektdetektors ist eine Reihe von Begrenzungsrahmen, die die Objekte im Bild umschließen, zusammen mit Klassenbeschriftungen und Konfidenzwerten für jeden Rahmen. Objekterkennung ist eine gute Wahl, wenn du Objekte von Interesse in einer Szene identifizieren musst, aber nicht genau wissen musst, wo sich das Objekt befindet oder welche genaue Form es hat.
Watch: Object Detection with Pretrained Ultralytics YOLO Model.
YOLO26 Detect-Modelle sind die Standard-YOLO26-Modelle, d. h. yolo26n.pt, und sind auf COCO vortrainiert.
Link to this sectionModelle#
YOLO26 vortrainierte Detect-Modelle sind hier dargestellt. Detect-, Segment- und Pose-Modelle sind auf dem COCO-Datensatz vortrainiert, Semantic-Modelle sind auf Cityscapes vortrainiert und Classify-Modelle sind auf dem ImageNet-Datensatz vortrainiert.
Modelle werden bei der ersten Verwendung automatisch von der neuesten Ultralytics Release heruntergeladen.
| Modell | Größe (Pixel) | mAPval 50-95 | mAPval 50-95(e2e) | Geschwindigkeit CPU ONNX (ms) | Geschwindigkeit T4 TensorRT10 (ms) | Parameter (M) | FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO26n | 640 | 40,9 | 40,1 | 38,9 ± 0,7 | 1,7 ± 0,0 | 2,4 | 5,4 |
| YOLO26s | 640 | 48,6 | 47,8 | 87,2 ± 0,9 | 2,5 ± 0,0 | 9,5 | 20,7 |
| YOLO26m | 640 | 53,1 | 52,5 | 220,0 ± 1,4 | 4,7 ± 0,1 | 20,4 | 68,2 |
| YOLO26l | 640 | 55,0 | 54,4 | 286,2 ± 2,0 | 6,2 ± 0,2 | 24,8 | 86,4 |
| YOLO26x | 640 | 57,5 | 56,9 | 525,8 ± 4,0 | 11,8 ± 0,2 | 55,7 | 193,9 |
- mAPval-Werte gelten für Einzelmodelle mit einer Skalierung auf dem COCO val2017-Datensatz.
Reproduziere dies mityolo val detect data=coco.yaml device=0 - Geschwindigkeit gemittelt über COCO val-Bilder unter Verwendung einer Amazon EC2 P4d-Instanz.
Reproduziere dies mityolo val detect data=coco.yaml batch=1 device=0|cpu - Params- und FLOPs-Werte beziehen sich auf das fusionierte Modell nach
model.fuse(), welches Conv- und BatchNorm-Layer zusammenführt und bei End-to-End-Modellen den zusätzlichen One-to-Many-Detection-Head entfernt. Vortrainierte Checkpoints behalten die vollständige Trainingsarchitektur bei und können höhere Anzahlen aufweisen.
Link to this sectionTrainieren#
Trainiere YOLO26n auf dem COCO8-Datensatz für 100 Epochen bei einer Bildgröße von 640. Eine vollständige Liste der verfügbaren Argumente findest du auf der Seite Konfiguration.
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.yaml") # build a new model from YAML
model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training)
model = YOLO("yolo26n.yaml").load("yolo26n.pt") # build from YAML and transfer weights
# Train the model
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)Siehe vollständige Details zum train-Modus auf der Train-Seite. Erkennungsmodelle können auch auf Cloud-GPUs über die Ultralytics Platform trainiert werden.
Link to this sectionDatensatzformat#
Das YOLO-Datensatzformat für die Erkennung findest du im Detail im Datensatz-Leitfaden. Um deinen bestehenden Datensatz aus anderen Formaten (wie COCO usw.) in das YOLO-Format zu konvertieren, verwende bitte das JSON2YOLO-Tool von Ultralytics. Du kannst Erkennungsdatensätze auch direkt auf der Ultralytics Platform mit KI-gestützten Labeling-Tools annotieren und verwalten.
Link to this sectionValidieren#
Validiere die Genauigkeit des trainierten YOLO26n-Modells auf dem COCO8-Datensatz. Es sind keine Argumente erforderlich, da das model seine Trainings-data und Argumente als Modellattribute beibehält.
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.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 containing mAP50-95 for each category
metrics.box.image_metrics # per-image metrics dictionary with precision, recall, F1, TP, FP, and FNLink to this sectionVorhersagen#
Verwende ein trainiertes YOLO26n-Modell, um Vorhersagen auf Bildern auszuführen.
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom model
# Predict with the model
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
# Access the results
for result in results:
xywh = result.boxes.xywh # center-x, center-y, width, height
xywhn = result.boxes.xywhn # normalized
xyxy = result.boxes.xyxy # top-left-x, top-left-y, bottom-right-x, bottom-right-y
xyxyn = result.boxes.xyxyn # normalized
names = [result.names[cls.item()] for cls in result.boxes.cls.int()] # class name of each box
confs = result.boxes.conf # confidence score of each boxSiehe vollständige Details zum predict-Modus auf der Predict-Seite.
Link to this sectionErgebnisausgabe#
Objekterkennung liefert ein Results-Objekt pro Bild. Das primäre Vorhersagefeld ist result.boxes, welches Koordinaten der Boxen, Klassen-IDs und Konfidenzwerte für jedes erkannte Objekt enthält.
| Attribut | Typ | Form | Beschreibung |
|---|---|---|---|
result.boxes | Boxes | (N) | Erkennungsboxen. |
result.boxes.data | torch.float32 | (N,6/7) | Rohdaten [x1,y1,x2,y2,conf,cls], plus optionale Track-ID. |
result.boxes.xyxy | torch.float32 | (N,4) | xyxy Pixelboxen. |
result.boxes.conf | torch.float32 | (N,) | Konfidenzwerte. |
result.boxes.cls | torch.float32 | (N,) | Klassen-IDs; für Namen in int umwandeln. |
Für aufgaben-spezifische Results-Felder für jede Aufgabe siehe den Abschnitt Vorhersageergebnisse nach Aufgabe.
Link to this sectionExportieren#
Exportiere ein YOLO26n-Modell in ein anderes Format wie ONNX, CoreML usw.
from ultralytics import YOLO
# Load a model
model = YOLO("yolo26n.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom-trained model
# Export the model
model.export(format="onnx")Verfügbare YOLO26-Exportformate findest du in der Tabelle unten. Du kannst in jedes Format exportieren, indem du das format-Argument verwendest, d. h. format='onnx' oder format='engine'. Du kannst Vorhersagen oder Validierungen direkt auf exportierten Modellen durchführen, d. h. yolo predict model=yolo26n.onnx. Anwendungsbeispiele werden nach Abschluss des Exports für dein Modell angezeigt.
| Format | format-Argument | Modell | Metadaten | Argumente |
|---|---|---|---|---|
| PyTorch | - | yolo26n.pt | ✅ | - |
| TorchScript | torchscript | yolo26n.torchscript | ✅ | imgsz, half, dynamic, optimize, nms, batch, device |
| ONNX | onnx | yolo26n.onnx | ✅ | imgsz, half, int8, dynamic, simplify, opset, nms, batch, data, fraction, device |
| OpenVINO | openvino | yolo26n_openvino_model/ | ✅ | imgsz, half, dynamic, int8, nms, batch, data, fraction, device |
| TensorRT | engine | yolo26n.engine | ✅ | imgsz, half, dynamic, simplify, workspace, int8, nms, batch, data, fraction, device |
| CoreML | coreml | yolo26n.mlpackage | ✅ | imgsz, dynamic, half, int8, nms, batch, device |
| TF SavedModel | saved_model | yolo26n_saved_model/ | ✅ | imgsz, keras, int8, nms, batch, data, fraction, device |
| TF GraphDef | pb | yolo26n.pb | ❌ | imgsz, batch, device |
| TF Lite | tflite | yolo26n.tflite | ✅ | imgsz, half, int8, nms, batch, data, fraction, device |
| TF Edge TPU | edgetpu | yolo26n_edgetpu.tflite | ✅ | imgsz, int8, data, fraction, device |
| TF.js | tfjs | yolo26n_web_model/ | ✅ | imgsz, half, int8, nms, batch, data, fraction, device |
| PaddlePaddle | paddle | yolo26n_paddle_model/ | ✅ | imgsz, batch, device |
| MNN | mnn | yolo26n.mnn | ✅ | imgsz, batch, int8, half, device |
| NCNN | ncnn | yolo26n_ncnn_model/ | ✅ | imgsz, half, batch, device |
| IMX500 | imx | yolo26n_imx_model/ | ✅ | imgsz, int8, data, fraction, nms, device |
| RKNN | rknn | yolo26n_rknn_model/ | ✅ | imgsz, batch, name, int8, data, fraction, device |
| ExecuTorch | executorch | yolo26n_executorch_model/ | ✅ | imgsz, batch, device |
| Axelera | axelera | yolo26n_axelera_model/ | ✅ | imgsz, batch, int8, data, fraction, device |
| DEEPX | deepx | yolo26n_deepx_model/ | ✅ | imgsz, int8, data, optimize, device |
| Qualcomm QNN | qnn | yolo26n_qnn.onnx | ✅ | imgsz, batch, name, int8, data, fraction, device |
Siehe vollständige export Details auf der Export Seite.
Link to this sectionFAQ#
Link to this sectionKann ich Erkennungsmodelle ohne Programmierung trainieren und bereitstellen?#
Ja. Die Ultralytics Platform bietet einen browserbasierten Arbeitsablauf zum Annotieren von Datensätzen, Trainieren von Erkennungsmodellen auf Cloud-GPUs und deren Bereitstellung für Inferenz-Endpunkte. Siehe den Plattform-Schnellstart, um loszulegen.
Link to this sectionWie trainiere ich ein YOLO26-Modell auf meinem eigenen Datensatz?#
Das Training eines YOLO26-Modells auf einem benutzerdefinierten Datensatz umfasst einige Schritte:
- Datensatz vorbereiten: Stelle sicher, dass dein Datensatz im YOLO-Format vorliegt. Hinweise dazu findest du in unserem Datensatz-Leitfaden.
- Modell laden: Verwende die Ultralytics YOLO-Bibliothek, um ein vortrainiertes Modell zu laden oder ein neues Modell aus einer YAML-Datei zu erstellen.
- Modell trainieren: Führe die
train-Methode in Python oder denyolo detect train-Befehl in der CLI aus.
from ultralytics import YOLO
# Load a pretrained model
model = YOLO("yolo26n.pt")
# Train the model on your custom dataset
model.train(data="my_custom_dataset.yaml", epochs=100, imgsz=640)Für detaillierte Konfigurationsoptionen besuche die Seite Konfiguration.
Link to this sectionWelche vortrainierten Modelle sind in YOLO26 verfügbar?#
Ultralytics YOLO26 bietet verschiedene vortrainierte Modelle für Objekterkennung, Instanzsegmentierung, semantische Segmentierung und Pose-Schätzung. Diese Modelle sind auf dem COCO-Datensatz, Cityscapes für semantische Segmentierung oder ImageNet für Klassifizierungsaufgaben vortrainiert. Hier sind einige der verfügbaren Modelle:
Für eine detaillierte Liste und Leistungsmetriken siehe den Bereich Modelle.
Link to this sectionWie kann ich die Genauigkeit meines trainierten YOLO-Modells validieren?#
Um die Genauigkeit deines trainierten YOLO26-Modells zu validieren, kannst du die .val()-Methode in Python oder den yolo detect val-Befehl in der CLI verwenden. Dies liefert Metriken wie mAP50-95, mAP50 und mehr.
from ultralytics import YOLO
# Load the model
model = YOLO("path/to/best.pt")
# Validate the model
metrics = model.val()
print(metrics.box.map) # mAP50-95Für weitere Validierungsdetails besuche die Seite Val.
Link to this sectionIn welche Formate kann ich ein YOLO26-Modell exportieren?#
Ultralytics YOLO26 ermöglicht das Exportieren von Modellen in verschiedene Formate wie ONNX, TensorRT, CoreML und mehr, um die Kompatibilität über verschiedene Plattformen und Geräte hinweg sicherzustellen.
from ultralytics import YOLO
# Load the model
model = YOLO("yolo26n.pt")
# Export the model to ONNX format
model.export(format="onnx")Überprüfe die vollständige Liste der unterstützten Formate und Anweisungen auf der Seite Export.
Link to this sectionWarum sollte ich Ultralytics YOLO26 für die Objekterkennung verwenden?#
Ultralytics YOLO26 wurde entwickelt, um modernste Leistung für Objekterkennung, Instanzsegmentierung, semantische Segmentierung und Pose-Schätzung zu bieten. Hier sind einige wichtige Vorteile:
- Vortrainierte Modelle: Nutze Modelle, die auf gängigen Datensätzen wie COCO und ImageNet vortrainiert wurden, für eine schnellere Entwicklung.
- Hohe Genauigkeit: Erreicht beeindruckende mAP-Werte und sorgt für eine zuverlässige Objekterkennung.
- Geschwindigkeit: Optimiert für Echtzeit-Inferenz, was es ideal für Anwendungen macht, die eine schnelle Verarbeitung erfordern.
- Flexibilität: Exportiere Modelle in verschiedene Formate wie ONNX und TensorRT für die Bereitstellung auf mehreren Plattformen.
Entdecke unseren Blog für Anwendungsfälle und Erfolgsgeschichten, die YOLO26 im Einsatz zeigen.