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_tiny")
model = OneFormerForUniversalSegmentation.from_pretrained("shi-labs/oneformer_ade20k_swin_tiny")
# 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"]
@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}
}
Runs of shi-labs oneformer_ade20k_swin_tiny on huggingface.co
15.6K
Total runs
0
24-hour runs
827
3-day runs
3.8K
7-day runs
6.3K
30-day runs
More Information About oneformer_ade20k_swin_tiny huggingface.co Model
More oneformer_ade20k_swin_tiny license Visit here:
oneformer_ade20k_swin_tiny huggingface.co is an AI model on huggingface.co that provides oneformer_ade20k_swin_tiny's model effect (), which can be used instantly with this shi-labs oneformer_ade20k_swin_tiny model. huggingface.co supports a free trial of the oneformer_ade20k_swin_tiny model, and also provides paid use of the oneformer_ade20k_swin_tiny. Support call oneformer_ade20k_swin_tiny model through api, including Node.js, Python, http.
oneformer_ade20k_swin_tiny huggingface.co is an online trial and call api platform, which integrates oneformer_ade20k_swin_tiny's modeling effects, including api services, and provides a free online trial of oneformer_ade20k_swin_tiny, you can try oneformer_ade20k_swin_tiny online for free by clicking the link below.
shi-labs oneformer_ade20k_swin_tiny online free url in huggingface.co:
oneformer_ade20k_swin_tiny is an open source model from GitHub that offers a free installation service, and any user can find oneformer_ade20k_swin_tiny on GitHub to install. At the same time, huggingface.co provides the effect of oneformer_ade20k_swin_tiny install, users can directly use oneformer_ade20k_swin_tiny installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
oneformer_ade20k_swin_tiny install url in huggingface.co: