File size: 2,509 Bytes
9b0fdaa
96bfbc7
 
 
 
 
 
 
 
 
 
 
 
 
9b0fdaa
96bfbc7
 
 
 
 
9b0fdaa
96bfbc7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
pretty_name: Pattern Over Pixels Screenshot-to-Code
license: other
task_categories:
  - image-to-text
  - text-generation
tags:
  - screenshot-to-code
  - multimodal
  - html
  - css
  - visual-grounding
size_categories:
  - n<1K
configs:
  - config_name: default
    default: true
    data_files:
      - split: train
        path: "data/train-*.parquet"
---

# Pattern Over Pixels Screenshot-to-Code

This dataset contains controlled counterfactual screenshot-to-code examples built
from 30 real-world webpages from Design2Code. Each example preserves a repeated
UI pattern while introducing a single localized deviation, allowing researchers
to test whether multimodal models follow the pixels or simply restore the
dominant template.

## Contents

- 720 perturbed HTML instances
- 360 structural-card examples
- 360 text-style examples
- 2 screenshot conditions per example:
  - `standard_image`
  - `noise_image`

## Layout

```text
hf_release/
  README.md
  .gitattributes
  data/
    examples.jsonl
  metadata/
    dataset_info.json
    validation_report.json
  html/
    cards/
    texts/
  images/
    cards/
      standard/
      noise/
    texts/
      standard/
      noise/
```

## Row Schema

Each line in `data/examples.jsonl` is one perturbed HTML instance with both
image conditions attached. Important fields include:

- `example_id`
- `source_id`
- `pattern_family`
- `pattern_name`
- `attribute_name`
- `position`
- `target_value`
- `bias_value`
- `html_path`
- `standard_image`
- `noise_image`
- `code_snippet_line`
- `code_snippet_context`

## Loading

Load the local release folder with:

```python
from datasets import load_dataset, Image

ds = load_dataset("json", data_files="data/examples.jsonl", split="train")
ds = ds.cast_column("standard_image", Image())
ds = ds.cast_column("noise_image", Image())
```

After pushing to the Hub with `scripts/push_hf_dataset.py`, load it with:

```python
from datasets import load_dataset

ds = load_dataset("AnonymousSubmissionASE/pixels_vs_code", split="train")
```

## Notes

- `standard_image` and `noise_image` are relative paths inside the dataset repo.
- The Hub push script materializes `html_content` and embeds image bytes into the
  Parquet shards so the hosted dataset is self-contained.
- This release is organized for public hosting and loading, not for regeneration.
- The underlying webpages originate from real-world websites. Check original
  website licenses and terms before downstream redistribution or commercial use.