CoolFace
Datasetpublic

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.

sourceHugging Faceotherupdated 3mo agoView on Hugging Face
0likes152downloads
Dataset Card

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

SplitImagesAnnotationsAnns/image (mean)Unique resolutions
train4,228230,19054.44,223
valid74840,27553.8748
total4,976270,465——

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.

idnametrain annotationsvalid annotations
0objects00
1bathroom6,0981,045
2bed294
3door41,6427,328
4kitchen14220
5room38,7776,811
6stairs19537
7wall106,34018,605
8window36,9676,425

Data Fields

Each row is one floor-plan image with all of its annotations:

ColumnTypeDescription
image_idint64COCO image id
file_namestringOriginal image filename
imageImageThe floor-plan image (PIL, decoded on access)
widthint32Image width in pixels
heightint32Image height in pixels
annotationsSequence[dict] (columnar)All instance annotations for the image
splitstring"train" or "valid"

annotations is stored columnar (a dict of parallel lists). Each instance has:

SubfieldTypeDescription
idint64COCO annotation id
category_idint32Category id (see table above)
bboxfloat32[4][x, y, width, height] (COCO xywh, absolute px)
areafloat32Annotation area in px²
iscrowdint32COCO crowd flag
segmentationfloat32[][]Polygon(s), each a flat [x, y, x, y, ...] list

Usage

python
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 wall dwarfs the rarest classes:
  • —train imbalance ratio ≈ 3,667× (wall = 106,340 vs bed = 29)
  • —valid imbalance ratio ≈ 4,651× (wall = 18,605 vs bed = 4)
  • —bed, kitchen, and stairs are 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:

bibtex
@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}
}