Papers › OneFormer: One Transformer to Rule Universal Image Segmentation

OneFormer: One Transformer to Rule Universal Image Segmentation

10 Nov 2022CVPR 2023 1arXiv:2211.06220archive 2025-07-28

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

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

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2211.06220")

Code

Syntology Ran 2 of 5 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 2 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

SHI-Labs/OneFormer officialmentioned in papermentioned on GitHubpytorchMIT report
huggingface/transformers mentioned on GitHubpytorch report
MindCode-4/code-2 mindsporeApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

5 samples harvested; 2 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

2ran
3unverified

Licence: 0 of the 5 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from SHI-Labs/OneFormer. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

linear_sum_assignment_with_nan SHI-Labs/OneFormer/oneformer/modeling/matcher.py official repository ran fingerprinted MIT (permissive) · 0b93a4545ba92b2d · report
sigmoid_ce_loss SHI-Labs/OneFormer/oneformer/modeling/criterion.py official repository ran fingerprinted MIT (permissive) · dc4a40c394479bd8 · report
batch_dice_loss SHI-Labs/OneFormer/oneformer/modeling/matcher.py official repository unverified MIT (permissive) · bc2cb481a75c370d · report
batch_sigmoid_ce_loss SHI-Labs/OneFormer/oneformer/modeling/matcher.py official repository unverified MIT (permissive) · 1edd24985036b0bf · report
dice_loss SHI-Labs/OneFormer/oneformer/modeling/criterion.py official repository unverified MIT (permissive) · 89f75e54ff128be0 · report

Tasks

Instance SegmentationPanoptic SegmentationScene ParsingSegmentationSemantic SegmentationUniversal Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Instance Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=1024, single-scale, 896x896, COCO-Pretrained) AP 44.2 #1 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=1024, single-scale, 896x896, COCO-Pretrained) APL 64.3 #1 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=1024, single-scale, 896x896, COCO-Pretrained) APM 49.9 #1 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=1024, single-scale, 896x896, COCO-Pretrained) APS 23.7 #1 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280, COCO-pretrain) AP 40.2 #4 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280, COCO-pretrain) APL 59.7 #4 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280, COCO-pretrain) APM 44.4 #4 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280, COCO-pretrain) APS 19.2 #4 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (DiNAT-L, single-scale) AP 36.0 #7 of 14 Archive leaderboard report
Instance Segmentation ADE20K val OneFormer (Swin-L, single-scale) AP 35.9 #8 of 14 Archive leaderboard report
Instance Segmentation COCO val (panoptic labels) OneFormer (InternImage-H, emb_dim=1024, single-scale) AP 52.0 #1 of 4 Archive leaderboard report
Instance Segmentation COCO val (panoptic labels) OneFormer (DiNAT-L, single-scale) AP 49.2 #2 of 4 Archive leaderboard report
Instance Segmentation COCO val (panoptic labels) OneFormer (Swin-L, single-scale) AP 49.0 #4 of 4 Archive leaderboard report
Instance Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale, Mapillary-Pretrained) mask AP 48.7 #2 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val OneFormer (DiNAT-L, single-scale) mask AP 45.6 #5 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val OneFormer (Swin-L, single-scale) mask AP 45.6 #6 of 17 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=256, single-scale, 896x896) AP 40.2 #1 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=256, single-scale, 896x896) PQ 54.5 #1 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=256, single-scale, 896x896) mIoU 60.4 #1 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280, COCO-Pretrain) PQ 53.4 #4 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280, COCO-Pretrain) mIoU 58.9 #4 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280) AP 37.1 #8 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280) PQ 51.5 #8 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 1280x1280) mIoU 58.3 #8 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (Swin-L, single-scale, 1280x1280) AP 37.8 #9 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (Swin-L, single-scale, 1280x1280) PQ 51.4 #9 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (Swin-L, single-scale, 1280x1280) mIoU 57.0 #9 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 640x640) AP 36.0 #11 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 640x640) PQ 50.5 #11 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (DiNAT-L, single-scale, 640x640) mIoU 58.3 #11 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (ConvNeXt-XL, single-scale, 640x640) AP 36.3 #12 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (ConvNeXt-XL, single-scale, 640x640) PQ 50.1 #12 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (ConvNeXt-XL, single-scale, 640x640) mIoU 57.4 #12 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (ConvNeXt-L, single-scale, 640x640) AP 36.2 #13 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (ConvNeXt-L, single-scale, 640x640) PQ 50.0 #13 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (ConvNeXt-L, single-scale, 640x640) mIoU 56.6 #13 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (Swin-L, single-scale, 640x640) AP 35.9 #14 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (Swin-L, single-scale, 640x640) PQ 49.8 #14 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val OneFormer (Swin-L, single-scale, 640x640) mIoU 57.0 #14 of 25 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (InternImage-H,single-scale) AP 52.0 #2 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (InternImage-H,single-scale) PQ 60.0 #2 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (InternImage-H,single-scale) PQst 49.2 #2 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (InternImage-H,single-scale) PQth 67.1 #2 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (InternImage-H,single-scale) mIoU 68.8 #2 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (DiNAT-L, single-scale) AP 49.2 #14 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (DiNAT-L, single-scale) PQ 58.0 #14 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (DiNAT-L, single-scale) PQst 48.4 #14 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (DiNAT-L, single-scale) PQth 64.3 #14 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (DiNAT-L, single-scale) mIoU 68.1 #14 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (Swin-L, single-scale) AP 49.0 #16 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (Swin-L, single-scale) PQ 57.9 #16 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (Swin-L, single-scale) PQst 48.0 #16 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (Swin-L, single-scale) PQth 64.4 #16 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival OneFormer (Swin-L, single-scale) mIoU 67.4 #16 of 31 Archive leaderboard report
Panoptic Segmentation Cityscapes test OneFormer (ConvNeXt-L, single-scale, Mapillary Vistas-Pretrained) PQ 68.0 #1 of 10 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale, 512x1024, Mapillary Vistas-pretrained) AP 48.7 #2 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale, 512x1024, Mapillary Vistas-pretrained) PQ 70.1 #2 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale, 512x1024, Mapillary Vistas-pretrained) PQst 74.1 #2 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale, 512x1024, Mapillary Vistas-pretrained) PQth 64.6 #2 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale, 512x1024, Mapillary Vistas-pretrained) mIoU 84.6 #2 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale) AP 46.5 #4 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale) PQ 68.51 #4 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-L, single-scale) mIoU 83.0 #4 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-XL, single-scale) AP 46.7 #7 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-XL, single-scale) PQ 68.4 #7 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (ConvNeXt-XL, single-scale) mIoU 83.6 #7 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (DiNAT-L, single-scale) AP 45.6 #10 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (DiNAT-L, single-scale) PQ 67.6 #10 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (DiNAT-L, single-scale) mIoU 83.1 #10 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (Swin-L, single-scale) AP 45.6 #13 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (Swin-L, single-scale) PQ 67.2 #13 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val OneFormer (Swin-L, single-scale) mIoU 83.0 #13 of 37 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (DiNAT-L, single-scale) PQ 46.7 #1 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (DiNAT-L, single-scale) PQst 54.9 #1 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (DiNAT-L, single-scale) PQth 40.5 #1 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (DiNAT-L, single-scale) mIoU 61.7 #1 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (ConvNeXt-L, single-scale) PQ 46.4 #2 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (ConvNeXt-L, single-scale) PQst 54.0 #2 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (ConvNeXt-L, single-scale) PQth 40.6 #2 of 13 Archive leaderboard report
Panoptic Segmentation Mapillary val OneFormer (ConvNeXt-L, single-scale) mIoU 61.6 #2 of 13 Archive leaderboard report
Semantic Segmentation ADE20K val OneFormer (InternImage-H, emb_dim=256, multi-scale, 896x896) mIoU 60.8 #6 of 95 Archive leaderboard report
Semantic Segmentation ADE20K val OneFormer (DiNAT-L, multi-scale, 896x896) mIoU 58.6 #9 of 95 Archive leaderboard report
Semantic Segmentation ADE20K val OneFormer (DiNAT-L, multi-scale, 640x640) mIoU 58.4 #11 of 95 Archive leaderboard report
Semantic Segmentation ADE20K val OneFormer (Swin-L, multi-scale, 896x896) mIoU 58.3 #14 of 95 Archive leaderboard report
Semantic Segmentation ADE20K val OneFormer (Swin-L, multi-scale, 640x640) mIoU 57.7 #19 of 95 Archive leaderboard report
Semantic Segmentation COCO (Common Objects in Context) OneFormer (InternImage-H, emb_dim=1024, single-scale) mIoU 68.8 #3 of 9 Archive leaderboard report
Semantic Segmentation COCO (Common Objects in Context) OneFormer (DiNAT-L, single-scale) mIoU 68.1 #5 of 9 Archive leaderboard report
Semantic Segmentation COCO (Common Objects in Context) OneFormer (Swin-L, single-scale) mIoU 67.4 #6 of 9 Archive leaderboard report
Semantic Segmentation Cityscapes val OneFormer (ConvNeXt-XL, Mapillary, multi-scale) mIoU 85.8 #9 of 99 Archive leaderboard report
Semantic Segmentation Cityscapes val OneFormer (ConvNeXt-XL, multi-scale) mIoU 84.6 #14 of 99 Archive leaderboard report
Semantic Segmentation Cityscapes val OneFormer (Swin-L, multi-scale) mIoU 84.4 #16 of 99 Archive leaderboard report
Semantic Segmentation Mapillary val OneFormer (DiNAT-L, multi-scale) mIoU 64.9 #2 of 8 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionConvNeXtDense ConnectionsDropoutLayer NormalizationLinear LayerMulti-Head AttentionNeighborhood AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections