Roboflow

YOLOS Overview

YOLOS (You Only Look at One Sequence) is a transformer-based object detection model widely distributed through Hugging Face Transformers, released in June 2021 under the MIT license. It applies a minimally adapted Vision Transformer to object detection by representing both the image and detection tokens as a flat sequence processed by standard multi-head self-attention, without convolutional components or feature pyramid networks. The architecture demonstrates that detection can be performed without region proposals or multi-scale feature fusion.

YOLOS achieves moderate performance on COCO relative to purpose-built detectors, with its primary contribution being a demonstration of the transferability of ViT pre-training to detection tasks. It is most appropriate for research contexts exploring transformer-based detection architectures and for scenarios where architectural simplicity is preferred over peak accuracy.

YOLOS Details & Performance

Vision Tasks

Object Detection

Features

Real-Time Vision

Usage

Past 30 Days

Not available

Not in Playground

Performance

Avg. Latency

Arena Rankings

Not yet ranked in arena

YOLOS Explained

YOLOS (You Only Look At One Sequence) is an object detection model that applies the Vision Transformer architecture to detection tasks. It was designed to explore how transformer-based sequence modeling can replace convolutional backbones in object recognition.

YOLOS uses a Vision Transformer (ViT) style backbone instead of a convolutional neural network. Images are split into patches, which are treated as a sequence of tokens, similar to text tokens in NLP transformers.

The model consists of:

  • A transformer encoder that processes a sequence of image patch embeddings.
  • A detector head that maps the resulting sequence of detection representations to class labels and bounding box predictions.

YOLOS is considered a YOLO model because it processes the sequence of image patches once to produce detections, in line with the “You Only Look Once” paradigm.

Diagram of the YOLOS transformer encoder and detection head architecture
The YOLOS model architecture

Before YOLOS, YOLO models used convolutional neural networks as their backbone to extract image features. Different YOLO variants changed the exact CNN design, but all built the detection neck on top of a CNN backbone.

YOLOS differs from these models in several ways:

  • The backbone is a transformer encoder instead of a CNN.
  • Image patches are treated as a sequence, similar to tokens in NLP models.
  • Aside from the single-pass detection concept, the YOLOS network architecture does not share other structural components with previous YOLO models.

Transformers were first introduced for NLP in the “Attention is All You Need” paper and became a standard approach for sequence modeling. They are widely used to process sequences of text.

Later, transformers were adapted to computer vision through the Vision Transformer (ViT), which set new standards in image classification at the time. ViT treats an image as a sequence of patches, analogous to sequences of text tokens in models such as GPT and BERT.

YOLOS extends this idea from classification to object detection by using a ViT-style encoder as the backbone and adding a detection head.

The Vision Transformer for image classification
The Vision Transformer for image classification

YOLOS was not designed to be state of the art in accuracy. The original research positioned it as an exploration of transformers for object detection rather than a benchmark leader.

On the COCO dataset:

  • The YOLOS-B variant, reported as the best performing YOLOS model in the referenced summary, achieved an Average Precision (AP) of 42.0.
  • This result used 1000 pre-training epochs followed by 150 fine-tuning epochs.

Compared to other YOLO models on COCO:

  • The most performant YOLOS variant achieved 42.0 AP.
  • YOLOv7 E6E, which was a state-of-the-art model in November 2022, achieved 56.8 AP.
  • YOLOS does not reach the AP of YOLOv4 and more recent YOLO variants when benchmarked on COCO.

These comparisons indicate that YOLOS is primarily a research model for transformer-based detection rather than a leading choice for maximum accuracy.

Benchmark comparison of YOLOS vs YOLOv3-Tiny, YOLOv4-Tiny, and YOLOv7 E6E on COCO AP
YOLOS evaluation relative to comparable YOLO models (YOLOv3-Tiny, YOLOv4-Tiny)

YOLOS can be trained on custom datasets using the approach described in its original resources and repository. The training process follows the transformer-based design, with long pre-training and fine-tuning schedules reported for the YOLOS-B result on COCO.

For users whose main goal is the highest available performance on a custom dataset, other YOLO variants such as YOLOv5 are typically recommended over YOLOS. YOLOS is more suitable when the objective is to study or apply transformer-based architectures for object detection.

YOLOS is most appropriate in the following scenarios:

  • Research on transformer architectures for vision and detection.
  • Experiments that compare CNN backbones and transformer backbones within the YOLO paradigm.
  • Educational use to understand how ViT-style models can be adapted from classification to detection.

For production deployments that prioritize accuracy or mature ecosystem support, other YOLO models are generally preferred over YOLOS.

Alternatives to YOLOS

Other models worth comparing for similar use cases.

Meta
DETR
DETR (Detection Transformer) is an end-to-end object detection model developed by Facebook Research (Meta), released in May 2020. It is one of the first models to eliminate hand-crafted components such as anchor generation and non-maximum suppression by framing object detection as a direct set prediction problem, solved with a transformer encoder-decoder architecture built on top of a CNN backbone.DETR achieves 42.0% AP on the COCO benchmark with a ResNet-50 backbone, performing comparably to a well-tuned Faster R-CNN at the time of release. Its attention-based design allows it to reason about global context and long-range dependencies within an image. DETR is primarily used as a research baseline and architectural reference, with subsequent works such as Deformable DETR and DINO building on its foundations to address its slower training convergence and limited small-object detection capability.
Baidu
RT-DETR
RT-DETR (Real-Time Detection Transformer) is an object detection model developed by Baidu, released in April 2023 under the Apache 2.0 license. It is the first transformer-based real-time object detector, addressing the inference speed limitations of earlier DETR models through an efficient hybrid encoder that decouples intra-scale interaction and cross-scale fusion, enabling the model to process multi-scale features without the high computational overhead of standard transformer encoders.RT-DETR achieves 53.1% AP on COCO at 108 FPS on an NVIDIA T4 GPU for the RT-DETR-L variant, outperforming comparably sized YOLO detectors at similar speeds. It maintains end-to-end inference without non-maximum suppression, simplifying deployment pipelines. RT-DETR established the baseline for real-time transformer detection and has been extended by subsequent works including RF-DETR and RT-DETRv2.
RF-DETR
RF-DETR is a real-time transformer-based object detection model developed by Roboflow, with code and weights first released in March 2025 under the Apache 2.0 license. It is the first real-time model to exceed 60 AP on the Microsoft COCO benchmark, built on a DINOv2 vision transformer backbone with weight-sharing neural architecture search used to identify accuracy-latency trade-offs. The full family spans six sizes from Nano (30.5M parameters, 384×384 input) to 2XL (126.9M parameters, 880×880 input), with the accompanying research paper accepted to ICLR 2026.RF-DETR is designed for strong domain adaptability, achieving state-of-the-art performance on RF100-VL, a benchmark measuring generalization to real-world object detection tasks across diverse domains. It is deployable through Roboflow Inference and supports fine-tuning on custom datasets, making it well suited for domain-specific applications with limited training data.
D-FINE
D-FINE is a real-time object detection model introduced in October 2024 by researchers at the University of Science and Technology of China. It builds on the DETR family of transformer-based detectors by reformulating bounding box regression as a Fine-grained Distribution Refinement task. Rather than predicting box coordinates directly, D-FINE iteratively refines probability distributions over coordinate offsets across decoder layers, which provides finer localization granularity without adding inference cost. The architecture also replaces the encoder's CSP blocks with GELAN modules and inserts a Target Gating Layer after the decoder's cross-attention to reduce representational entanglement across queries. A second contribution, Global Optimal Localization Self-Distillation, transfers localization knowledge from refined deeper-layer predictions back to earlier decoder layers through internal self-distillation.D-FINE is released in five model sizes (Nano, Small, Medium, Large, and X), with D-FINE-L achieving 54.0% AP on the Microsoft COCO benchmark at 124 FPS on an NVIDIA T4 GPU, and D-FINE-X reaching 55.8% AP at 78 FPS. Pretraining on the Objects365 dataset further improves accuracy to 57.1% AP for the L variant and 59.3% AP for the X variant. The paper was accepted at ICLR 2025 as a Spotlight. Code and pretrained weights are released under the Apache 2.0 license, making the model suitable for commercial use.
Co-DETR
Co-DETR (Co-Deformable-DETR) is an object detection model developed by researchers at Sense-X and OpenMMLab, released in November 2022. It improves upon standard DETR-based detectors by introducing a collaborative hybrid assignment training scheme that enables the encoder to learn from multiple auxiliary heads simultaneously, alongside the primary one-to-one assignment used during inference. This auxiliary supervision significantly accelerates convergence and improves overall detection accuracy without adding inference cost.Co-DETR is evaluated on the COCO benchmark, where it achieves 59.5% AP when applied to DINO-Deformable-DETR with a Swin-L backbone. With a ViT-L backbone it reaches 66.0% AP on COCO test-dev, outperforming prior methods at comparable model scales. It is suitable for high-accuracy object detection tasks where training efficiency and peak performance on standard benchmarks are priorities.
YOLOX
YOLOX is an anchor-free object detection model developed by Megvii (Face++), released in July 2021 under the Apache 2.0 license. It applies anchor-free detection to the YOLO framework, decoupling the classification and regression heads to allow each to optimize independently, and introduces the SimOTA label assignment strategy for improved training convergence. YOLOX achieves strong accuracy-speed tradeoffs and outperforms YOLOv5 on COCO at comparable model sizes.YOLOX-L achieves 50.0% AP on COCO at 68.9 FPS on an NVIDIA V100 GPU. The model is available in a range of sizes from YOLOX-Nano to YOLOX-X and supports deployment through ONNX, TensorRT, and other standard export formats. It is suitable for real-time object detection applications and has been widely adopted in industrial and research detection pipelines.

YOLOS License

MIT

License terms and commercial-use guidance for YOLOS.

This model is released under the MIT License, a short and permissive open-source license that allows commercial use, modification, and redistribution.

Read the full MIT license ↗

Yes. Under the terms of the MIT license, you can freely use this model for commercial purposes. You must retain the copyright notice and license text when redistributing.

License information is provided as a guide and is not legal advice.