SAVRN
Search Contact SAVRN

Open-weight model · Image segmentation

oneformer_ade20k_swin_large

by SHI Labs shi-labs/oneformer_ade20k_swin_large

OneFormer model trained on the ADE20k dataset (large-sized version, Swin backbone). It was introduced in the paper OneFormer: One Transformer to Rule Universal Image Segmentation by Jain et al. and first released in this repository.

Parameters
Context
Weights1.8 GB
Licensemit
AccessOpen weights
Monthly Downloads132.8k

Model Card

By SHI Labs, published under mit, revision 4a5bac8e64f8.

OneFormer model trained on the ADE20k dataset (large-sized version, Swin backbone). It was introduced in the paper OneFormer: One Transformer to Rule Universal Image Segmentation by Jain et al. and first released in this repository. OneFormer is the first multi-task universal image segmentation framework. It needs to be trained only once with a single universal architecture, a single model, and on a single dataset, to outperform existing specialized models across semantic, instance, and panoptic segmentation tasks. OneFormer uses a task token to condition the model on the task in focus, making the architecture task-guided for training, and task-dynamic for inference, all with a single…

Read SHI Labs's full model card

OneFormer

OneFormer model trained on the ADE20k dataset (large-sized version, Swin backbone). It was introduced in the paper OneFormer: One Transformer to Rule Universal Image Segmentation by Jain et al. and first released in this repository.

Model description

OneFormer is the first multi-task universal image segmentation framework. It needs to be trained only once with a single universal architecture, a single model, and on a single dataset, to outperform existing specialized models across semantic, instance, and panoptic segmentation tasks. OneFormer uses a task token to condition the model on the task in focus, making the architecture task-guided for training, and task-dynamic for inference, all with a single model.

Intended uses & limitations

You can use this particular checkpoint for semantic, instance and panoptic segmentation. See the model hub to look for other fine-tuned versions on a different dataset.

How to use

Here is how to use this model:

from transformers import OneFormerProcessor, OneFormerForUniversalSegmentation
from PIL import Image
import requests
url = "https://huggingface.co/datasets/shi-labs/oneformer_demo/blob/main/ade20k.jpeg"
image = Image.open(requests.get(url, stream=True).raw)

# Loading a single model for all three tasks
processor = OneFormerProcessor.from_pretrained("shi-labs/oneformer_ade20k_swin_large")
model = OneFormerForUniversalSegmentation.from_pretrained("shi-labs/oneformer_ade20k_swin_large")

# Semantic Segmentation
semantic_inputs = processor(images=image, task_inputs=["semantic"], return_tensors="pt")
semantic_outputs = model(**semantic_inputs)
# pass through image_processor for postprocessing
predicted_semantic_map = processor.post_process_semantic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]

# Instance Segmentation
instance_inputs = processor(images=image, task_inputs=["instance"], return_tensors="pt")
instance_outputs = model(**instance_inputs)
# pass through image_processor for postprocessing
predicted_instance_map = processor.post_process_instance_segmentation(outputs, target_sizes=[image.size[::-1]])[0]["segmentation"]

# Panoptic Segmentation
panoptic_inputs = processor(images=image, task_inputs=["panoptic"], return_tensors="pt")
panoptic_outputs = model(**panoptic_inputs)
# pass through image_processor for postprocessing
predicted_semantic_map = processor.post_process_panoptic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]["segmentation"]

For more examples, please refer to the documentation.

Citation

@article{jain2022oneformer,
      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={arXiv}, 
      year={2022}
    }

Configuration

Architecture
OneFormerForUniversalSegmentation
Layers
10
Attention heads
8
Stored precision
float32
Model type
oneformer

Identity and Version

Repository
shi-labs/oneformer_ade20k_swin_large
Publisher
SHI Labs
Task
Image segmentation
Modality
Image
Library
transformers
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
4a5bac8e64f82681a12db2e151a4c2f4ce6092b2
First published
2022-11-15
Last updated
2023-01-19

Files and Weights

10 files, 1.8 GB in total. The weights are 2 files totalling 1.8 GB in bin, pth.

Weights2 files · 1.8 GB
Configuration3 files · 93.5 KB
Tokenizer3 files · 1.6 MB
Documentation1 file · 3.7 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
250_16_swin_l_oneformer_ade20k_160k.pthWeights949.7 MB f7ac095c28dd
pytorch_model.binWeights879.5 MB c0b2fe11dfec
config.jsonConfiguration84.3 KB
preprocessor_config.jsonConfiguration8.7 KB
special_tokens_map.jsonConfiguration472 B
README.mdDocumentation3.7 KB
.gitattributesRepository1.5 KB
merges.txtTokenizer524.6 KB
tokenizer_config.jsonTokenizer808 B
vocab.jsonTokenizer1.1 MB

License and Download

License
mit
Access
Open weights, no gate
Download size
1.8 GB
Download from SHI Labs

Released by SHI Labs through its official repository on Hugging Face. Read the license.

Built From

Memory Requirements

PrecisionWeights in memory
As published1.8 GB

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

Questions About oneformer_ade20k_swin_large

Can I use oneformer_ade20k_swin_large commercially?

Yes. oneformer_ade20k_swin_large is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

Similar Models

Model · Image segmentation

segformer-b2-finetuned-ade-512-512

NVIDIA

SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Xie et al. and first released in this repository. Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team. SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a…

Open weights other transformers

Model · Image segmentation

segformer-b3-finetuned-ade-512-512

NVIDIA

SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Xie et al. and first released in this repository. Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team. SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a…

Open weights other transformers

Model · Image segmentation

segformer-b1-finetuned-ade-512-512

NVIDIA

SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers by Xie et al. and first released in this repository. Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team. SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a…

Open weights other transformers

Model · Image segmentation

segformer-b0-finetuned-ade-512-512

Joshua

https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512 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: Example: Image segmentation with Xenova/segformer-b0-finetuned-ade-512-512. You can visualize the outputs with: 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 transformers.js

Model · Image segmentation

DelineateAnything

Mykola Lavreniuk

Delineate Anything v2 extends Delineate Anything into a globally representative, resolution-agnostic foundation model that scales agricultural field boundary detection to a planetary level from any imagery source. Trained on FBIS-73M, a massive 73-million-instance dataset spanning 61 countries with diverse imagery sources ranging from 0.25m to 10m resolution, built through a resolution-specific curation pipeline that solves the parcel-versus-field mismatch, Delineate Anything v2 sets a new state-of-the-art in global zero-shot delineation. It delivers a +103.3% relative gain in [email protected] over Delineate Anything while maintaining extreme efficiency, mapping all of Ukraine (603,000 km²) in 5.4…

Open weights agpl-3.0 ultralytics

Model · Image segmentation

modnet

Joshua

For more information, check out the official repository and example colab. If you haven't already, you can install the Transformers.js JavaScript library from NPM using: You can then use the model for portrait matting, as follows: Or with the AutoModel and AutoProcessor APIs: 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 apache-2.0 transformers.js