OneFormer trains one model on semantic, instance, and panoptic segmentation jointly, conditioned on a text token that names the task. At inference you pass
task="semantic"
,
"instance"
, or
"panoptic"
to the same weights. The processor combines an image processor and a tokenizer for that task token.
For more details on the model, please go to SHI Labs' original
model card
.
This is a
universal segmentation
checkpoint (
OneFormerUniversalSegment
) trained on
ADE20K
(150 classes, Swin-Tiny). All three tasks share these weights.
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch"# or "jax" / "tensorflow"from PIL import Image
from kerasformers.models.oneformer import (
OneFormerUniversalSegment,
OneFormerProcessor,
)
model = OneFormerUniversalSegment.from_weights("kerasformers/oneformer_ade20k_swin_tiny")
processor = OneFormerProcessor.from_weights("kerasformers/oneformer_ade20k_swin_tiny")
image = Image.open("your_image.jpg").convert("RGB")
# task is an argument: "semantic" | "instance" | "panoptic"
inputs = processor(images=image, task="panoptic")
output = model(inputs)
result = processor.post_process_panoptic_segmentation(
output, target_size=(image.height, image.width)
)
print(result["segmentation"].shape)
Load any OneFormer variant the same way with
from_weights("kerasformers/<variant>")
:
Community / upstream safetensors still work via the
hf:
prefix, e.g.
OneFormerUniversalSegment.from_weights("hf:shi-labs/oneformer_ade20k_swin_tiny")
.
Special Thanks
A huge thank you to the SHI Labs OneFormer authors for creating and releasing these models.
License: MIT.
Runs of zeromodels oneformer_ade20k_swin_tiny on huggingface.co
49
Total runs
12
24-hour runs
14
3-day runs
15
7-day runs
-27
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 zeromodels 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.
zeromodels 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: