yrlyrl's picture
Add files using upload-large-folder tool
cd0463f verified
|
Raw History Blame Contribute Delete
22.6 kB
---
license: other
license_name: upstream-undeclared
license_link: https://huggingface.co/datasets/leo66666/messytable
pretty_name: "Spatial MMCoT v1 - messytable_relabel"
language:
- en
task_categories:
- visual-question-answering
- image-to-image
tags:
- spatial-reasoning
- interleaved-reasoning
- multimodal-chain-of-thought
size_categories:
- 1K<n<10K
configs:
- config_name: preview
default: true
data_files:
- split: train
path: preview/train/*.parquet
- split: validation
path: preview/validation/*.parquet
- config_name: train
data_files:
- split: train
path: train/*.parquet
- split: validation
path: validation/*.parquet
- config_name: meta
data_files:
- split: train
path: meta/train/*.parquet
- split: validation
path: meta/validation/*.parquet
---
# Spatial MMCoT v1 · `messytable_relabel`
Multi-camera tabletop counting on real photographs from MessyTable (Z. Cai, J. Zhang, D. Ren, C. Yu, H. Zhao, S. Yi, C. K. Yeo and C. C. Loy, "MessyTable: Instance Association in Multiple Camera Views", ECCV 2020; https://github.com/caizhongang/MessyTable), with questions asked again from MessyTable's own per-instance annotations. Two to seven angled views of one table arrangement are the input (the `union_center` crops released in `leo66666/messytable`); the target is the real photograph from MessyTable's fixed overhead camera (cam1), which never appears among the inputs. Three kinds of question, at most one of each per arrangement: how many of one item there are (a fine class, or a few classes a 512 px photo cannot tell apart), how many of one group (MessyTable's 13 groups, named with their kinds spelled out), and which of four groups is the most numerous (A-D, a margin of at least 2 over every other group on the table). A count is asked only when every counted object is annotated in the overhead photo and in at least one input view, every counted box is at least 24 px on its short side, and no look-alike item or group is on the table; counts run from 2 to 6. Why not `leo66666/messytable`'s answers: on 48.6% of its train rows the answer counts one fine class inside the category the question names (measured against the original labels). Both upstream train and val splits are used, split here by capture set-up; the upstream test split is never read: it is the pool of the IPT paper's MessyTable counting benchmark. The reasoning text was written for this release by Qwen3.8-27B from the photographs, the question and the answer (the r4 rewrite; see below). If you use these images, cite MessyTable.
## Reasoning text in this release (r4)
This source is new in this release. Its rows were built with placeholder thoughts, and every thought was then written by the rewrite: Qwen3.8-27B in thinking mode (temperature 1.0, top-p 0.95, top-k 20; prompt v4.1, `scripts/annotate/rationale.py` in our conversion code (the code repository is not public yet)) was shown the row's input images, its target images in order, the question, the options and the answer, and wrote the thought before each target image (what is still unknown, and what the picture should show to settle it) and the read-back after the last one. The images, the question, the options and the answer are the build's, checked row by row (image bytes, instruction, K and the `<answer>` value); a row the rewrite did not reach is not released.
This is the training subset: 64 rows of r4 are not in it, listed with their reason in `reports/subset_dropped.jsonl`: 64 the rewrite model judged the stored answer doubtful (its note is in the list) (`label_doubt`).
**Supervision kind** (`supervision_kind` in `meta`): `full_interleaved` on every row: the trace interleaves text and target images (drawn or rendered states on most sources; the source note above says which), and the read-back comes after the target image it reads. In this release the text was rewritten by a model shown every image of the row (see the r4 section above).
Upstream: [`leo66666/messytable`](https://huggingface.co/datasets/leo66666/messytable). Licence: **undeclared**. The upstream repository declares no licence; this converted copy is shared for research use only, whatever terms the upstream authors set apply to it as well, and it will be taken down at their request. The photographs are MessyTable's: its code repository is MIT-licensed, and neither that repository nor the project page states separate terms for the image data.
## Known issues
No row of this source is listed in `reports/known_issues/` (its `summary.json` is empty).
## Size
| split | rows | target image slots | distinct target images |
|---|---:|---:|---:|
| train | 6,334 | 6,334 | 3,369 |
| validation | 107 | 107 | 74 |
A slot is one target position in one row; rows can share a target image (same scene or same intermediate state), and a row can repeat one of its own targets, so there are fewer distinct images (by content hash) than slots.
| task | train | validation |
|---|---:|---:|
| multiview_count | 6,068 | 103 |
| multiview_most_common | 266 | 4 |
Input images per row: 2 to 7. Target images per row (the images the model is trained to generate): 1.
Image corpus (`source_scene_corpus`): messytable 6,441.
## Row format
One row is: input image(s) and a question, then K rounds of *thought → target image* (the target is the source's own ground-truth image, which the model is trained to generate), then a final thought (normally a read-back of the last target; where a source's final thought is something else, or often leaves out the answer, the source note or Known issues says so) and the answer; here K is 1. In the `train` config:
```
image_list list<binary> inputs first, then the K target images in order
num_input_images int64 how many of image_list are inputs
instruction_list list<string> one element: system prompt + question, + options on 270 of 6,441 rows
output_text_list list<string> K+1 elements:
[0] <think>plan 1</think><image_start>
[j] <image_end><think>plan j+1</think><image_start>
[K] <image_end><think>read-back</think><answer>answer</answer>
row_uid string join key to `meta` and `preview`
```
`<answer>` holds what the model is trained to emit. On 6,171 of 6,441 rows it equals `meta.answer_value`; on the other 270 (answer type `mcq_letter` 270) it holds the option key (a letter for `mcq_letter`), while `meta.answer_value` (the `answer` column of `preview`) holds that option's text. Map the key through the options listed in the question before comparing the two, and score model output against `<answer>`.
The system prompt is ThinkMorph's `VLM_THINK_SYSTEM_PROMPT` from its `inferencer.py`, verbatim (`GEN_THINK_SYSTEM_PROMPT` there has the same text), including its leading and trailing newline. The markers are plain strings, not tokenizer special tokens; the prompt writes `</image_end>` and the data writes `<image_end>`, exactly as the ThinkMorph-7B checkpoint was trained.
`preview` shows the same rows with one column per slot: `input_image_i` for the inputs; for each of the K = `num_steps` rounds, the plan `thought_j` and its target `target_image_j`; and the read-back in `thought_1` on every row.
`meta` holds the per-row sidecar: task, `scene_id` and `geometry_uid` (the scene and geometry keys; the split key is named in the split paragraph below), `trajectory_id` (a camera-path or sample label, empty where the source has none), `num_steps`, `num_input_images`, `answer_type`, `answer_value`, `majority_class_rate`, `target_image_kind`, `target_px`, `est_tokens`, licence, `split` (`train` / `validation`, the Hub split names), `supervision_kind` (`full_interleaved` / `visual_aux` / `visual_only`) and `filter_flags`. `majority_class_rate` is the share of the task's most frequent `answer_value` among its training rows: it measures answer skew and is not a guessing baseline (where a task mixes question types or each row has its own options it can be far below chance); compare scores with the text-only baselines below.
Per-row `license` in `meta`: undeclared 6,441.
Flags on released rows (`filter_flags` in `meta` and `preview`, comma-separated):
| flag | rows | meaning |
|---|---:|---|
| `S5.replay_unsupported` | 6,441 | no solver re-derives this task's answer from the trace, so S5 did not replay it |
| `S14.sampled_qa` | 199 | chosen for the S14 human spot-check (`reports/s14_sample.tsv`) |
### Training with a BAGEL-family loader
Rows here have 2 to 7 input images: the first `num_input_images` entries of `image_list` are inputs and the rest are targets, so the loader must read `num_input_images`. The `UnifiedEditIterableDataset` of the IPT release (https://github.com/weikaih04/Imaginative-Perception-Token, `data/interleave_datasets/edit_dataset.py`) does: its `parse_row` conditions on `image_list[:num_input_images]` and trains the remaining images as targets, one after each `output_text_list` element but the last. The stock ThinkMorph loader (the same class in https://github.com/ThinkMorph/ThinkMorph) does not: it conditions on `image_list[0]` only and trains `image_list[j+1]` after `output_text_list[j]`, the answer element included, so every input after the first is trained as a generated image and every target moves one slot later per extra input. Every row here has one target, so on a row with exactly two inputs it trains `image_list[1]` (the second input view) after the plan and `image_list[2]` (the real target) after the answer; on a row with three or more inputs it trains `image_list[1]` after the plan and `image_list[2]` after the answer, both of them input views, and the real target is never trained. It raises no error. To use it, make two changes in its `parse_row`:
```
k = int(row.get("num_input_images", 1) or 1)
for im in images[:k]: # replaces the single _add_image(images[0], ...)
data = self._add_image(data, pil_img2rgb(Image.open(io.BytesIO(im))),
need_loss=False, need_vae=True, need_vit=True)
...
img_idx = idx + k # replaces img_idx = idx + 1
```
The stock BAGEL edit loader (ByteDance-Seed/Bagel) cannot train these rows: it never reads `output_text_list` and expects each `instruction_list` element to be a list of paraphrases.
`parquet_info.json` keys each training chunk as `<source>/<split>/<file>`, here `messytable_relabel/train/chunk_00000.parquet`, with row-group counts read from the parquet footers. The loader matches a chunk only when its key equals the path it builds, `os.path.join(data_dir, file)`, and skips a chunk with no key without a warning: a source that is alone in its group then fails with `IndexError: list index out of range`, and in a mixed group it adds no rows. Download into a directory named after the source, not after the repository:
```python
from huggingface_hub import snapshot_download
snapshot_download("yrlyrl/spatial-mmcot-messytable_relabel", repo_type="dataset", local_dir="<root>/messytable_relabel",
allow_patterns=["train/*", "validation/*", "parquet_info.json", "reports/known_issues/*"])
```
Then either run from `<root>` with `data_dir: messytable_relabel/train` and `parquet_info_path: messytable_relabel/parquet_info.json`, or rebuild the index with absolute keys and use an absolute `data_dir`:
```python
import json, os
root = "/abs/path/to/root" # the directory that holds messytable_relabel/
info = json.load(open(os.path.join(root, "messytable_relabel", "parquet_info.json")))
info = {os.path.join(root, k): v for k, v in info.items()}
json.dump(info, open(os.path.join(root, "messytable_relabel", "parquet_info_abs.json"), "w"))
# data_dir = os.path.join(root, "messytable_relabel", "train") (spelled exactly so, no trailing slash)
# parquet_info_path = os.path.join(root, "messytable_relabel", "parquet_info_abs.json")
```
The Hugging Face cache (`.../snapshots/<hash>/train/`) or a folder named `spatial-mmcot-messytable_relabel` matches no key.
`num_used_data` counts chunk files, not rows: the loader repeats this source's file list up to that number, lists every (file, row group) pair, and deals whole row groups out, floor(R / world_size) to each rank and floor(that / num_workers) to each DataLoader worker. The remainder is never read. This source has 1 training chunk file holding 50 row groups of up to 128 rows, so keep `num_used_data` large, e.g. the 128 of ThinkMorph's `interleaved_reasoning.yaml` (upstream's `example.yaml` asks for more than GPUs x workers); every row group is then read. Set to 1 and alone in its group on 8 GPUs with 4 workers, it reads only 32 of the 50 row groups. In a run that mixes sources, give each source the same multiple of its own training chunk-file count, e.g. 128 per file (128 here): the file list is repeated up to `num_used_data` entries, so a flat 128 for every source would read a two-file source's rows half as often as a one-file source's.
## How the rows were chosen
| stage | rows |
|---|---:|
| questions asked of the upstream train and val arrangements | 6,896 |
| refused before conversion (`S0raw`; each reason is in the table below) | 257 |
| after conversion and per-row filters | 6,639 |
| removed by S10 (none) | 0 |
| removed by answer-prior balancing (S13) | 134 |
| removed for training after the r4 rewrite (`subset_dropped.jsonl`) | 64 |
| **released** | **6,441** |
Every removed row has one line, with its reason, in `reports/`:
| file | step | reason (the line's `flag`, or the field shown) | rows |
|---|---|---|---:|
| `build/dropped.jsonl` | S0raw | `S0.no_question` | 257 |
| `s13_dropped.jsonl` | S13 | `step: answer` | 134 |
| `subset_dropped.jsonl` | r4 | `reason: label_doubt` | 64 |
Every line of `s13_dropped.jsonl` has `reason: prior_downsample`; `step` names the balancing pass that removed it, and `split` is written `train` or `val` (the Hub's `validation`).
`S0raw` lines in `build/dropped.jsonl` were refused before a release row existed, so their `row_uid` field holds the converter's key for the upstream record, not a 16-hex `row_uid`; lines from later steps carry the `row_uid` the row had. No removed row appears in `meta` or `preview`.
<details><summary>Per-step counters of the conversion</summary>
6,896 upstream rows were read; `S0raw` refused 257 before a row existed and passed 6,639 to the first step. `S0` runs once more, last, on the final bytes. The reason for every refused, dropped or quarantined row is in the files above.
| step | in | out | dropped | quarantined | rejected | repaired |
|---|---:|---:|---:|---:|---:|---:|
| S0raw (refused before conversion) | 6,896 | 6,639 | 0 | 0 | 257 | 0 |
| S4 | 6,639 | 6,639 | 0 | 0 | 0 | 0 |
| S4c | 6,639 | 6,639 | 0 | 0 | 0 | 0 |
| S5 | 6,639 | 6,639 | 0 | 0 | 0 | 0 |
| S8 | 6,639 | 6,639 | 0 | 0 | 0 | 0 |
| S9 | 6,639 | 6,639 | 0 | 0 | 0 | 0 |
| S0 (final structural check, after S9) | 6,639 | 6,639 | 0 | 0 | 0 | 0 |
</details>
The train/validation split keeps rows sharing a `scene_id` in `meta` on one side, and the assignment is frozen (`splits/` in the summary repository). S12 saw 6,639 rows under 379 keys. No validation input image has the content of a training input image. The S12 run did not record whether its pixel-level near-copy test ran for this source, so near-copies are not ruled out.
### Answer-prior balancing (S13)
Each (task, split) group is checked separately. An answer is the answer value compared as lower-cased text without a trailing full stop, with 'farther' read as 'further' and 'nearer' as 'closer' (for multiple choice, the option text, not the letter; where the candidates are drawn in the image, as in zebra_jigsaw and zebra_tetris, the answer is the letter itself). An answer is real when it holds at least 5 rows and 2% of the group; k is the number of real answers. Answer step: the target is max(30%, 1/k) when k >= 2, and max(30%, 1/d) over the d distinct answers when k = 1; a validation group uses the larger of its own target and its task's train target. A group is cut only when k >= 1 and its most common answer holds more than the target plus 5 percentage points; every answer is then capped at one common count, chosen so that none exceeds the target, and smaller answers keep all their rows. At the answer step, a group at or below that trigger, or with no real answer (k = 0), is left as it is, so its most common answer can hold up to the target plus 5 percentage points. A task whose train group has exactly two real answers is instead cut, in every split, so that its two largest answers have equal counts, with no trigger. Rank and label steps: then, in a group where every option value of every row is a number, the rank of the correct option among the sorted values, and after it, in a group where every trained answer is an option label, the label, are each capped by the same cut-and-trigger rule on their own counts (own target, validation included): capped, never evened out, so two labels are cut only when one exceeds 55%, and then only down to 50%. These steps can also cut groups the answer step left whole, including k = 0 groups, and can raise an answer's final share above its target; the run fails if a real answer ends above the target plus 5 percentage points. A train group of at least 20 rows in which one answer holds 90% or more fails the run. PET (exact_cells_pet) instead cuts each (question type x turn direction) cell to equal counts of its two answers; a PET cell that shows only one answer is removed.
| task | split | pass | rule | rows in → out | real answers k | target | largest share, before → after | cut |
|---|---|---|---|---:|---:|---:|---:|---|
| multiview_count | train | answer | `cap30[canon]` | 6,130 → 6,130 | 5 | 30.0% | 34.1% → 34.1% | no |
| multiview_count | validation | answer | `cap30[canon]` | 146 → 104 | 5 | 30.0% | 37.7% → 29.8% | yes |
| multiview_most_common | train | answer | `cap30[canon]` | 359 → 267 | 10 | 30.0% | 47.9% → 30.0% | yes |
| multiview_most_common | train | letter | `cap30[letter]` | 267 → 267 | 4 | 30.0% | 28.1% → 28.1% | no |
| multiview_most_common | validation | answer | `cap30[canon]` | 4 → 4 | 0 | 30.0% | 50.0% → 50.0% | no |
| multiview_most_common | validation | letter | `cap30[letter]` | 4 → 4 | 0 | 30.0% | 50.0% → 50.0% | no |
S13 removed 134 rows from this source.
### Text-only baselines
Accuracy of guessers that never see an image. For each task the released training rows are split into two fixed halves by a hash of `row_uid`; each guesser is fitted on one half and scored once on the other (one held-out half, not cross-validation; `eval rows` below). The reference is chance (the mean of 1 / number of options) where every row is multiple choice, and otherwise the eval-half accuracy of always giving the answer most common in the fit half (when a task's top answers are nearly tied, this need not be the task's most common answer; the line after the table gives that answer's validation score). Accuracies are recounted from the stored rates and `eval rows`, so they are exact. A task is flagged when a text-only guesser beats its reference by more than 0.15 (for a free-form task, a guesser other than the most common answer). A flagged task can be partly answered from the text alone; an unflagged task passed only these probes, which do not prove the text carries no answer. Report scores on every task next to this baseline.
Guessers: `keywords`: the most common answer per set of spatial words in the question; `last_mentioned`: the option named last in the question body; `letter_prior`: the most common answer letter; `majority`: the answer most common in the fit half; `option_prior`: the option text that won most often when shown; `template`: the most common answer per question wording (numbers masked, object names kept).
| task | best text-only guesser | accuracy | reference | margin | eval rows | flagged |
|---|---|---:|---:|---:|---:|---|
| multiview_count | `template` | 0.577 | 0.327 (majority) | +0.250 | 3,106 | **yes** |
| multiview_most_common | `option_prior` | 0.488 | 0.250 (chance) | +0.238 | 125 | **yes** |
Always giving the most common training answer, scored on the validation split (the constant baseline to compare validation scores with): multiview_count: always answering `4` (34.0% of training rows) scores 0.291 (30/103).
## Spot-check (S14)
**Pending.** The S14 rows are chosen and flagged `S14.sampled_qa` in `meta` and `preview`; the human pass over them has not been signed off yet.
## Citation
Please cite MessyTable, whose photographs and annotations these questions come from (bibtex from its repository), and credit [`leo66666/messytable`](https://huggingface.co/datasets/leo66666/messytable) for the image crops:
```bibtex
@inproceedings{CaiZhang2020MessyTable,
title={MessyTable: Instance Association in Multiple Camera Views},
author={Zhongang Cai and Junzhe Zhang and Daxuan Ren and Cunjun Yu and Haiyu Zhao and Shuai Yi and Chai Kiat Yeo and Chen Change Loy},
booktitle={Proceedings of the European Conference on Computer Vision (ECCV)},
month={August},
year={2020}
}
```
## Provenance
The release files were written by our conversion code (the code repository is not public yet), `scripts/convert/export.py` at commit `d538e63b2460`, from build `messytable_relabel_mt1`. The build was made by `scripts/convert/run_source.py` from the same repository at commit `836ffe84d25d`. S10, S12 and S13 ran before the export; `reports/export_manifest.json` pins every input the export read by SHA-1 (`build_manifest_sha1`, `s10_keep_sha1`, `s12_assignments_sha1`, `s13_balanced_keep_sha1`).
Every row removed between upstream and this release has one line, with its reason, in `reports/`: `build/dropped.jsonl` (rows refused before conversion or dropped by a conversion step); `build/quarantine.jsonl` (rows set aside by S4c because an automatic check could not match the read-back's conclusion to the label); `s10_dropped.jsonl` (duplicates removed by S10); `s10_label_conflicts.jsonl` (rows S10 withheld because another row asks the identical question, options in the same order, of the same images with a different answer); `s13_dropped.jsonl` (rows removed by answer-prior balancing). `known_issues/` lists rows with a measured problem (see Known issues); `reports/` also holds the build manifest (absolute paths cut to basenames) and counters, the S14 sample list (`s14_sample.tsv`: row_uid, task, split) and `export_manifest.json`. Part of [`yrlyrl/spatial-mmcot`](https://huggingface.co/datasets/yrlyrl/spatial-mmcot).