SAVRN
Search Contact SAVRN

Open-weight model · Object detection

yolos-base

by HUST Vision Lab hustvl/yolos-base

YOLOS model fine-tuned on COCO 2017 object detection (118k annotated images). It was introduced in the paper You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection by Fang et al. and first released in this repository.

Parameters
Context
Weights511.3 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads16.3k

Model Card

By HUST Vision Lab, published under apache-2.0, revision 4d5b3df62b18.

YOLOS model fine-tuned on COCO 2017 object detection (118k annotated images). It was introduced in the paper You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection by Fang et al. and first released in this repository. Disclaimer: The team releasing YOLOS did not write a model card for this model so this model card has been written by the Hugging Face team. YOLOS is a Vision Transformer (ViT) trained using the DETR loss. Despite its simplicity, a base-sized YOLOS model is able to achieve 42 AP on COCO validation 2017 (similar to DETR and more complex frameworks such as Faster R-CNN). The model is trained using a "bipartite matching loss": one compares the…

Read HUST Vision Lab's full model card

YOLOS (base-sized) model

YOLOS model fine-tuned on COCO 2017 object detection (118k annotated images). It was introduced in the paper You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection by Fang et al. and first released in this repository.

Disclaimer: The team releasing YOLOS did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

YOLOS is a Vision Transformer (ViT) trained using the DETR loss. Despite its simplicity, a base-sized YOLOS model is able to achieve 42 AP on COCO validation 2017 (similar to DETR and more complex frameworks such as Faster R-CNN).

The model is trained using a "bipartite matching loss": one compares the predicted classes + bounding boxes of each of the N = 100 object queries to the ground truth annotations, padded up to the same length N (so if an image only contains 4 objects, 96 annotations will just have a "no object" as class and "no bounding box" as bounding box). The Hungarian matching algorithm is used to create an optimal one-to-one mapping between each of the N queries and each of the N annotations. Next, standard cross-entropy (for the classes) and a linear combination of the L1 and generalized IoU loss (for the bounding boxes) are used to optimize the parameters of the model.

Intended uses & limitations

You can use the raw model for object detection. See the model hub to look for all available YOLOS models.

How to use

Here is how to use this model:

from transformers import YolosFeatureExtractor, YolosForObjectDetection
from PIL import Image
import requests

url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)

feature_extractor = YolosFeatureExtractor.from_pretrained('hustvl/yolos-base')
model = YolosForObjectDetection.from_pretrained('hustvl/yolos-base')

inputs = feature_extractor(images=image, return_tensors="pt")
outputs = model(**inputs)

# model predicts bounding boxes and corresponding COCO classes
logits = outputs.logits
bboxes = outputs.pred_boxes

Currently, both the feature extractor and model support PyTorch.

Training data

The YOLOS model was pre-trained on ImageNet-1k and fine-tuned on COCO 2017 object detection, a dataset consisting of 118k/5k annotated images for training/validation respectively.

Training

The model was pre-trained for 1000 epochs on ImageNet-1k and fine-tuned for 150 epochs on COCO.

Evaluation results

This model achieves an AP (average precision) of 42.0 on COCO 2017 validation. For more details regarding evaluation results, we refer to the original paper.

BibTeX entry and citation info

@article{DBLP:journals/corr/abs-2106-00666,
  author    = {Yuxin Fang and
               Bencheng Liao and
               Xinggang Wang and
               Jiemin Fang and
               Jiyang Qi and
               Rui Wu and
               Jianwei Niu and
               Wenyu Liu},
  title     = {You Only Look at One Sequence: Rethinking Transformer in Vision through
               Object Detection},
  journal   = {CoRR},
  volume    = {abs/2106.00666},
  year      = {2021},
  url       = {https://arxiv.org/abs/2106.00666},
  eprinttype = {arXiv},
  eprint    = {2106.00666},
  timestamp = {Fri, 29 Apr 2022 19:49:16 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-2106-00666.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Configuration

Architecture
YolosForObjectDetection
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Stored precision
float32
Model type
yolos

Identity and Version

Repository
hustvl/yolos-base
Publisher
HUST Vision Lab
Task
Object detection
Modality
Image
Library
transformers
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
4d5b3df62b18f1d9c6968970ac75941cc6c9a2d1
First published
2022-04-26
Last updated
2024-05-08

Files and Weights

5 files, 511.3 MB in total. The weights are 1 file totalling 511.3 MB in bin.

Weights1 file · 511.3 MB
Configuration2 files · 4.4 KB
Documentation1 file · 4.2 KB
Repository1 file · 1.2 KB
Every file
FileTypeSizeSHA-256
pytorch_model.binWeights511.3 MB eff6a49d3f35
config.jsonConfiguration4.1 KB
preprocessor_config.jsonConfiguration296 B
README.mdDocumentation4.2 KB
.gitattributesRepository1.2 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
511.3 MB
Download from HUST Vision Lab

Released by HUST Vision Lab through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published511.3 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About yolos-base

Can I use yolos-base commercially?

Yes. yolos-base is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Object detection

locate-anything.cpp-gguf

Mudler

GGUF builds of nvidia/LocateAnything-3B for locate-anything.cpp - a C++/ggml inference engine for open-vocabulary detection / visual grounding, no Python at inference time. Brought to you by the LocalAI team. The detections are the same as the official PyTorch implementation (the engine is parity-gated against it), and it runs faster - on CPU and GPU. The full-precision f32 GGUF (~15 GB) is reproducible from the HF weights with scripts/convertlocateanythingtogguf.py in the repo. Same detections as the official model, faster. Full methodology, the warm/median setup, parity checks, and more images are in the repo's Slow-mode inference on the 448 fixture; vs official divides the official…

Open weights other gguf

Model · Object detection

Anzhcs_YOLOs

Anzhc

YOLOs in this repo are trained with datasets that i have annotated myself, or with the help of my friends(They will be appropriately mentioned in those cases). YOLOs on open datasets will have their own pages. Ultralytics 8.3.217 updates mask handling, which breaks function in main Adetailer repo. Install Ultralytics==8.3.216 or lower. Alternatively - use forks that fix this. - Fixed in main repo. I've added some features to make Adetailer more usable and less manual - https://github.com/Anzhc/aadetailer-reforge Im open to commissions, hit me up in Discord - anzhc P.S. All model names in tables have download links attached:3 Series of models aiming at detecting and segmenting face…

Open weights agpl-3.0 ultralytics

This is a fine-tuned version of YOLOv11 (n, s, m, l, x) specialized for License Plate Detection, using a public dataset from Roboflow Universe: The upstream Roboflow dataset (license-plate-recognition-rxg4e) contains train/test contamination — the same source images appear in both the training and test splits with only minor manual augmentation applied (see Discussion #2 for concrete examples). As a result: - The reported metrics below are likely overestimated, because the test set is not a true held-out evaluation. - Real-world generalization performance is expected to be lower than the numbers in the table. - Treat all evaluation figures with caution and validate the model on your own…

Open weights agpl-3.0 ultralytics

Model · Object detection

surya_layout2

Datalab

A lightweight document layout detection model used by Surya. It detects layout regions (text, tables, figures, headers, captions, equations, etc.) on a page image and runs on CPU or GPU. This is the "fast" layout detector — a compact object detector that serves as a drop-in alternative to Surya's VLM-based layout model. Documentation, installation, and everything else lives in the Point the fast layout predictor at this checkpoint: Or make it the default so the CLI and library use it without an explicit path: Released under the AI Pubs OpenRAIL-M license (see LICENSE) — the same license as the surya-ocr-2 model weights.

Open weights openrail surya

Model · Object detection

detr-resnet-50

Joshua

https://huggingface.co/facebook/detr-resnet-50 with ONNX weights to be compatible with Transformers.js. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: Test it out here, or create your own object-detection demo with 1 click! Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Open weights 1,024 tokens transformers.js