| --- |
| license: bsl-1.0 |
| pretty_name: Widget2Code Data |
| task_categories: |
| - image-to-text |
| tags: |
| - screenshot-to-code |
| - react |
| - jsx |
| - multimodal |
| --- |
| |
| # Widget2Code Data |
|
|
| Widget screenshots paired with the evaluation evidence that depends only on |
| them, plus self-contained image-code examples. |
|
|
| ## Directory layout |
|
|
| ```text |
| train/ # 1,822 widget screenshots |
| test/ # 1,000 widget screenshots |
| sft/ # 1,816 complete examples |
| sft-v3/ # raw Gemini 3.1 Pro generations, split into train/ and test/ |
| sft-v3-fixed/ # policy-repaired, fully renderable versions of sft-v3 |
| agentic/ # 232 teacher/student correction trajectories and their renders |
| |
| verify_draft_qwen35_4b_20260827/ # full-SFT 4B outputs on train and test |
| verify_draft_qwen35_9b_lora_20260827/ # merged LoRA-SFT 9B outputs on train and test |
| verify_draft_qwen35_27b_20260827/ # merged LoRA-SFT 27B outputs on train and test |
| |
| sft-v3/<train|test>/image_0004/ |
| sft-v3-fixed/<train|test>/image_0004/ |
| ├── image.png # the widget |
| ├── metadata.json # labels + precomputed evaluation intermediates |
| ├── ocr.txt # OCR evidence, as fed to a prompt |
| ├── palette.txt # palette evidence, as fed to a prompt |
| ├── code.jsx # JSX paired with the target image |
| ├── rendered.png # sft-v3*: generated code render; absent on raw render failures |
| ├── dims.txt # exact target width and height |
| └── evaluation/ |
| ├── evaluation.json # metrics for a successful render |
| ├── ocr.json # OCR results for target and render |
| ├── evaluation_black.json # raw render failures only |
| └── evaluation_white.json # raw render failures only |
| ``` |
|
|
| The three `verify_draft_*` directories preserve one stochastic generation per |
| benchmark sample. Each split has a `summary.json`; each sample directory has the |
| raw response, extracted `widget.jsx`, `meta.json`, and `rendered.png` when render |
| succeeded. The model sizes used the same inference contract, but their training |
| recipes differ, so these outputs are validation artifacts rather than a pure |
| parameter-scaling ablation. |
|
|
| `sft/` is a separate split, not a view of `train/`: its `image.png` is the |
| render of `code.jsx`, not the original screenshot of the same id, and its OCR |
| and palette describe that render. |
|
|
| `sft-v3/` and `sft-v3-fixed/` use the corresponding original `train/` or |
| `test/` screenshot as `image.png`; their OCR and palette files describe that |
| target. `rendered.png` is the output of `code.jsx`. The train split contains |
| 1,822 samples (1,706 raw renders and 1,822 fixed renders). The test split |
| contains 1,000 samples (936 raw renders and 1,000 fixed renders). Raw render |
| failures are retained as code examples with the error recorded in |
| `metadata.json`, and no mismatched render is substituted. |
|
|
| All four `sft-v3{,-fixed}/<train|test>` splits include prediction-side |
| evaluation caches produced by `widget2code-bench-exp` 1.0.0. A successful |
| render has `evaluation/evaluation.json` and `evaluation/ocr.json`. A raw sample |
| without a render instead has paired black/white fallback evaluations, so every |
| sample is covered without substituting the fixed render. Each split also has |
| `evaluation.xlsx` and `.eval_v1.0.0/metrics/` aggregate summaries. |
|
|
| The train code was generated with the archived v3 prompt. The test code was |
| generated with the v3.1 prompt in `core/generation/prompts/widget_simple.md`; |
| its prompt version and SHA-256 are recorded in each test `metadata.json`. |
|
|
| ## metadata.json |
|
|
| ```jsonc |
| { |
| "id": "image_0004", "split": "train", |
| "sha256": "…", // of image.png; a cache is only valid for its bytes |
| "size": [976, 668], |
| "category": "calendar", // train/sft: one of 16; test: null (never labelled) |
| "has_chart": null, // test: true/false; train/sft: null (never labelled) |
| "eval": { |
| "layout": { "margin": [...], "mask_empty": false, "bbox_ar": ..., "area_ratio": ..., "n_comp": ... }, |
| "legibility": { "text": "...", "ocr": [[bbox, text, confidence], ...], "contrast": ..., "contrast_local": ... }, |
| "style": { "hue_hist": [36], "sat_hist": [30], "polarity": [sign, strength] }, |
| "fill": { "black": {...}, "white": {...} } |
| } |
| } |
| ``` |
|
|
| `eval` holds the half of a benchmark score that depends on the ground truth |
| alone, so an evaluation run reads it instead of recomputing it for every model |
| it scores. Only SSIM and LPIPS against a prediction genuinely need both images. |
| `fill` is the score of the ground truth against an all-black and an all-white |
| image, used when a prediction is missing. |
|
|
| Values are full-precision floats: `float(repr(x)) == x`, so the text form |
| round-trips exactly. `null` means never labelled, not "known to be absent". |
|
|
| ## Changes from the previous layout |
|
|
| `train_cls/` and `test_cls/` are gone. They held byte-identical copies of |
| `train/` and `test/` — 613 MB — to express a 16-way label that is now the |
| `category` field. `charts/` is gone for the same reason: it was 30 test images |
| already present in `test/`, and `has_chart` now covers all 1,000. |
|
|
| Files are raw and per sample; training code assembles records after download. |
|
|