Downloads · 30 days
11
18% of all-time downloads
Dreamy0/mask2former-segmentation
mask2former-segmentation is a image segmentation model from Dreamy0. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This model is fine-tuned to detect and segment regions across 3 classes.
Downloads · 30 days
11
18% of all-time downloads
All-time downloads
60
Public
Parameters
216M
866 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors866 MB · 100%
How the weights are stored.
F32216M · 100%
From the Hugging Face model README
This model is fine-tuned to detect and segment regions across 3 classes.
This is a Mask2Former model fine-tuned on a custom dataset with polygon annotations in COCO format. It has 3 classes:
This model is intended for universal segmentation tasks to identify the specified region types in images. Mask2Former supports instance, semantic, and panoptic segmentation.
from transformers import Mask2FormerForUniversalSegmentation, Mask2FormerImageProcessor
import torch
from PIL import Image
# Load model and processor
model = Mask2FormerForUniversalSegmentation.from_pretrained("{your-username}/mask2former-segmentation")
processor = Mask2FormerImageProcessor.from_pretrained("{your-username}/mask2former-segmentation")
# Prepare image
image = Image.open("your_image.jpg")
inputs = processor(images=image, return_tensors="pt")
# Make prediction
with torch.no_grad():
outputs = model(**inputs)
# Process outputs for visualization
# (see example code in model repository)