File size: 9,533 Bytes
3565ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4297f7a
9934851
 
4297f7a
9934851
4297f7a
 
88952db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0fa4cef
88952db
 
0fa4cef
88952db
0fa4cef
 
3565ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44b4e27
 
0c1b924
44b4e27
 
 
 
3565ba9
 
 
 
 
9934851
 
88952db
 
 
 
 
 
3565ba9
 
 
 
0c1b924
 
3565ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a8e9679
b816773
3565ba9
 
 
 
 
 
a8e9679
58161bd
b816773
58161bd
 
3565ba9
 
58161bd
 
 
 
 
a8e9679
b816773
58161bd
 
 
3565ba9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a8e9679
3565ba9
 
 
 
 
 
 
 
 
 
b816773
 
0ebba0b
b816773
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3565ba9
 
 
 
 
b816773
3565ba9
 
 
 
 
 
 
 
 
 
 
 
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
---
dataset_info:
- config_name: photos
  features:
  - name: id
    dtype: string
  - name: provider
    dtype: string
  - name: source_id
    dtype: string
  - name: query
    dtype: string
  - name: title
    dtype: string
  - name: author
    dtype: string
  - name: license
    dtype: string
  - name: license_url
    dtype: string
  - name: source_page
    dtype: string
  - name: original_url
    dtype: string
  - name: input_path
    dtype: string
  - name: target_path
    dtype: string
  - name: sha256
    dtype: string
  - name: input
    dtype: image
  - name: target
    dtype: image
  splits:
  - name: train
    num_bytes: 2235579871
    num_examples: 82651
  - name: test
    num_bytes: 42450997
    num_examples: 1639
  download_size: 2123870018
  dataset_size: 2278030868
- config_name: scenes
  features:
  - name: id
    dtype: string
  - name: split
    dtype: string
  - name: kind
    dtype: string
  - name: caption
    dtype: string
  - name: style
    dtype: string
  - name: background
    dtype: string
  - name: objects
    dtype: string
  - name: slots
    dtype: string
  - name: sprites
    dtype: string
  - name: background_path
    dtype: string
  - name: path
    dtype: string
  - name: image
    dtype: image
  splits:
  - name: train
    num_bytes: 40658211
    num_examples: 50000
  - name: test
    num_bytes: 1752518
    num_examples: 2000
  download_size: 33784209
  dataset_size: 42410729
- config_name: sprites
  features:
  - name: path
    dtype: string
  - name: pack
    dtype: string
  - name: creator
    dtype: string
  - name: license
    dtype: string
  - name: source_url
    dtype: string
  - name: width
    dtype: string
  - name: height
    dtype: string
  - name: label
    dtype: string
  - name: label_source
    dtype: string
  - name: image
    dtype: image
  splits:
  - name: train
    num_bytes: 3596212
    num_examples: 8806
  - name: test
    num_bytes: 751382
    num_examples: 1001
  download_size: 4979713
  dataset_size: 4347594
configs:
- config_name: photos
  data_files:
  - split: train
    path: photos/train-*
  - split: test
    path: photos/test-*
- config_name: scenes
  data_files:
  - split: train
    path: scenes/train-*
  - split: test
    path: scenes/test-*
- config_name: sprites
  data_files:
  - split: train
    path: sprites/train-*
  - split: test
    path: sprites/test-*
license:
- cc0-1.0
- cc-by-2.0
- cc-by-2.5
- cc-by-3.0
- cc-by-4.0
size_categories:
- 100K<n<1M
task_categories:
- text-to-image
pretty_name: pixl-data
tags:
- pixel-art
- sprites
---

# pixl-data

Training data for **pixl**, a small text-to-pixel-art model trained from scratch.

| Config | Rows | What it holds |
|---|---|---|
| `photos` | ~84k | Photo pairs: a 256×256 photo (`input`), a 32×32, 24-colour version of it (`target`), and a caption (`query`) |
| `sprites` | ~9.8k | CC0 game sprites (`image`) with a short label (`label`) |
| `scenes` | 52k | 32×32 scenes built from the sprites (`image`), with a caption written from the placement (`caption`) |

## Load

```python
from datasets import load_dataset

photos = load_dataset("ocdbytes/pixl-data", "photos")  # {"train": ..., "test": ...}
sprites = load_dataset("ocdbytes/pixl-data", "sprites")
scenes = load_dataset("ocdbytes/pixl-data", "scenes")

train = load_dataset("ocdbytes/pixl-data", "photos", split="train")  # one split only
```

## Splits

| Config | train | test | Kept together in one split |
|---|---|---|---|
| `photos` | ~82.7k | ~1.6k (2% of source photos) | All crops of one source photo (same `sha256`) |
| `sprites` | ~8.8k | ~1k (10% of groups) | The colour variants of one tile, the frames of one animation, and the numbered and old/new versions of one Dungeon Crawl sprite |
| `scenes` | 50,000 | 2,000 | Set by the generator: test scenes use test sprites, or object pairs never seen in train scenes |

Near-copies never appear in both splits, so test scores are not inflated by images the model has already seen. A group is in `test` when the first 8 hex digits of the SHA-256 of its key, as a fraction of 16⁸, are below 0.02 (photos) or 0.1 (sprites). The split is fixed: new data never moves existing rows.

## photos

| Source | Caption |
|---|---|
| [Open Images V7](https://storage.googleapis.com/openimages/web/index.html) | A box label or a relationship between two boxes drawn by people, e.g. "dog", "man riding horse", "wooden table". The photo is cropped around the box. |
| [Wikimedia Commons](https://commons.wikimedia.org/), [Openverse](https://openverse.org/) | The search query that found the photo, e.g. "arcade cabinet". |

Photos were filtered before upload. A photo was removed when:

- [CLIP](https://huggingface.co/openai/clip-vit-base-patch32) matched it more closely to prompts for nudity or graphic content (gore, dead bodies, injuries) than to neutral prompts;
- it came from a web search and CLIP found it does not show its query;
- it is CC BY but has no author to credit, or its author field is an email address.

Every photo was changed:

1. Cropped to a square.
2. Resized to 256×256: `input`.
3. Resized to 32×32 and reduced to 24 colours: `target`.

| Column | Meaning |
|---|---|
| `id` | Pair id |
| `provider` | `openimages`, `wikimedia` or `openverse:<provider>` |
| `source_id` | Id of the photo at its source |
| `query` | Caption |
| `title`, `author` | From the photo's source page |
| `license`, `license_url` | Licence of the original photo |
| `source_page`, `original_url` | Where the original photo is |
| `input_path`, `target_path` | File paths in the original folder layout |
| `sha256` | SHA-256 of the downloaded original |
| `input`, `target` | The two images |

## sprites

Sprites from CC0 packs by [Kenney](https://kenney.nl/assets) (1-Bit Pack, Cursor Pixel Pack, Monochrome Pirates, Pico-8 City, Pixel Shmup, Pixel Vehicle Pack, Tiny Battle, Tiny Dungeon, Tiny Farm, Tiny Town), [ansimuz](https://ansimuz.itch.io/sunny-land-pixel-game-art) (Sunny Land), [GrafxKid](https://grafxkid.itch.io/mini-pixel-pack-3) (Mini Pixel Pack 3), [Buch](https://opengameart.org/content/a-platformer-in-the-forest) (A Platformer in the Forest), the Dungeon Crawl Stone Soup artists ([Dungeon Crawl 32x32 tiles](https://opengameart.org/content/dungeon-crawl-32x32-tiles-supplemental)), [Idylwild](https://opengameart.org/content/idylwilds-inventory) (Idylwild's Inventory), [Scrittl](https://opengameart.org/content/spaceship-set-32x32px) (Spaceship set 32x32px), [Jull](https://opengameart.org/node/50777) (Animated spaceships) and [wender](https://opengameart.org/node/176168) (Sports cars pixelart sprites). `label_source` says where each label comes from: checked by eye (`claude-visual`), a file name (`filename`) or a sprite-sheet atlas (`atlas`).

| Column | Meaning |
|---|---|
| `path` | File path in the original pack layout |
| `pack`, `creator`, `source_url` | Which pack the sprite comes from |
| `license` | CC0 1.0 |
| `width`, `height` | Size in pixels |
| `label`, `label_source` | Label and where it comes from |
| `image` | The sprite (PNG, with transparency) |

## scenes

Synthetic 32×32 scenes, each made from one sprite style: a background tile repeated in every 16 px slot (8 px for Pico-8 City) and one or two objects, each centred in its own slot. Sprites are not scaled, except the 32×32 Dungeon Crawl tiles, which are halved to 16×16 by keeping every other pixel; halved objects that fall apart into pieces are left out. The caption is written from the placement, so it is always right: "a green pine tree left of a wooden barrel on grass", "a yellow bus at the top right on pavement".

| Kind (`kind`) | Split | Scenes | Objects from |
|---|---|---|---|
| `train` | train | 50,000 | Train-split sprites |
| `new sprites` | test | 1,000 | Test-split sprites only |
| `new pair` | test | 1,000 | Train-split sprites in label pairs that never appear together in train scenes |

| Column | Meaning |
|---|---|
| `caption` | The scene's caption |
| `kind` | See above |
| `style` | Sprite pack (or 1-Bit Pack colour family) the scene is made from |
| `background`, `background_path` | Background tile label and path in the `sprites` config; empty for a transparent scene |
| `objects`, `sprites`, `slots` | Each object's label, path and `row,column` slot, `\|`-separated |
| `image` | The scene (PNG, transparent where there is no background) |

## Licences

Every row has its own licence in `license` (and `license_url` for photos):

- **Sprites:** CC0 1.0.
- **Scenes:** CC0 1.0, as they are made only from the sprites.
- **Photos:** CC0, public domain, or CC BY 1.0–4.0. All Open Images photos are listed as CC BY 2.0.
- **Open Images annotations** (the boxes and labels behind the crops and captions): CC BY 4.0, by Google.

To reuse a CC BY photo, credit it with the row's `author`, `title`, `source_page` and `license`, and say that it was changed (cropped, resized, colours reduced).

Google lists Open Images photos as CC BY 2.0 but [does not guarantee](https://storage.googleapis.com/openimages/web/factsfigures_v7.html) each licence. Wikimedia and Openverse licences come from their providers' metadata. Check a row's source page before relying on its licence.

## Known issues

- Web captions are still somewhat noisy: in a sample of 30 web photos that passed the CLIP check, 4 did not show their query.
- The nudity and graphic-content filter is automatic and can miss photos. Please report any you find.
- Many photos show real people. Some show brand logos or photographers' watermarks.