CwI-Bench — Code-with-Image Bench
30 code-with-image tasks where models must write and run code against the image to reach the answer — pure visual inspection ("just look") is insufficient by design: answers require pixel-level precision (±px coordinates, exact counts, sub-degree angles, per-channel color recovery).
Each task is a config; each config has three splits:
| split | size | source photos | role |
|---|---|---|---|
train |
60 (15/tier) | COCO train2017 | reflection / skill-learning (tr60) |
validation |
50 (13/13/12/12) | COCO train2017 | selection set (sel50, the exact stratified slice used in runs) |
test |
100 (25/tier) | COCO val2017 | final evaluation (test_mini) |
Zero photo overlap between train/validation (train2017) and test (val2017).
Difficulty tiers: easy / medium / hard / expert in the difficulty column.
from datasets import load_dataset
d = load_dataset("ytz009/image_pot_bench", "alignment")
item = d["test"][0] # columns: id, image, image_2, prompt, answer, difficulty, meta
image_2 is non-null only for two-image tasks (e.g. congruent_pair). meta is a JSON string with
generation parameters (constructive ground truth). Scoring rules per task are given in the Scoring section below.
Scoring
Every item is scored all-or-nothing (0/1) — there is no partial credit, and a task's accuracy is the mean over its 100 held-out test items. The model's answer is the last <answer>…</answer> span in its output; no span scores 0. The rule column below is the exact condition under which a prediction is counted correct (it scores 1 if the condition holds, else 0). Discrete answers (permutations, counts, index sets, transform tuples) must match exactly; continuous answers (pixels, angles, RGB values, percentages) must fall within the task's tolerance — the tolerance is part of the task definition, and every generator rejects any sample a shortcut could land inside it.
Across the 30 tasks: 9 exact · 20 tolerance · 1 exact+tolerance (ring_rotor).
Each entry reads task — criterion — the condition under which a prediction is counted correct.
Transformation
circular_shift— tolerance —dx,dyeach within ±2 px of the true shiftrestore_then_count— exact — the integer equals the true countshift_rot_align— tolerance —dx,dywithin ±2 px each and θ within ±1.875° (circular)alignment— tolerance —dx,dyeach within ±2 pxrot_scale— tolerance — angle within ±3° (circular) and scale within ±0.05transform_chain— exact — the(dx,dy,rot_k,fliph)tuple matches in every fieldunshuffle2d— exact — both the row and column permutations match exactlyjigsaw— exact — the full piece-order sequence matches exactlyrotated_jigsaw— exact — the full tile-and-rotation assignment matches exactlyrestore_then_measure— tolerance — the percentage is within ±1.5 ppring_rotor— exact+tol — the ring index is exact and the angle within ±5°double_exposure— tolerance — every signed shift is within ±8 px (count and order match)
Perception
grating_period— tolerance — the period is within ±1.5anomaly_v2— exact — the reported cell set equals the true anomaly setpeak_count— exact — the integer equals the true countcongruent_pair— exact — the reported index pair equals the true congruent pairtrace_length— tolerance — length/200 is within ±0.3scan_moire— tolerance — the scale is within ±0.004
Localization
crop_provenance— tolerance — the box reaches IoU ≥ 0.5 with the true crop (coords normalized 0–1000)brightest_blob— tolerance — the point is within ±2 px on the 480-px canvassub_rect_swap— tolerance — both boxes reach IoU ≥ 0.5, order-free (coords normalized 0–1000)retouch_region— tolerance — the box reaches IoU ≥ 0.5 with the true region (coords normalized 0–1000)circle_fit— tolerance — the point is within ±4 px on the 480-px canvasprint_misreg— tolerance —dx,dyare each within ±0.3 pxgain_center— tolerance — every spotlight centre is within ±15 px (in strength order)
Color
film_color— tolerance —R,G,Beach within ±10swatch_rgb— tolerance —R,G,Beach within ±10patch_mean_dots— tolerance —R,G,Beach within ±10color_count— exact — the integer equals the true countchannel_mix— tolerance —R,G,Beach within ±8
Tasks (30)
Transformation & rearrangement: circular_shift, restore_then_count, shift_rot_align, alignment, rot_scale, transform_chain, unshuffle2d, jigsaw, rotated_jigsaw, restore_then_measure, ring_rotor, double_exposure
Perception & counting: grating_period, anomaly_v2, peak_count, congruent_pair, trace_length, scan_moire
Localization: crop_provenance, brightest_blob, sub_rect_swap, retouch_region, circle_fit, print_misreg, gain_center
Color: film_color, swatch_rgb, patch_mean_dots, color_count, channel_mix
Note: trace_length uses the revised (v2fix) generator with a reference-solver fairness screen.
- Downloads last month
- 101