Skip to content
ModelsThatRun

OneFormer

SHI Labs' universal segmentation model trained once on COCO panoptic; here its instance masks. One Swin-L size, MIT, through transformers.

Size

Commercial use OK: code MIT, weights MIT. Measured on our RTX 4090: 168 ms median, 8.7 GiB VRAM peak. We scored it 48.8 mask AP on COCO val2017. PyTorch weights, 839 MB.

License

Commercial use OK

Code
MITchecked 21 Nov 2026
Weights
MITall sizes, checked 21 Nov 2026

On our RTX 4090, measured

168ms median

p90 172 ms, fp32, batch 1, 1216x800

VRAM peak
8.7 GiB
Status
Runs as is
Environment, 22 Nov 2026

NVIDIA GeForce RTX 4090, driver 580.173.02, CUDA 13.0, torch 2.14.1+cu130, Python 3.12.9, transformers==5.20.2. Baseline 1032 MiB. 10 warm-up + 100 timed. Scope: predict(): pre-processing, forward pass and post-processing; input file decoded beforehand.

Accuracy

48.8mask APmeasured

COCO val2017, mask AP, 5,000 images, fp32, pycocotools==2.0.11 · 21 Nov 2026

Reported49 COCO mask AP on COCO val2017 panoptic annotations converted to instances (coco_2017_val_panoptic2instance), not the instance annotations our benchmark usesSource: https://github.com/SHI-Labs/OneFormer/blob/4962ef6a96ffb76a76771bfa3e8b3587f209752b/README.md, COCO results table (OneFormer Swin-L, AP column); the evaluation set is DATASETS.TEST_INSTANCE in configs/coco/Base-COCO-UnifiedSegmentation.yaml

Weights

PyTorch

Size
839 MB
sha256
36d01ceb971e9b3824bf35de022cd3148aad0c928f6365302db492a4cff6bf2b
Download swin-large weights

Same photos and one score threshold for every model of this task. Failures are marked.

Use it when

You want one MIT-licensed model whose same weights also give panoptic and semantic segmentation. This page measures its instance masks only: 48.8 mask AP on COCO.

Avoid it when

You need instance masks fast or on a small GPU: 168 ms a call and 8.7 GiB of VRAM, the most of any instance segmentation model here, while GTR-Seg x scored higher (49.7 mask AP) in 37 ms and under 1 GiB.

Sizes

SizeLatencyVRAMAccuracyWeightsRunsLicense
swin-large168 ms1216x8008.7 GiB48.8 mask AP, measured49 COCO mask AP paper839 MBAs isCommercial OK

Estimated on other GPUs

Estimate, not measured. Worked out from our RTX 4090 run and NVIDIA's spec sheets. Each kind of GPU work is scaled by that GPU's peak for it: tensor cores at the precision the kernels used, CUDA cores, or memory bandwidth. The CPU's part of each call is kept at what it took on our Intel Core i7-10700K. How we estimate

Where a call's time goes on our RTX 4090: CUDA cores, FP32 47%, memory-bound 34%, CPU and kernel launches 17%, host–device copies 1%.

GeForce (13)
GPUFitsLatency
GeForce RTX 5090Blackwell, 32 GB GDDR7Yes≈ 130 ms
GeForce RTX 5080Blackwell, 16 GB GDDR7Yes≈ 210 ms
GeForce RTX 5070 TiBlackwell, 16 GB GDDR7Yes≈ 240–250 ms
GeForce RTX 5070Blackwell, 12 GB GDDR7Yes≈ 330 ms
GeForce RTX 5060 Ti 16GBBlackwell, 16 GB GDDR7Yes≈ 430–440 ms
GeForce RTX 5060Blackwell, 8 GB GDDR7No, needs 8.7 GBDoesn’t fit
GeForce RTX 4080Ada Lovelace, 16 GB GDDR6XYes≈ 250 ms
GeForce RTX 4070 TiAda Lovelace, 12 GB GDDR6XYes≈ 310 ms
GeForce RTX 4070Ada Lovelace, 12 GB GDDR6XYes≈ 370 ms
GeForce RTX 3090Ampere, 24 GB GDDR6XYes≈ 280 ms
GeForce RTX 3080Ampere, 10 GB GDDR6XYes≈ 330 ms
GeForce RTX 3070 TiAmpere, 8 GB GDDR6XNo, needs 8.7 GBDoesn’t fit
GeForce RTX 3070Ampere, 8 GB GDDR6No, needs 8.7 GBDoesn’t fit
Workstation (4)
GPUFitsLatency
RTX PRO 6000 Blackwell Workstation EditionBlackwell, 96 GB GDDR7Yes≈ 110–120 ms
RTX PRO 6000 Blackwell Max-Q Workstation EditionBlackwell, 96 GB GDDR7Yes≈ 120 ms
RTX 6000 Ada GenerationAda Lovelace, 48 GB GDDR6Yes≈ 160 ms
RTX A6000Ampere, 48 GB GDDR6Yes≈ 270 ms
Data center (6)
GPUFitsLatency
B200 (HGX, one GPU)Blackwell, 180 GB HBM3EYes≈ 130 ms
H200 SXMHopper, 141 GB HBM3eYes≈ 140 ms
H100 SXMHopper, 80 GB HBM3Yes≈ 150 ms
A100 SXM 80GBAmpere, 80 GB HBM2eYes≈ 390 ms
L40SAda Lovelace, 48 GB GDDR6Yes≈ 170 ms
L4Ada Lovelace, 24 GB GDDR6Yes≈ 430–440 ms

CPU only

Measured by us with no GPU on an Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz, 8 cores, 94.2 GiB of memory: the same official code with the GPU hidden, in fp32 on 8 threads. Before it was timed, its output on the timing input was checked against the GPU's. These numbers say what to expect without a GPU. They aren't compared with any GPU's, here or in the charts. How we measure on a CPU

SizeRuntimeLatency on the CPURAM peak
swin-largePyTorch2.14.1 · fp32 · 8 threads8095 ms1216x8006.7 GiB

From the authors

In their words, with their numbers. Ours are in the cards at the top of this page.

Paper

OneFormer: One Transformer to Rule Universal Image Segmentation

Jitesh Jain, Jiachen Li, MangTik Chiu, Ali Hassani, Nikita Orlov, Humphrey Shi

arXiv 2211.06220, 10 Nov 2022

Abstract

Universal Image Segmentation is not a new concept. Past attempts to unify image segmentation in the last decades include scene parsing, panoptic segmentation, and, more recently, new panoptic architectures. However, such panoptic architectures do not truly unify image segmentation because they need to be trained individually on the semantic, instance, or panoptic segmentation to achieve the best performance. Ideally, a truly universal framework should be trained only once and achieve SOTA performance across all three image segmentation tasks. To that end, we propose OneFormer, a universal image segmentation framework that unifies segmentation with a multi-task train-once design. We first propose a task-conditioned joint training strategy that enables training on ground truths of each domain (semantic, instance, and panoptic segmentation) within a single multi-task training process. Secondly, we introduce a task token to condition our model on the task at hand, making our model task-dynamic to support multi-task training and inference. Thirdly, we propose using a query-text contrastive loss during training to establish better inter-task and inter-class distinctions. Notably, our single OneFormer model outperforms specialized Mask2Former models across all three segmentation tasks on ADE20k, CityScapes, and COCO, despite the latter being trained on each of the three tasks individually with three times the resources. With new ConvNeXt and DiNAT backbones, we observe even more performance improvement. We believe OneFormer is a significant step towards making image segmentation more universal and accessible. To support further research, we open-source our code and models at https://github.com/SHI-Labs/OneFormer

README

Copied from the authors' repository at commit 4962ef6 on 23 Nov 2026. Numbers and license claims in it are theirs, not measured or checked by us. We removed badges, replaced images with links and adjusted headings.

Jitesh Jain, Jiachen Li†, MangTik Chiu†, Ali Hassani, Nikita Orlov, Humphrey Shi

† Equal Contribution

[Project Page] [arXiv] [pdf] [BibTeX]

This repo contains the code for our paper OneFormer: One Transformer to Rule Universal Image Segmentation.

Figure teaser

Features

  • OneFormer is the first multi-task universal image segmentation framework based on transformers.
  • OneFormer needs to be trained only once with a single universal architecture, a single model, and on a single dataset , to outperform existing frameworks across semantic, instance, and panoptic segmentation tasks.
  • OneFormer uses a task-conditioned joint training strategy, uniformly sampling different ground truth domains (semantic instance, or panoptic) by deriving all labels from panoptic annotations to train its multi-task model.
  • OneFormer uses a task token to condition the model on the task in focus, making our architecture task-guided for training, and task-dynamic for inference, all with a single model.

Figure OneFormer

Contents

  1. News
  2. Installation Instructions
  3. Dataset Preparation
  4. Execution Instructions
  5. Results
  6. Citation

News

  • [February 27, 2023]: OneFormer is accepted to CVPR 2023!
  • [January 26, 2023]: OneFormer sets new SOTA performance on the the Mapillary Vistas val (both panoptic & semantic segmentation) and Cityscapes test (panoptic segmentation) sets. We’ve released the checkpoints too!
  • [January 19, 2023]: OneFormer is now available as a part of the 🤗 HuggingFace transformers library and model hub! 🚀
  • [December 26, 2022]: Checkpoints for Swin-L OneFormer and DiNAT-L OneFormer trained on ADE20K with 1280×1280 resolution released!
  • [November 23, 2022]: Roboflow cover OneFormer on YouTube! Thanks to @SkalskiP for making the video!
  • [November 18, 2022]: Our demo is available on 🤗 Huggingface Space!
  • [November 10, 2022]: Project Page, ArXiv Preprint and GitHub Repo are public!
    • OneFormer sets new SOTA on Cityscapes val with single-scale inference on Panoptic Segmentation with 68.5 PQ score and Instance Segmentation with 46.7 AP score!
    • OneFormer sets new SOTA on ADE20K val on Panoptic Segmentation with 51.5 PQ score and on Instance Segmentation with 37.8 AP!
    • OneFormer sets new SOTA on COCO val on Panoptic Segmentation with 58.0 PQ score!

Installation Instructions

  • We use Python 3.8, PyTorch 1.10.1 (CUDA 11.3 build).
  • We use Detectron2-v0.6.
  • For complete installation instructions, please see INSTALL.md.

Dataset Preparation

  • We experiment on three major benchmark dataset: ADE20K, Cityscapes and COCO 2017.
  • Please see Preparing Datasets for OneFormer for complete instructions for preparing the datasets.

Execution Instructions

Training
  • We train all our models using 8 A6000 (48 GB each) GPUs.
  • We use 8 A100 (80 GB each) for training Swin-L† OneFormer and DiNAT-L† OneFormer on COCO and all models with ConvNeXt-XL† backbone. We also train the 896x896 models on ADE20K on 8 A100 GPUs.
  • Please see Getting Started with OneFormer for training commands.
Evaluation
Demo
  • We provide quick to run demos on Colab and Hugging Face Spaces .
  • Please see OneFormer Demo for command line instructions on running the demo.

Results

Figure Results

  • † denotes the backbones were pretrained on ImageNet-22k.
  • Pre-trained models can be downloaded following the instructions given under tools.
ADE20K
MethodBackboneCrop SizePQAPmIoU
(s.s)
mIoU
(ms+flip)
#paramsconfigCheckpoint
OneFormerSwin-L†640×64049.835.957.057.7219Mconfigmodel
OneFormerSwin-L†896×89651.137.657.458.3219Mconfigmodel
OneFormerSwin-L†1280×128051.437.857.057.7219Mconfigmodel
OneFormerConvNeXt-L†640×64050.036.256.657.4220Mconfigmodel
OneFormerDiNAT-L†640×64050.536.058.358.4223Mconfigmodel
OneFormerDiNAT-L†896×89651.236.858.158.6223Mconfigmodel
OneFormerDiNAT-L†1280×128051.537.158.358.7223Mconfigmodel
OneFormer (COCO-Pretrained)DiNAT-L†1280×128053.440.258.458.8223Mconfigmodel | pretrained
OneFormerConvNeXt-XL†640×64050.136.357.458.8372Mconfigmodel
Cityscapes
MethodBackbonePQAPmIoU
(s.s)
mIoU
(ms+flip)
#paramsconfigCheckpoint
OneFormerSwin-L†67.245.683.084.4219Mconfigmodel
OneFormerConvNeXt-L†68.546.583.084.0220Mconfigmodel
OneFormer (Mapillary Vistas-Pretrained)ConvNeXt-L†70.148.784.685.2220Mconfigmodel | pretrained
OneFormerDiNAT-L†67.645.683.184.0223Mconfigmodel
OneFormerConvNeXt-XL†68.446.783.684.6372Mconfigmodel
OneFormer (Mapillary Vistas-Pretrained)ConvNeXt-XL†69.748.984.585.8372Mconfigmodel | pretrained
COCO
MethodBackbonePQPQThPQStAPmIoU#paramsconfigCheckpoint
OneFormerSwin-L†57.964.448.049.067.4219Mconfigmodel
OneFormerDiNAT-L†58.064.348.449.268.1223Mconfigmodel
Mapillary Vistas
MethodBackbonePQmIoU
(s.s)
mIoU
(ms+flip)
#paramsconfigCheckpoint
OneFormerSwin-L†46.762.964.1219Mconfigmodel
OneFormerConvNeXt-L†47.963.263.8220Mconfigmodel
OneFormerDiNAT-L†47.864.064.9223Mconfigmodel

Citation

If you found OneFormer useful in your research, please consider starring ⭐ us on GitHub and citing 📚 us in your research!

@inproceedings{jain2023oneformer,
      title={{OneFormer: One Transformer to Rule Universal Image Segmentation}},
      author={Jitesh Jain and Jiachen Li and MangTik Chiu and Ali Hassani and Nikita Orlov and Humphrey Shi},
      journal={CVPR}, 
      year={2023}
    }

Acknowledgement

We thank the authors of Mask2Former, GroupViT, and Neighborhood Attention Transformer for releasing their helpful codebases.

Alternatives

Changes

First published . Every model's changes

    • Added

Badge for a README

It says the model ran on our RTX 4090 and links to this page. It carries no number, so it never goes out of date.

ModelsThatRun: ran on RTX 4090
[![ModelsThatRun: ran on RTX 4090](https://modelsthatrun.dev/models/oneformer/badge.svg)](https://modelsthatrun.dev/models/oneformer/)

Something wrong on this page, such as a license or a number? Email us.

⇆
InputOutput