RTDETRv2 im Vergleich zu YOLOX
Entwickler, die Echtzeit-Objekterkennungssysteme entwickeln, können aus vielen Architekturen wählen. Zwei bemerkenswerte Modelle sind der Transformer-basierte RTDETRv2 und das YOLOX, ein faltungsbasiertes neuronales Netz (CNN). Beide haben die Echtzeit-Detektion vorangebracht, verfolgen bei der visuellen Erkennung jedoch grundlegend unterschiedliche Ansätze.
Dieser Leitfaden behandelt die Architektur, Leistungskennzahlen und idealen Einsatzszenarien beider Modelle und zeigt, wie Ultralytics YOLO26 auf diesen Grundlagen aufbaut, um Genauigkeit, Effizienz und Benutzerfreundlichkeit zu verbessern.
RTDETRv2: Transformer für Echtzeit-Erkennung#
RTDETRv2 wurde als Nachfolger des ursprünglichen RT-DETR eingeführt und nutzt für die Echtzeit-Objekterkennung eine Transformer-Architektur. Da kein Non-Maximum Suppression (NMS) erforderlich ist, wird die Inferenzpipeline vereinfacht.
- Autoren: Wenyu Lv, Yian Zhao, Qinyao Chang, Kui Huang, Guanzhong Wang und Yi Liu
- Organisation: Baidu
- Datum: 2024-07-24
- Links: arXiv-Arbeit, offizielles GitHub-Repository, Dokumentation
Architektur und Design#
RTDETRv2 nutzt die Selbstaufmerksamkeitsmechanismen von Transformern, um den globalen Kontext des gesamten Bildes zu erfassen. Dadurch kann das Modell Begrenzungsrahmen und Klassenwahrscheinlichkeiten direkt vorhersagen. Seine Merkmale auf mehreren Skalen helfen dabei, kleine Objekte in unübersichtlichen Umgebungen zu erkennen.
Transformer erfassen den globalen Kontext sehr gut, doch ihr Selbstaufmerksamkeitsmechanismus skaliert quadratisch mit der Sequenzlänge. Beim Training führt das im Vergleich zu herkömmlichen CNNs häufig zu einem deutlich höheren CUDA-Speicherverbrauch.
Stärken und Schwächen#
Die größte Stärke von RTDETRv2 ist sein nativ durchgängiges Design. Durch den Verzicht auf NMS vermeidet das Modell Latenzspitzen, die mit dichten, überlappenden Vorhersagen einhergehen. Die Transformer-Blöcke sind jedoch rechenintensiv und benötigen sowohl beim Training als auch beim Einsatz erhebliche GPU-Ressourcen. Daher eignet sich RTDETRv2 weniger für Edge-Geräte mit knappen Ressourcen oder ältere Mobilgeräte.
YOLOX: Fortschritte bei ankerfreien CNNs#
YOLOX wurde entwickelt, um die Lücke zwischen akademischer Forschung und industrieller Anwendung zu schließen. Das Modell führte einen entkoppelten Kopf und ein ankerfreies Design in die beliebte YOLO-Modellfamilie ein.
- Autoren: Zheng Ge, Songtao Liu, Feng Wang, Zeming Li und Jian Sun
- Organisation: Megvii
- Datum: 18. Juli 2021
- Links: arXiv-Arbeit, offizielles GitHub-Repository, Dokumentation
Architektur und Design#
YOLOX weicht von herkömmlichen Detektoren mit Ankern ab und sagt Objektpositionen direkt voraus, ohne vorgegebene Ankerrahmen zu verwenden. Das vereinfacht den Netzwerkaufbau und verringert die Zahl der heuristischen Parameter, die für eine optimale Leistung angepasst werden müssen. Außerdem nutzt YOLOX einen entkoppelten Kopf, der Klassifizierung und Regression voneinander trennt und so die Konvergenz während des Trainings beschleunigt.
Stärken und Schwächen#
Dank seines ankerfreien Designs lässt sich YOLOX an verschiedene Computer-Vision-Aufgaben anpassen und einfacher mit benutzerdefinierten Datensätzen trainieren. Die kleinsten Varianten wie YOLOX-Nano eignen sich für Mobilgeräte und stromsparende IoT-Geräte. YOLOX stammt jedoch aus der Zeit vor NMS-freien Detektoren und nutzt weiterhin NMS zur Nachbearbeitung, was den Einsatz in dichten Szenen komplexer und langsamer macht.
Leistungs- und Metrikvergleich#
Die folgende Tabelle vergleicht Geschwindigkeit, Genauigkeit (mAP) und Parametereffizienz bei verschiedenen Modellgrößen auf dem COCO-Datensatz.
| Modell | Größe (Pixel) | mAPval50-95 | Geschwindigkeit CPU ONNX (ms) | Geschwindigkeit T4 TensorRT10 (ms) | Parameter (M) | FLOPs (B) |
|---|---|---|---|---|---|---|
| RTDETRv2-s | 640 | 48.1 | - | 5.03 | 20 | 60 |
| RTDETRv2-m | 640 | 51.9 | - | 7.51 | 36 | 100 |
| RTDETRv2-l | 640 | 53.4 | - | 9.76 | 42 | 136 |
| RTDETRv2-x | 640 | 54.3 | - | 15.03 | 76 | 259 |
| YOLOXnano | 416 | 25.8 | - | - | 0.91 | 1.08 |
| YOLOXtiny | 416 | 32.8 | - | - | 5.06 | 6.45 |
| YOLOXs | 640 | 40.5 | - | 2.56 | 9.0 | 26.8 |
| YOLOXm | 640 | 46.9 | - | 5.43 | 25.3 | 73.8 |
| YOLOXl | 640 | 49.7 | - | 9.04 | 54.2 | 155.6 |
| YOLOXx | 640 | 51.1 | - | 16.1 | 99.1 | 281.9 |
RTDETRv2 ist bei jeder vergleichbaren Größe genauer. RTDETRv2-x erreicht 54,3 mAP gegenüber 51,1 bei YOLOXx und ist auf einer T4-GPU außerdem schneller (15,03 ms gegenüber 16,1 ms) und hat weniger Parameter (76 Mio. gegenüber 99,1 Mio.). YOLOX ist bei den kleinen Modellen im Vorteil: YOLOXs benötigt 2,56 ms und hat 9,0 Mio. Parameter (40,5 mAP). YOLOX-Nano und YOLOX-Tiny bieten zudem Optionen mit weniger als 6 Mio. Parametern, die RTDETRv2 nicht hat.
Der Ultralytics-Vorteil: YOLO26 ist da#
Viele Projekte benötigen ein einzelnes Modell, das hohe Genauigkeit, schnelle Inferenz und ein zugängliches Ökosystem vereint. Ultralytics YOLO26, veröffentlicht im Januar 2026, wurde genau dafür entwickelt.
Wichtige Neuerungen von YOLO26#
- End-to-End-Design ohne NMS: Aufbauend auf dem NMS-freien Training, das YOLOv10 in YOLO-Modelle eingeführt hat, bietet YOLO26 optional einen NMS-freien Kopf (
nms=False). Damit erhältst du die End-to-End-Inferenz von RTDETRv2 ohne den hohen Speicherbedarf von Transformern. - MuSGD-Optimierer: Der hybride MuSGD-Optimierer, der von der Schulung großer Sprachmodelle (LLM) inspiriert ist und SGD mit Muon kombiniert, stabilisiert das Training und beschleunigt die Konvergenz.
- Bis zu 43 % schnellere CPU-Inferenz: Durch den Wegfall des Distribution-Focal-Loss-Moduls (DFL) wird der Kopf vereinfacht und eignet sich besser für Edge Computing und stromsparende Geräte. Dadurch ist YOLO26n auf der CPU (ONNX) bis zu 43 % schneller als YOLO11n.
- ProgLoss + STAL: Progressive Loss und Small-Target-Aware Label Assignment (STAL) verbessern die Erkennung kleiner Objekte, die bei Luftaufnahmen und in Robotikanwendungen häufig eine Herausforderung darstellt.
Vielseitigkeit und Ökosystem#
Über die reine Leistung hinaus deckt die Ultralytics Platform den gesamten Weg von den Daten bis zum Produktivbetrieb ab. Anders als statische wissenschaftliche Repositories werden Ultralytics-Modelle aktiv gepflegt und unterstützen mehrere Aufgaben über eine einzige API. Ob du Instanzsegmentierung, Posenschätzung oder die Erkennung orientierter Begrenzungsrahmen (OBB) ausführst – der Arbeitsablauf bleibt derselbe.
Ultralytics-YOLO-Modelle haben auch beim Training und bei der Inferenz einen geringen Speicherbedarf. Daher können Forschende auf handelsüblicher Hardware größere Stapelgrößen verwenden, als es speicherintensive Transformer-Architekturen erlauben.
Codebeispiel für das Training#
Das Training eines YOLO26-Modells erfordert nur wenige Codezeilen. Das Ultralytics-Paket übernimmt das Laden der Daten und die standardmäßige Konfiguration der Hyperparameter.
from ultralytics import YOLO
# Initialize the YOLO26 Nano model
model = YOLO("yolo26n.pt")
# Train the model on the standard COCO8 dataset
results = model.train(data="coco8.yaml", epochs=100, imgsz=640, batch=16)
# Validate the model's performance
metrics = model.val()
print(f"Validation mAP: {metrics.box.map}")
# Export to ONNX or TensorRT for rapid deployment
model.export(format="engine", device=0)Anwendungen in der Praxis und ideale Einsatzbereiche#
Die Wahl der passenden Architektur hängt von den Einschränkungen deiner Bereitstellungsumgebung und der verfügbaren Hardware ab.
Hochpräzise Verarbeitung in der Cloud#
Wenn deine Anwendung auf leistungsstarken Server-GPUs läuft und maximale Genauigkeit erfordert – etwa bei der Analyse dichter Menschenmengen oder hochauflösender medizinischer Aufnahmen –, können die Aufmerksamkeitsmechanismen von RTDETRv2 effektiv sein.
Einsatz auf älteren Edge-Geräten#
Für ältere Mobiltelefone oder stark eingeschränkte eingebettete Hardware, bei der eine minimale FLOP-Zahl zwingend erforderlich ist, bleibt das leichte YOLOX-Nano (0,91 Mio. Parameter, 1,08 Mrd. FLOPs) dank seiner einfachen CNN-Architektur eine brauchbare Alternative.
Der moderne Standard: AIoT und Robotik#
Für die meisten modernen Anwendungsfälle, darunter Smart-City-Infrastruktur, Einzelhandelsanalysen und autonome Navigation, empfehlen wir Ultralytics YOLO26. Die bis zu 43 % schnellere CPU-Inferenz von YOLO26n gegenüber YOLO11n eignet sich für Edge Computing, und sein optionaler NMS-freier Kopf sorgt für geringe, gleichmäßige Latenz. Zusammen mit der Ultralytics-Dokumentation und der aktiven Community hilft es Teams, schnell von der Datensatzannotation bis zum Einsatz zu gelangen.
Nutze die Ultralytics Platform, um Datensätze zu verwalten, Modelle in der Cloud zu trainieren und sie in großem Maßstab bereitzustellen.
Zu den weiteren Ultralytics-Modellen, die du in Betracht ziehen kannst, gehören YOLOv8 mit seinen umfangreichen Community-Integrationen und YOLOv5, das in älteren Pipelines weiterhin stabil läuft. Für neue Projekte empfehlen wir YOLO26 als Ausgangspunkt.
Kommentare6
Stell eine Frage, teile deine Ergebnisse oder hilf jemand anderem.
UltralyticsAssistantUltralytics
👋 Hello, thank you for opening a discussion and engaging with Ultralytics 🚀! For new users, we recommend visiting the Docs where you'll find detailed Python and CLI usage examples, as well as answers to many common questions.
If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us investigate further.
If your question is about custom training or model comparison ❓, please share as much detail as possible—such as dataset samples, training logs, or what specific performance metrics you're interested in. Don't forget to check out our Tips for Best Training Results for optimal guidance.
Join the Ultralytics community where you feel most comfortable:
- For real-time chat, head to Discord 🎧
- For in-depth discussions, visit Discourse
- Or explore threads on our Subreddit to share and learn with others
Upgrade
Please ensure you're using the latest
ultralyticspackage and all requirements in a Python>=3.8 environment with PyTorch>=1.8:pip install -U ultralyticsEnvironments
YOLO models can be run in any of the following up-to-date verified environments (with all dependencies, including CUDA/CUDNN, Python and PyTorch preinstalled):
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
Status
If this badge is green, all Ultralytics CI tests are currently passing! CI tests verify correct operation of all YOLO Modes and Tasks across macOS, Windows, and Ubuntu every 24 hours and on every commit.
This is an automated response and an Ultralytics engineer will assist you soon 😊
Glenn JocherUltralytics(bearbeitet)This page offers a valuable comparison between RTDETRv2 and YOLOX, highlighting their different strengths. If you have specific questions about these models, feel free to ask here. RTDETRv2 excels in accuracy (reaching 54.3% mAP) but demands more computational resources, while YOLOX stands out for efficiency and speed, making it ideal for edge devices. For those seeking alternatives with a balance of performance and usability, you might also consider Ultralytics YOLO26, which offers excellent performance across various computer vision tasks. What specific aspect of these models are you most interested in learning more about?
UltralyticsAssistantUltralytics
👋 Hello, thank you for starting this comparison discussion about RTDETRv2 and YOLOX! 🚀 For detailed guidance, we recommend checking out our Docs, which contain in-depth information, benchmarks, and usage examples that may help answer many of your questions.
If this is a 🐛 Bug Report, please provide a minimum reproducible example so we can assist you efficiently.
For model training or evaluation ❓ Questions, please share as many details as possible, such as dataset samples, training logs, or specific requirements, and review our Tips for Best Training Results.
Join the Ultralytics community in your preferred space! For real-time chat, visit our Discord 🎧. For topic-based discussions, check out Discourse, or connect with others on our Subreddit.
Upgrade
Make sure your
ultralyticspackage and all requirements are up to date in a Python>=3.8 environment with PyTorch>=1.8:pip install -U ultralyticsEnvironments
YOLO models can be run in these verified environments:
- Notebooks with free GPU:
- Google Cloud Deep Learning VM: GCP Quickstart Guide
- Amazon Deep Learning AMI: AWS Quickstart Guide
- Docker Image: Docker Quickstart Guide
Status
A green badge means all Ultralytics CI tests are passing. CI covers all YOLO Modes and Tasks across macOS, Windows, and Ubuntu.
This is an automated response 🤖. An Ultralytics engineer will review your discussion and provide further assistance soon!
Glenn JocherUltralytics(bearbeitet)Welcome to the RTDETRv2 vs YOLOX comparison discussion! This page highlights two powerful object detection approaches with different strengths: RTDETRv2 leverages transformer architecture for higher accuracy in complex scenes (54.3% mAP for RTDETRv2-x), while YOLOX offers exceptional efficiency with faster inference speed (2.56ms for YOLOX-s on T4 TensorRT).
Your use case should guide your choice - RTDETRv2 excels when maximum accuracy is critical and GPU resources are available, while YOLOX is ideal for edge devices and real-time applications with limited resources.
If you're looking for models within a comprehensive ecosystem, you might also consider Ultralytics YOLO26 which balances performance with ease of use.
Feel free to post any questions about these models or their implementation in your specific applications. The Ultralytics team is here to help!
- Notebooks with free GPU:
UltralyticsAssistantUltralytics
👋 Hello, thank you for starting this discussion and sharing your interest in comparing object detection models like RTDETRv2 and YOLOX 🚀! For a detailed overview, the Ultralytics Docs offer a wealth of information, including the comparison page you linked, which highlights model strengths, performance, and use cases.
If you have specific questions or encounter any issues related to these models, please provide as much detail as possible.
- If this is a 🐛 Bug Report, please include a minimum reproducible example to help us assist you.
- For custom training ❓ questions, adding dataset samples and training logs can be very helpful. Make sure to review our Training Tips for best results.
Connect with the Ultralytics community in your preferred way! For real-time help, join our Discord 🎧. In-depth posts and discussions are found on Discourse, and our Subreddit is great for sharing experiences and solutions.
Upgrade
To ensure the best experience and access to the latest features and fixes, please upgrade the
ultralyticspackage and all requirements in a Python>=3.8 environment with PyTorch>=1.8:pip install -U ultralyticsEnvironments
YOLO models can be run in any of these verified environments with all dependencies preinstalled:
- Notebooks with free GPU:
- Google Cloud Deep Learning VM (GCP Quickstart Guide)
- Amazon Deep Learning AMI (AWS Quickstart Guide)
- Docker Image (Docker Quickstart Guide)
Status
A green badge means all Ultralytics CI tests are passing, ensuring YOLO Modes and Tasks work across macOS, Windows, and Ubuntu.
This is an automated response 🤖—an Ultralytics engineer will review your discussion and assist you soon!
Glenn JocherUltralytics(bearbeitet)Welcome to the discussion about RTDETRv2 and YOLOX object detection models! Both offer different strengths - RTDETRv2 provides higher accuracy through its transformer architecture, while YOLOX excels in speed and efficiency on resource-constrained devices.
If you have specific questions about implementing either model, performance tuning, or need help choosing between them for your particular use case, please share your questions here. Our team monitors these discussions to provide technical guidance and support.
For hands-on users interested in similar models with Ultralytics integration, YOLO26 offers an excellent balance of speed and accuracy with full support in our ecosystem.