Dreamy0's picture
Update README.md
4be8331 verified
metadata
license: apache-2.0
tags:
  - maskformer
  - instance-segmentation
  - image-segmentation
  - abnormal-detection
datasets:
  - custom
pipeline_tag: image-segmentation
base_model:
  - facebook/maskformer-swin-tiny-ade

MaskFormer for Normal/Abnormal Detection

This model is fine-tuned to detect and segment regions classified as either "Normal" or "Abnormal".

Model description

This is a MaskFormer model fine-tuned on a custom dataset with polygon annotations in COCO format. It has two classes:

  • Normal (ID: 0)
  • Abnormal (ID: 1)

Intended uses & limitations

This model is intended for instance segmentation tasks to identify normal and abnormal regions in images.

Usage in Python

from transformers import MaskFormerForInstanceSegmentation, MaskFormerImageProcessor
import torch
from PIL import Image

# Load model and processor
model = MaskFormerForInstanceSegmentation.from_pretrained("Dreamy0/maskformer-abnormal-detection-v4")
processor = MaskFormerImageProcessor.from_pretrained("facebook/maskformer-swin-tiny-ade")

# 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)