phungpx/cubicassa5k-coco
CubiCasa5K (COCO format) Instance-segmentation dataset of residential floor plans, converted to a COCO-style schema and packaged as Parquet with embedded images. Each image is annotated with polygon masks for architectural elements (walls, doors, windows, rooms, fixtures, etc.). Repository: phungpx/cubicassa5k-coco Source dataset: CubiCasa5K Format: COCO instance segmentation (polygon segmentation + bbox) Modalities: image + structured annotations Dataset Summary… See the full description on the dataset page: https://huggingface.co/datasets/phungpx/cubicassa5k-coco.
CubiCasa5K (COCO format)
Instance-segmentation dataset of residential floor plans, converted to a COCO-style schema and packaged as Parquet with embedded images. Each image is annotated with polygon masks for architectural elements (walls, doors, windows, rooms, fixtures, etc.).
- Repository:
phungpx/cubicassa5k-coco - Source dataset: CubiCasa5K
- Format: COCO instance segmentation (polygon
segmentation+bbox) - Modalities: image + structured annotations
Dataset Summary
Images are stored at their original, highly variable resolutions — nearly every image has a unique width × height (4,223 distinct sizes across 4,228 train images), so resizing/padding is required before batched training.
Categories
There are 9 category ids (0–8). Note that category 0 (objects) is a COCO root/supercategory placeholder and carries no annotations; the 8 real classes are 1–8.
Data Fields
Each row is one floor-plan image with all of its annotations:
annotations is stored columnar (a dict of parallel lists). Each instance has:
Usage
from datasets import load_dataset
ds = load_dataset("phungpx/cubicassa5k-coco")
print(ds)
sample = ds["train"][0]
image = sample["image"] # PIL.Image
anns = sample["annotations"] # dict of parallel lists
n = len(anns["id"])
print(n, "annotations")
print(anns["category_id"][0], anns["bbox"][0], anns["segmentation"][0])Data Quality Notes
From EDA over both splits:
- No empty images. Every image in both splits has ≥ 1 annotation.
- No cross-split leakage. 0 duplicate filenames shared between train and valid.
- Severe class imbalance. The majority class
walldwarfs the rarest classes: - train imbalance ratio ≈ 3,667× (
wall= 106,340 vsbed= 29) - valid imbalance ratio ≈ 4,651× (
wall= 18,605 vsbed= 4) bed,kitchen, andstairsare very rare and may need class weighting, oversampling, or focal-style losses.- Many small instances. Annotations with area < 1,024 px² (≈ 32×32):
- train: 10,175 tiny annotations
- valid: 1,773 tiny annotations
- Variable resolution. Images span a wide resolution range and are mostly unique sizes; standardize/resize before training.
- Placeholder category.
category_id = 0(objects) has no annotations and can be dropped when building a label map.
Splits
The dataset ships with two splits, train (4,228 images) and valid (748 images), preserving the upstream COCO split structure. There is no dedicated test split.
Curation & Processing
The dataset was loaded from CubiCasa5K COCO annotation files (_annotations.coco.json per split), validated, and pushed to the Hub with images embedded as their original compressed bytes (not re-decoded), keeping storage compact and preserving source fidelity. Annotations were converted to a columnar Sequence[dict] layout for efficient Parquet storage.
See the EDA + export notebook (notebooks/cubicassa5k_eda_and_push.ipynb) for the full pipeline: COCO load → visualization → distribution/heatmap analysis → health checks → DatasetDict build → push → verification.
License & Citation
This dataset is derived from CubiCasa5K. Usage is subject to the original CubiCasa5K license and terms — please review the upstream repository before commercial use. Cite the original work:
@inproceedings{kalervo2019cubicasa5k,
title = {CubiCasa5K: A Dataset and an Improved Multi-Task Model for Floorplan Image Analysis},
author = {Kalervo, Ahti and Ylioinas, Juha and H{\"a}iki{\"o}, Markus and Karhu, Antti and Kannala, Juho},
booktitle = {Scandinavian Conference on Image Analysis (SCIA)},
year = {2019}
}