Mask2Former
Meta AI's masked-attention mask transformer for instance segmentation on COCO's 80 classes. Four Swin sizes; the weights are non-commercial (CC BY-NC 4.0).
Non-commercial for size swin-tiny: code MIT, weights CC-BY-NC-4.0. Measured on our RTX 4090: 78.7 ms median, 5.5 GiB VRAM peak. We scored it 44.9 mask AP on COCO val2017. safetensors weights, 181 MB.
Non-commercial for size swin-small: code MIT, weights CC-BY-NC-4.0. Measured on our RTX 4090: 86.3 ms median, 5.6 GiB VRAM peak. We scored it 46.3 mask AP on COCO val2017. safetensors weights, 263 MB.
Non-commercial for size swin-base-in21k: code MIT, weights CC-BY-NC-4.0. Measured on our RTX 4090: 103 ms median, 5.9 GiB VRAM peak. We scored it 48.1 mask AP on COCO val2017. PyTorch weights, 412 MB.
Non-commercial for size swin-large: code MIT, weights CC-BY-NC-4.0. Measured on our RTX 4090: 137 ms median, 6.4 GiB VRAM peak. We scored it 49.9 mask AP on COCO val2017. safetensors weights, 826 MB.
License
Non-commercial
Non-commercial
Non-commercial
Non-commercial
- Code
- MITchecked 21 Nov 2026
- Weights
- CC-BY-NC-4.0all sizes, checked 21 Nov 2026
The code is MIT, but every model in the authors' model zoo is CC BY-NC 4.0. The Hugging Face card only says "other".
The code is MIT, but every model in the authors' model zoo is CC BY-NC 4.0. The Hugging Face card only says "other".
The code is MIT, but every model in the authors' model zoo is CC BY-NC 4.0. The Hugging Face card only says "other".
The code is MIT, but every model in the authors' model zoo is CC BY-NC 4.0. The Hugging Face card only says "other".
On our RTX 4090, measured
78.7ms median
p90 81.2 ms, fp32, batch 1, 1216x800
- VRAM peak
- 5.5 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 1065 MiB. 10 warm-up + 100 timed. Scope: predict(): pre-processing, forward pass and post-processing; input file decoded beforehand.
Accuracy
44.9mask APmeasured
COCO val2017, mask AP, 5,000 images, fp32, pycocotools==2.0.11 · 21 Nov 2026
Paper 45 COCO mask APMODEL_ZOO.md, COCO instance segmentation table (Swin-T)
86.3ms median
p90 88.1 ms, fp32, batch 1, 1216x800
- VRAM peak
- 5.6 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
46.3mask APmeasured
COCO val2017, mask AP, 5,000 images, fp32, pycocotools==2.0.11 · 21 Nov 2026
Paper 46.3 COCO mask APMODEL_ZOO.md, COCO instance segmentation table (Swin-S)
103ms median
p90 105 ms, fp32, batch 1, 1216x800
- VRAM peak
- 5.9 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 1035 MiB. 10 warm-up + 100 timed. Scope: predict(): pre-processing, forward pass and post-processing; input file decoded beforehand.
Accuracy
48.1mask APmeasured
COCO val2017, mask AP, 5,000 images, fp32, pycocotools==2.0.11 · 21 Nov 2026
Paper 48.1 COCO mask APMODEL_ZOO.md, COCO instance segmentation table (Swin-B (IN21k))
137ms median
p90 142 ms, fp32, batch 1, 1216x800
- VRAM peak
- 6.4 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 1065 MiB. 10 warm-up + 100 timed. Scope: predict(): pre-processing, forward pass and post-processing; input file decoded beforehand.
Accuracy
49.9mask APmeasured
COCO val2017, mask AP, 5,000 images, fp32, pycocotools==2.0.11 · 21 Nov 2026
Paper 50.1 COCO mask APMODEL_ZOO.md, COCO instance segmentation table (Swin-L (IN21k))
Weights
safetensors
- Size
- 181 MB
- sha256
3550e8b21381d082c4d12b06a4b7c5f0f4a530125eee4c5f264b1e5f43dfab80
safetensors
- Size
- 263 MB
- sha256
4ad6f6fb26ce45013272f17fc2482399db3899e491d85b5d4b398387a91a52ac
PyTorch
- Size
- 412 MB
- sha256
ef78085700e94a8bd5733c8c13cdf3cabce1baba675eef64d720f83370f281ac
safetensors
- Size
- 826 MB
- sha256
b49f0f6fae52be4499cfcb1ac60d97a88a742244a8f1ff219518aee9fc9b46db
Outputs on the shared test photos
Same photos and one score threshold for every model of this task. Failures are marked.
breakfast-top-downFails: dog mask on the foam in the black coffee
crossing-amsterdamFails: stroller masked as a backpack
dining-room-kitchenFails: window seat masked as a bed
drone-city-blockFails: clock mask by the courtyard pool, boat mask on a rooftop
marathon-crossingFails: paper bag in a runner's hands masked as a baseball glove
marathon-packFails: orange running shoe masked as a baseball glove
shepherd-sheepFails: black lamb masked as a dog
tokyo-street-cyclistsFails: minibus also masked as a truck
bike-parade-riders
cafe-table-glasses
cows-pasture
cyclist-bike-lane
dog-walk-square
living-room-couch
parked-bicycles
sheep-meadow-lambs
street-night-chinatown
tabby-cat-door
terrier-dog-park
three-cats-couch
crossing-amsterdamFails: stroller masked as a backpack
dining-room-kitchenFails: window seat masked as a bed
drone-city-blockFails: clock mask on the round garden fountain, truck mask on a roof
marathon-packFails: runner in blue's mask leaves out his head and shoes, shoe masked as a baseball glove
tokyo-street-cyclistsFails: minibus also masked as a truck
bike-parade-riders
breakfast-top-down
cafe-table-glasses
cows-pasture
cyclist-bike-lane
dog-walk-square
living-room-couch
marathon-crossing
parked-bicycles
sheep-meadow-lambs
shepherd-sheep
street-night-chinatown
tabby-cat-door
terrier-dog-park
three-cats-couch
crossing-amsterdamFails: stroller masked as a backpack
drone-city-blockFails: clock mask on the round garden fountain, truck mask on a rooftop
shepherd-sheepFails: black lamb also masked as a dog
tokyo-street-cyclistsFails: minibus also masked as a truck
bike-parade-riders
breakfast-top-down
cafe-table-glasses
cows-pasture
cyclist-bike-lane
dining-room-kitchen
dog-walk-square
living-room-couch
marathon-crossing
marathon-pack
parked-bicycles
sheep-meadow-lambs
street-night-chinatown
tabby-cat-door
terrier-dog-park
three-cats-couch
crossing-amsterdamFails: stroller masked as a suitcase
drone-city-blockFails: truck mask on a rooftop
marathon-crossingFails: paper bag in a runner's hands masked as a baseball glove
tokyo-street-cyclistsFails: white truck also masked as a car
bike-parade-riders
breakfast-top-down
cafe-table-glasses
cows-pasture
cyclist-bike-lane
dining-room-kitchen
dog-walk-square
living-room-couch
marathon-pack
parked-bicycles
sheep-meadow-lambs
shepherd-sheep
street-night-chinatown
tabby-cat-door
terrier-dog-park
three-cats-couch
Use it when
You do non-commercial research and want the well-known baseline as published: our mask AP was within 0.3 of the repository's model zoo at all four sizes.
Avoid it when
You need commercial use (the weights are CC BY-NC 4.0) or speed: Swin-L took 137 ms a call for 49.9 mask AP, while GTR-Seg x, under a commercial license, scored 49.7 in 37 ms.
Sizes
| Size | Latency | VRAM | Accuracy | Weights | Runs | License |
|---|---|---|---|---|---|---|
| swin-tiny | 78.7 ms1216x800 | 5.5 GiB | 44.9 mask AP, measured45 COCO mask AP paper | 181 MB | As is | Non-commercial |
| swin-small | 86.3 ms1216x800 | 5.6 GiB | 46.3 mask AP, measured46.3 COCO mask AP paper | 263 MB | As is | Non-commercial |
| swin-base-in21k | 103 ms1216x800 | 5.9 GiB | 48.1 mask AP, measured48.1 COCO mask AP paper | 412 MB | As is | Non-commercial |
| swin-large | 137 ms1216x800 | 6.4 GiB | 49.9 mask AP, measured50.1 COCO mask AP paper | 826 MB | As is | Non-commercial |
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: memory-bound 47%, CUDA cores, FP32 26%, CPU and kernel launches 22%, host–device copies 3%, tensor cores, TF32 2%.
GeForce (13)
| GPU | Fits | Latency |
|---|---|---|
| GeForce RTX 5090Blackwell, 32 GB GDDR7 | Yes | ≈ 58–59 ms |
| GeForce RTX 5080Blackwell, 16 GB GDDR7 | Yes | ≈ 90–91 ms |
| GeForce RTX 5070 TiBlackwell, 16 GB GDDR7 | Yes | ≈ 100 ms |
| GeForce RTX 5070Blackwell, 12 GB GDDR7 | Yes | ≈ 130 ms |
| GeForce RTX 5060 Ti 16GBBlackwell, 16 GB GDDR7 | Yes | ≈ 170–180 ms |
| GeForce RTX 5060Blackwell, 8 GB GDDR7 | Yes | ≈ 190–200 ms |
| GeForce RTX 4080Ada Lovelace, 16 GB GDDR6X | Yes | ≈ 110 ms |
| GeForce RTX 4070 TiAda Lovelace, 12 GB GDDR6X | Yes | ≈ 140 ms |
| GeForce RTX 4070Ada Lovelace, 12 GB GDDR6X | Yes | ≈ 150–160 ms |
| GeForce RTX 3090Ampere, 24 GB GDDR6X | Yes | ≈ 110 ms |
| GeForce RTX 3080Ampere, 10 GB GDDR6X | Yes | ≈ 130 ms |
| GeForce RTX 3070 TiAmpere, 8 GB GDDR6X | Yes | ≈ 160–170 ms |
| GeForce RTX 3070Ampere, 8 GB GDDR6 | Yes | ≈ 190 ms |
Workstation (4)
| GPU | Fits | Latency |
|---|---|---|
| RTX PRO 6000 Blackwell Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 54–56 ms |
| RTX PRO 6000 Blackwell Max-Q Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 56–58 ms |
| RTX 6000 Ada GenerationAda Lovelace, 48 GB GDDR6 | Yes | ≈ 78 ms |
| RTX A6000Ampere, 48 GB GDDR6 | Yes | ≈ 110 ms |
Data center (6)
| GPU | Fits | Latency |
|---|---|---|
| B200 (HGX, one GPU)Blackwell, 180 GB HBM3E | Yes | ≈ 47–49 ms |
| H200 SXMHopper, 141 GB HBM3e | Yes | ≈ 53–55 ms |
| H100 SXMHopper, 80 GB HBM3 | Yes | ≈ 56–58 ms |
| A100 SXM 80GBAmpere, 80 GB HBM2e | Yes | ≈ 120–130 ms |
| L40SAda Lovelace, 48 GB GDDR6 | Yes | ≈ 82 ms |
| L4Ada Lovelace, 24 GB GDDR6 | Yes | ≈ 190–200 ms |
Where a call's time goes on our RTX 4090: memory-bound 44%, CUDA cores, FP32 31%, CPU and kernel launches 20%, host–device copies 3%, tensor cores, TF32 1%.
GeForce (13)
| GPU | Fits | Latency |
|---|---|---|
| GeForce RTX 5090Blackwell, 32 GB GDDR7 | Yes | ≈ 63–65 ms |
| GeForce RTX 5080Blackwell, 16 GB GDDR7 | Yes | ≈ 100 ms |
| GeForce RTX 5070 TiBlackwell, 16 GB GDDR7 | Yes | ≈ 110–120 ms |
| GeForce RTX 5070Blackwell, 12 GB GDDR7 | Yes | ≈ 150 ms |
| GeForce RTX 5060 Ti 16GBBlackwell, 16 GB GDDR7 | Yes | ≈ 200 ms |
| GeForce RTX 5060Blackwell, 8 GB GDDR7 | Yes | ≈ 220–230 ms |
| GeForce RTX 4080Ada Lovelace, 16 GB GDDR6X | Yes | ≈ 120 ms |
| GeForce RTX 4070 TiAda Lovelace, 12 GB GDDR6X | Yes | ≈ 150 ms |
| GeForce RTX 4070Ada Lovelace, 12 GB GDDR6X | Yes | ≈ 170–180 ms |
| GeForce RTX 3090Ampere, 24 GB GDDR6X | Yes | ≈ 120–130 ms |
| GeForce RTX 3080Ampere, 10 GB GDDR6X | Yes | ≈ 140–150 ms |
| GeForce RTX 3070 TiAmpere, 8 GB GDDR6X | Yes | ≈ 180–190 ms |
| GeForce RTX 3070Ampere, 8 GB GDDR6 | Yes | ≈ 210–220 ms |
Workstation (4)
| GPU | Fits | Latency |
|---|---|---|
| RTX PRO 6000 Blackwell Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 59–61 ms |
| RTX PRO 6000 Blackwell Max-Q Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 62–64 ms |
| RTX 6000 Ada GenerationAda Lovelace, 48 GB GDDR6 | Yes | ≈ 85 ms |
| RTX A6000Ampere, 48 GB GDDR6 | Yes | ≈ 130 ms |
Data center (6)
| GPU | Fits | Latency |
|---|---|---|
| B200 (HGX, one GPU)Blackwell, 180 GB HBM3E | Yes | ≈ 54–57 ms |
| H200 SXMHopper, 141 GB HBM3e | Yes | ≈ 61–63 ms |
| H100 SXMHopper, 80 GB HBM3 | Yes | ≈ 64–66 ms |
| A100 SXM 80GBAmpere, 80 GB HBM2e | Yes | ≈ 150 ms |
| L40SAda Lovelace, 48 GB GDDR6 | Yes | ≈ 89 ms |
| L4Ada Lovelace, 24 GB GDDR6 | Yes | ≈ 210–220 ms |
Where a call's time goes on our RTX 4090: memory-bound 40%, CUDA cores, FP32 40%, CPU and kernel launches 16%, host–device copies 2%, tensor cores, TF32 1%.
GeForce (13)
| GPU | Fits | Latency |
|---|---|---|
| GeForce RTX 5090Blackwell, 32 GB GDDR7 | Yes | ≈ 76 ms |
| GeForce RTX 5080Blackwell, 16 GB GDDR7 | Yes | ≈ 120 ms |
| GeForce RTX 5070 TiBlackwell, 16 GB GDDR7 | Yes | ≈ 140–150 ms |
| GeForce RTX 5070Blackwell, 12 GB GDDR7 | Yes | ≈ 190 ms |
| GeForce RTX 5060 Ti 16GBBlackwell, 16 GB GDDR7 | Yes | ≈ 260 ms |
| GeForce RTX 5060Blackwell, 8 GB GDDR7 | Yes | ≈ 290 ms |
| GeForce RTX 4080Ada Lovelace, 16 GB GDDR6X | Yes | ≈ 150 ms |
| GeForce RTX 4070 TiAda Lovelace, 12 GB GDDR6X | Yes | ≈ 190 ms |
| GeForce RTX 4070Ada Lovelace, 12 GB GDDR6X | Yes | ≈ 220 ms |
| GeForce RTX 3090Ampere, 24 GB GDDR6X | Yes | ≈ 160 ms |
| GeForce RTX 3080Ampere, 10 GB GDDR6X | Yes | ≈ 190 ms |
| GeForce RTX 3070 TiAmpere, 8 GB GDDR6X | Yes | ≈ 250 ms |
| GeForce RTX 3070Ampere, 8 GB GDDR6 | Yes | ≈ 280 ms |
Workstation (4)
| GPU | Fits | Latency |
|---|---|---|
| RTX PRO 6000 Blackwell Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 69–70 ms |
| RTX PRO 6000 Blackwell Max-Q Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 73–74 ms |
| RTX 6000 Ada GenerationAda Lovelace, 48 GB GDDR6 | Yes | ≈ 100 ms |
| RTX A6000Ampere, 48 GB GDDR6 | Yes | ≈ 160 ms |
Data center (6)
| GPU | Fits | Latency |
|---|---|---|
| B200 (HGX, one GPU)Blackwell, 180 GB HBM3E | Yes | ≈ 69–71 ms |
| H200 SXMHopper, 141 GB HBM3e | Yes | ≈ 78–79 ms |
| H100 SXMHopper, 80 GB HBM3 | Yes | ≈ 82–83 ms |
| A100 SXM 80GBAmpere, 80 GB HBM2e | Yes | ≈ 210 ms |
| L40SAda Lovelace, 48 GB GDDR6 | Yes | ≈ 100–110 ms |
| L4Ada Lovelace, 24 GB GDDR6 | Yes | ≈ 270 ms |
Where a call's time goes on our RTX 4090: CUDA cores, FP32 48%, memory-bound 37%, CPU and kernel launches 12%, host–device copies 2%.
GeForce (13)
| GPU | Fits | Latency |
|---|---|---|
| GeForce RTX 5090Blackwell, 32 GB GDDR7 | Yes | ≈ 100 ms |
| GeForce RTX 5080Blackwell, 16 GB GDDR7 | Yes | ≈ 170 ms |
| GeForce RTX 5070 TiBlackwell, 16 GB GDDR7 | Yes | ≈ 200 ms |
| GeForce RTX 5070Blackwell, 12 GB GDDR7 | Yes | ≈ 280 ms |
| GeForce RTX 5060 Ti 16GBBlackwell, 16 GB GDDR7 | Yes | ≈ 370 ms |
| GeForce RTX 5060Blackwell, 8 GB GDDR7 | Yes | ≈ 420 ms |
| GeForce RTX 4080Ada Lovelace, 16 GB GDDR6X | Yes | ≈ 200–210 ms |
| GeForce RTX 4070 TiAda Lovelace, 12 GB GDDR6X | Yes | ≈ 260 ms |
| GeForce RTX 4070Ada Lovelace, 12 GB GDDR6X | Yes | ≈ 310 ms |
| GeForce RTX 3090Ampere, 24 GB GDDR6X | Yes | ≈ 230 ms |
| GeForce RTX 3080Ampere, 10 GB GDDR6X | Yes | ≈ 270 ms |
| GeForce RTX 3070 TiAmpere, 8 GB GDDR6X | Yes | ≈ 360 ms |
| GeForce RTX 3070Ampere, 8 GB GDDR6 | Yes | ≈ 410 ms |
Workstation (4)
| GPU | Fits | Latency |
|---|---|---|
| RTX PRO 6000 Blackwell Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 91–92 ms |
| RTX PRO 6000 Blackwell Max-Q Workstation EditionBlackwell, 96 GB GDDR7 | Yes | ≈ 98 ms |
| RTX 6000 Ada GenerationAda Lovelace, 48 GB GDDR6 | Yes | ≈ 130 ms |
| RTX A6000Ampere, 48 GB GDDR6 | Yes | ≈ 230 ms |
Data center (6)
| GPU | Fits | Latency |
|---|---|---|
| B200 (HGX, one GPU)Blackwell, 180 GB HBM3E | Yes | ≈ 99–100 ms |
| H200 SXMHopper, 141 GB HBM3e | Yes | ≈ 110 ms |
| H100 SXMHopper, 80 GB HBM3 | Yes | ≈ 120 ms |
| A100 SXM 80GBAmpere, 80 GB HBM2e | Yes | ≈ 330 ms |
| L40SAda Lovelace, 48 GB GDDR6 | Yes | ≈ 140 ms |
| L4Ada Lovelace, 24 GB GDDR6 | Yes | ≈ 370 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
| Size | Runtime | Latency on the CPU | RAM peak |
|---|---|---|---|
| swin-tiny | PyTorch2.14.1 · fp32 · 8 threads | 3888 ms1216x800 | 4.5 GiB |
| swin-small | PyTorch2.14.1 · fp32 · 8 threads | 4435 ms1216x800 | 4.5 GiB |
| swin-base-in21k | PyTorch2.14.1 · fp32 · 8 threads | 5411 ms1216x800 | 4.7 GiB |
| swin-large | PyTorch2.14.1 · fp32 · 8 threads | 7510 ms1216x800 | 5.2 GiB |
Alternatives
Changes
First published . Every model's changes
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.
[](https://modelsthatrun.dev/models/mask2former/)Something wrong on this page, such as a license or a number? Email us.