Roboflow

HuggingFaceHugging FaceReleased Jun 2021MIT

YOLOS

We don't benchmark YOLOS.

It is an open-weight model from Hugging Face under the MIT license, and free for commercial use.

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 License

MIT · Permissive license

YOLOS is released under MIT, a permissive license. The YOLOS license lets you use, modify, and sell work built on the model, with the copyright notice as the only real obligation and no requirement to open-source related code changes.

Commercial use
Permitted with no separate commercial license. No usage caps, revenue thresholds, or field-of-use limits apply to YOLOS.
Modification
Permitted. You can fine-tune or rewrite YOLOS and keep the result closed-source.
Redistribution
Permitted. Include the original copyright and permission notice in copies or substantial portions of the work.

MIT grants no explicit patent license and disclaims all warranties. If patent exposure is a concern for your deployment, review it with counsel before launch.

Read the full MIT license ↗

Do I need a commercial license for YOLOS?

No commercial license is needed for YOLOS: permissive terms let you keep related code private while deploying commercially.

Do not hesitate to reach out with questions for your commercial project. Our team will help you start solving business problems on the first call. See Roboflow commercial licensing for the models included in each plan.

Talk to sales

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

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.

YOLOS Details

Details

Categoryopen
ModalityVision
LicenseMIT
Release DateJun 2021

Vision Tasks

Object Detection

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.