phungpx/cubicassa5k-coco
Viewer β’ Updated β’ 4.98k β’ 127
How to use phungpx/mask2former-swin-base-cubicassa with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-segmentation", model="phungpx/mask2former-swin-base-cubicassa") # Load model directly
from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
processor = AutoImageProcessor.from_pretrained("phungpx/mask2former-swin-base-cubicassa")
model = Mask2FormerForUniversalSegmentation.from_pretrained("phungpx/mask2former-swin-base-cubicassa", device_map="auto")Fine-tuned version of facebook/mask2former-swin-base-coco-instance on the
phungpx/cubicassa5k-coco dataset for instance
segmentation of architectural floor-plan elements.
Predicts 1 class(es): wall.
| Metric | Value |
|---|---|
| mask AP @[IoU=0.50:0.95] | 0.263 |
| mask AP @[IoU=0.50] | 0.620 |
| mask AP @[IoU=0.75] | 0.179 |
Columns: input floor-plan, ground-truth instances, and model prediction (mask fill + boxes; predictions also show confidence scores).
| Hyperparameter | Value |
|---|---|
| base model | facebook/mask2former-swin-base-coco-instance |
| image size | 640 |
| batch size | 2 |
| epochs | 50 |
| learning rate | 1e-05 |
| weight decay | 0.05 |
| lr scheduler | cosine (warmup ratio 0.05) |
| optimizer | AdamW |
| mixed precision | fp16 |
| seed | 42 |
import torch
from PIL import Image
from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
processor = AutoImageProcessor.from_pretrained("phungpx/mask2former-swin-base-cubicassa")
model = Mask2FormerForUniversalSegmentation.from_pretrained("phungpx/mask2former-swin-base-cubicassa")
model.eval()
image = Image.open("floorplan.png").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
results = processor.post_process_instance_segmentation(
outputs, target_sizes=[image.size[::-1]], threshold=0.5
)[0]
Fine-tuned with the π€ Transformers Trainer API.
Base model
facebook/mask2former-swin-base-coco-instance