| --- |
| license: cc-by-4.0 |
| task_categories: |
| - image-to-text |
| - visual-question-answering |
| language: |
| - en |
| tags: |
| - jigsaw-puzzle |
| - spatial-reasoning |
| - vlm-benchmark |
| - geometric-reasoning |
| - vision-language |
| - fine-tuning |
| size_categories: |
| - 10K<n<100K |
| pretty_name: "JigShape Train & Eval" |
| --- |
| |
| # JigShape: Train & Evaluation Splits |
|
|
| This repository contains the **training** and **evaluation** splits of the [JigShape benchmark](https://huggingface.co/datasets/ShawnLi02/JigShape) for fine-tuning and evaluating Vision-Language Models on geometric jigsaw puzzle solving. |
|
|
| > The held-out **test split** is available separately at [ShawnLi02/JigShape](https://huggingface.co/datasets/ShawnLi02/JigShape). |
|
|
| ## Overview |
|
|
| JigShape is a benchmark that evaluates **joint visual-geometric reasoning** in VLMs. Unlike traditional jigsaw benchmarks that use rectangular cuts (which create ambiguous ground truth in repeated-texture regions), JigShape features **tab-and-blank interlocking pieces** where geometric constraints ensure every puzzle has a unique solution. |
|
|
| Models must predict the correct grid position for each labeled piece by reasoning about both visual content (texture, color, object boundaries) and geometric constraints (tab-blank edge compatibility). |
|
|
| ## Dataset Statistics |
|
|
| | Split | 4x4 | 8x8 | 12x12 | 16x16 | Total | |
| |:------|----:|----:|------:|------:|------:| |
| | **Train** | 22,992 | 22,992 | 22,992 | 22,992 | **91,968** | |
| | **Eval** | 250 | 250 | 250 | 250 | **1,000** | |
|
|
| - **Source images**: 23,742 unique high-resolution images from DIV2K, DIV8K, and Unsplash |
| - **No overlap**: Train and eval splits are partitioned by source image; the same image never appears in both |
|
|
| ## Directory Structure |
|
|
| ``` |
| train/ |
| grid_4x4/ |
| DIV2K_0001/ |
| layout.png # Shuffled pieces displayed on a grid, labeled with piece IDs |
| source.png # Original image (ground truth reference) |
| ground_truth.json # Piece-to-position mapping and edge signatures |
| DIV2K_0002/ |
| ... |
| grid_8x8/ |
| grid_12x12/ |
| grid_16x16/ |
| |
| validation/ |
| grid_4x4/ |
| grid_8x8/ |
| grid_12x12/ |
| grid_16x16/ |
| |
| split_index.json # Canonical list of image IDs per split |
| ``` |
|
|
| ## Instance Format |
|
|
| Each instance directory contains three files: |
|
|
| ### `layout.png` |
| The model input: all N x N pieces arranged in ID order (not solution order) on a display board. Each piece is labeled with its numeric ID and shows its tab/blank/flat edge shapes. |
|
|
| ### `source.png` |
| The original uncut image, provided for reference and visualization. |
|
|
| ### `ground_truth.json` |
| ```json |
| { |
| "instance_id": "DIV2K_0001", |
| "grid_size": 4, |
| "n_pieces": 16, |
| "id_to_position": { |
| "7": [0, 0], |
| "9": [0, 1], |
| "5": [0, 2], |
| "...": "..." |
| }, |
| "edge_signatures": { |
| "7": {"top": "flat", "right": "tab", "bottom": "blank", "left": "flat"}, |
| "9": {"top": "flat", "right": "tab", "bottom": "tab", "left": "blank"}, |
| "...": "..." |
| } |
| } |
| ``` |
| |
| **Fields:** |
| - `id_to_position`: Maps each piece ID to its correct `[row, col]` position in the solved puzzle |
| - `edge_signatures`: Each piece's four edges typed as `tab` (convex), `blank` (concave), or `flat` (border) |
|
|
| ## Edge Types & Compatibility Rules |
|
|
| | Edge Type | Description | Constraint | |
| |:----------|:------------|:-----------| |
| | **Tab** | Convex semicircular protrusion | Must pair with a **blank** on the adjacent piece | |
| | **Blank** | Concave semicircular indentation | Must pair with a **tab** on the adjacent piece | |
| | **Flat** | Straight edge | Only on puzzle borders (corners have 2, edges have 1, interior pieces have 0) | |
|
|
| ## Evaluation Metrics |
|
|
| | Metric | Description | |
| |:-------|:------------| |
| | **Piece Accuracy (PA)** | Fraction of pieces placed in their correct position | |
| | **Exact Match (EM)** | Whether the entire puzzle is solved correctly (all pieces correct) | |
|
|
| ## Quick Start |
|
|
| ```python |
| from huggingface_hub import snapshot_download |
| |
| # Download eval split only (~5 GB) |
| snapshot_download( |
| repo_id="ShawnLi02/JigShape-Train", |
| repo_type="dataset", |
| allow_patterns="validation/**", |
| local_dir="./JigShape" |
| ) |
| |
| # Download a specific grid size for training (~120 GB for 16x16) |
| snapshot_download( |
| repo_id="ShawnLi02/JigShape-Train", |
| repo_type="dataset", |
| allow_patterns="train/grid_4x4/**", |
| local_dir="./JigShape" |
| ) |
| ``` |
|
|
| ## Related Resources |
|
|
| - **Test split** (held-out for competition): [ShawnLi02/JigShape](https://huggingface.co/datasets/ShawnLi02/JigShape) |
| - **Paper**: *JigShape: Can Vision-Language Models Solve Jigsaw Puzzles?* (under review) |
|
|
| ## Citation |
|
|
| ```bibtex |
| @article{jigshape2025, |
| title={JigShape: Can Vision-Language Models Solve Jigsaw Puzzles?}, |
| author={Anonymous}, |
| year={2025} |
| } |
| ``` |
|
|
| ## License |
|
|
| This dataset is released under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) license. |
|
|