image_id int64 107 9.05k | image imagewidth (px) 800 6.02k | file_name stringlengths 12 70 | width int32 800 6.02k | height int32 600 5.76k | tile_row int32 | tile_col int32 | file_name_original stringclasses 0
values | width_original int32 | height_original int32 | objects dict |
|---|---|---|---|---|---|---|---|---|---|---|
1,825 | ORE2020A_20200819_171744_PW17_IMGZOOM_DJI_20200819171744_0020_ZOOM.JPG | 5,184 | 3,888 | null | null | null | null | null | {
"id": [
31413,
31414,
31415,
31416,
31417,
31418,
31419,
31420,
31421,
31422,
31423,
31424,
31425,
31426,
31427,
31428,
31429,
31430,
31431,
31432,
31433,
31434,
31435,
31436,
31437,
31438,
31439,
31440,
... | |
410 | IMG_0302.jpg | 3,024 | 4,032 | null | null | null | null | null | {
"id": [
3642,
3643,
3644,
3645
],
"category_id": [
6,
6,
6,
2
],
"bbox": [
[
132,
231,
191,
334
],
[
0,
2100,
148,
133
],
[
0,
1448,
293,
269
],
[
112,
1374,
... | |
4,507 | DJI_20230419094729_0008_SUPR.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[56575,56576,56577,56578],"category_id":[6,2,6,5],"bbox":[[4596.0,2098.0,442.0,170.0],[4167.0,(...TRUNCATED) | |
4,013 | DJI_20230419093701_0015_SUPR.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[53804,53805],"category_id":[5,5],"bbox":[[1532.3599853515625,383.4599914550781,297.8699951171(...TRUNCATED) | |
3,658 | DJI_20210601105914_0023_SUPR.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[48463,48464,48465,48466,48467,48468,48469,48470,48471,48472,48473,48474,48475,48476,48477,484(...TRUNCATED) | |
2,287 | DJI_20210608124842_0011_SUPR.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[38470,38471,38472],"category_id":[5,5,6],"bbox":[[1760.7099609375,1075.25,25.1200008392334,53(...TRUNCATED) | |
1,680 | ORE2020A_20200819_152614_PW21_IMGZOOM_DJI_20200819152615_0752_ZOOM.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[27390,27391,27392,27393,27394,27395,27396,27397,27398,27399,27400,27401,27402,27403,27404,274(...TRUNCATED) | |
8,936 | DJI_20211122112819_0034_SUPR.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[74198,74199,74200,74201,74202,74203,74204],"category_id":[2,2,2,2,2,2,6],"bbox":[[434.0,0.0,3(...TRUNCATED) | |
1,425 | E17W_120607_0492.jpg | 5,616 | 3,744 | null | null | null | null | null | {"id":[23649,23650,23651,23652,23653,23654,23655,23656,23657,23658,23659,23660,23661,23662,23663,236(...TRUNCATED) | |
6,913 | DJI_20210901095937_0101_SUPR.JPG | 5,184 | 3,888 | null | null | null | null | null | {"id":[67639,67640],"category_id":[2,6],"bbox":[[1107.0,69.0,144.0,1294.0],[239.0,2129.0,361.0,396.0(...TRUNCATED) |
Cracks in the Foundation — Toy
A compact, reproducible sample of the Cracks in the Foundation dataset for quick experimentation and review. It covers the same 6 defect/condition categories as the full dataset:
Algae · Crack · Crack (net-crack) · Crack with precipitation · Rust · Spalling
Splits
Each split is its own parquet shard and its own dataset config. load_dataset(repo) returns all six in a DatasetDict. Naming a config — load_dataset(repo, "train_tiled", split="train") — is a true selective download, fetching only that shard.
| Split | Contents | Size |
|---|---|---|
train_full |
full-resolution training images | 100 |
val_full |
full-resolution validation images | 100 |
test_full |
full-resolution test images | 100 |
train_tiled |
1024×1024 tiles derived from training images | 100 |
val_tiled |
1024×1024 tiles derived from validation images | 100 |
test_tiled |
1024×1024 tiles derived from test images | 100 |
Full-resolution and tiled images are kept in separate splits so you can download only what you need.
Sampling
Each split was sampled from the corresponding split of the full dataset using:
images_sorted = sorted(source_images, key=lambda x: x["id"])
sample = random.Random(42).sample(images_sorted, 100)
- Method: uniform random without replacement
- Seed:
42(fixed) - Input order: source images sorted ascending by COCO
image_idbefore sampling, so the draw is stable regardless of JSON ordering
Rebuilding from the same source data and seed always yields the same 100 images per split.
Load
from datasets import load_dataset
# Load all six splits at once (single DatasetDict):
all_splits = load_dataset("nicolaaaaa/cif_dataset_toy")
# Selective: download only the tiled test shard.
# Each split is also exposed as its own config — naming a config
# downloads only its parquet files.
ds = load_dataset("nicolaaaaa/cif_dataset_toy", "test_tiled", split="train")
# Selective: download only the full-resolution training shard.
ds = load_dataset("nicolaaaaa/cif_dataset_toy", "train_full", split="train")
Schema
Every sample has the same fields regardless of split:
sample = ds[0]
sample["image_id"] # int — unique image identifier
sample["image"] # PIL.Image
sample["file_name"] # str — original filename
sample["width"] # int — image width in pixels
sample["height"] # int — image height in pixels
# Tiled-only fields (None for full-resolution samples):
sample["tile_row"] # int | None — top-left row of the tile in the original image
sample["tile_col"] # int | None — top-left column
sample["file_name_original"] # str | None — filename of the parent image
sample["width_original"] # int | None — parent image width
sample["height_original"] # int | None — parent image height
# Annotations (COCO convention):
obj = sample["objects"]
obj["id"] # List[int]
obj["category_id"] # List[int] — 1=Algae 2=Crack 3=Crack(net) 4=Crack+precip 5=Rust 6=Spalling
obj["bbox"] # List[[x, y, w, h]] — pixels, COCO origin (top-left)
obj["area"] # List[float]
obj["iscrowd"] # List[int]
obj["segmentation"] # List[List[List[float]]] — polygons as flat [x1,y1,x2,y2,...] lists
Distinguish sample type at runtime:
is_tile = sample["tile_row"] is not None
Visualize
import tempfile
from pathlib import Path
import fiftyone as fo
from datasets import load_dataset
CATS = {1: "Algae", 2: "Crack", 3: "Crack (net-crack)",
4: "Crack with precipitation", 5: "Rust", 6: "Spalling"}
ds = load_dataset("nicolaaaaa/cif_dataset_toy", split="test_tiled")
tmp = Path(tempfile.mkdtemp())
fo_ds = fo.Dataset("cif_toy_test_tiled", overwrite=True)
for s in ds:
img_path = tmp / Path(s["file_name"]).name
s["image"].save(img_path)
W, H = s["width"], s["height"]
dets, polys = [], []
obj = s["objects"]
for i, cid in enumerate(obj["category_id"]):
label = CATS.get(cid, str(cid))
x, y, w, h = obj["bbox"][i]
dets.append(fo.Detection(label=label, bounding_box=[x/W, y/H, w/W, h/H]))
for poly in obj["segmentation"][i]:
if len(poly) < 6:
continue
pts = [[poly[j]/W, poly[j+1]/H] for j in range(0, len(poly), 2)]
polys.append(fo.Polyline(label=label, points=[pts], filled=True, closed=True))
fo_ds.add_sample(fo.Sample(
filepath=str(img_path),
detections=fo.Detections(detections=dets),
segmentations=fo.Polylines(polylines=polys),
))
session = fo.launch_app(fo_ds)
session.wait()
Full dataset
The full dataset (all images, all splits) is available at ibm-research/cif-dataset. It has the identical schema and split naming convention.
Citation
@dataset{cracks_in_the_foundation,
author = {},
title = {Cracks in the Foundation},
year = {2025},
publisher = {HuggingFace},
url = {https://huggingface.co/datasets/ibm-research/cif-dataset},
}
- Downloads last month
- 234