Skip to content
ModelVerifiedExternal
Download

Mask2former Swin Base Cubicassa

Fine-tuned version of facebook/mask2former-swin-base-coco-instance on the phungpx/cubicassa5k-coco dataset for instance segmentation of architectural floor-plan elements.

KindOtherBase modelfacebook/mask2former-swin-base-coco-instanceVersionRevision 2c7ab6dPublisher@phungpxCgrade

Model source

Kind
Other
File size
408 MB
Base model
facebook/mask2former-swin-base-coco-instance
Version
vRevision 2c7ab6d
Updated
Oct 14, 2026
Publisher
@phungpx
Downloads
108
Tasks
Image segmentation
Source
Hugging Face

Source description

Mask2Former — CubiCasa5K Instance Segmentation

Fine-tuned version of facebook/mask2former-swin-base-coco-instance on the phungpx/cubicassa5k-coco dataset for instance segmentation of architectural floor-plan elements.

Classes

Predicts 1 class(es): wall.

Evaluation — COCO mask AP (validation split)

MetricValue
mask AP @[IoU=0.50:0.95]0.263
mask AP @[IoU=0.50]0.620
mask AP @[IoU=0.75]0.179

Prediction samples

Prediction samples

Columns: input floor-plan, ground-truth instances, and model prediction (mask fill + boxes; predictions also show confidence scores).

Training hyperparameters

HyperparameterValue
base modelfacebook/mask2former-swin-base-coco-instance
image size640
batch size2
epochs50
learning rate1e-05
weight decay0.05
lr schedulercosine (warmup ratio 0.05)
optimizerAdamW
mixed precisionfp16
seed42

Usage

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.

Sources

1 source
Hugging FacePrimaryVersion 2c7ab6d26cc07778b3a24287b44a0ddb90324d7b
huggingface.co/phungpx/mask2former-swin-base-cubicassa/tree/2c7ab6d26cc07778b3a24287b44a0ddb90324d7b

Verified Sep 21

Model artifacts

1 artifact

model.safetensors

safetensors · 408 MB · SHA-256 aec6b6cd47c4…3d2d · Hugging Face

Download

Source excerpts

3 excerpts

--- base_model: facebook/mask2former-swin-base-coco-instance datasets: - phungpx/cubicassa5k-coco library_name: transformers license: other metrics: - mAP pipeline_tag: image-segmentation tags: - mask2former - instance-segmentation - vision - cubicasa5k - floor-plan --- # Mask2Former — CubiCasa5K Instance Segmentation Fine-tuned version of [`facebook/mask2former-swin-base-coco-instance`](https://huggingface.co/facebook/mask2former-swin-base-coco-instance) on the [`phungpx/cubicassa5k-coco`](https://huggingface.co/datasets/phungpx/cubicassa5k-coco) dataset for **instance segmentation of architectural floor-plan elements**. ## Classes Predicts 1 class(es): **wall**. ## Evaluation — COCO mask AP (validation split) | 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 | ## Prediction samples ![Prediction samples](https://huggingface.co/phungpx/mask2former-swin-base-cubicassa/resolve/main/samples/predictions.png) Columns: input floor-plan, ground-truth instances, and model prediction (mask fill + boxes; predictions also show confidence scores). ## Training hyperparameters | 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 | ## Usage ```python 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.

Source context: 108 downloads · 3 likes · Pipeline image-segmentation · Library transformers · Repo phungpx/mask2former-swin-base-cubicassa

Source context: 207 downloads · 0 likes · Pipeline image-segmentation · Library transformers · Repo phungpx/mask2former-swin-base-cubicassa