Nafnlaus/galdrastafir-fonts
收藏Hugging Face2026-04-16 更新2026-04-26 收录
下载链接:
https://hf-mirror.com/datasets/Nafnlaus/galdrastafir-fonts
下载链接
链接失效反馈官方服务:
资源简介:
---
license: cc-by-4.0
task_categories:
- object-detection
- image-classification
language:
- en
tags:
- fonts
- typography
- synthetic
- controlnet
- diffusion
- text-detection
size_categories:
- 1M<n<10M
dataset_info:
features:
- name: image_id
dtype: string
- name: json_id
dtype: string
- name: image_filename
dtype: string
- name: source_directory
dtype: string
- name: image
dtype: image
- name: image_format
dtype: string
- name: json_content
dtype: string
- name: num_layers
dtype: int32
splits:
- name: train
num_examples: 1523517
num_bytes: 115964076000
data_files:
- split: train
path: data-*.parquet
---
# Galdrastafir Font Recognition Dataset
Synthetic font-in-the-wild images generated with ControlNet + diffusion for training
font recognition models. Each image has per-layer metadata (most with bounding boxes)
for every font rendered into the scene. Fonts appear as signs, sculptures, paintings,
fashion, screens, graffiti, and more — rendered in 3D with diverse transformations.
## Columns
| column | type | description |
|---|---|---|
| `image_id` | str | unique image identifier (e.g. `003034722_00001`) |
| `json_id` | str | ID of the source JSON metadata file |
| `image_filename` | str | original filename (e.g. `003034722_00001.webp`) |
| `source_directory` | str | name of the source image batch (e.g. `font_images_out_4673`) |
| `image` | Image | the image (WebP format, usable directly as PIL) |
| `image_format` | str | actual image format sniffed from bytes (`webp` for 99.999%) |
| `json_content` | str | full JSON metadata string (see schema below) |
| `num_layers` | int | number of font layers in this image |
## Loading Images
The `image` column is stored as an embedded HuggingFace `Image` struct and loads
automatically as a PIL image:
```python
from datasets import load_dataset, Image as HFImage
ds = load_dataset("Nafnlaus/galdrastafir-fonts", split="train", streaming=True)
# Cast if needed for auto-PIL decoding
ds = ds.cast_column("image", HFImage())
for sample in ds:
img = sample["image"] # PIL.Image.Image (no io.BytesIO needed)
meta = json.loads(sample["json_content"])
for layer in meta.get("layers", []):
print(layer["font_name"], layer.get("coordinates"))
break
```
Or manually if you prefer:
```python
import io, json
from PIL import Image
from datasets import load_dataset
ds = load_dataset("Nafnlaus/galdrastafir-fonts", split="train", streaming=True)
for sample in ds:
img = Image.open(io.BytesIO(sample["image"]["bytes"]))
meta = json.loads(sample["json_content"])
break
```
## JSON Metadata Schema
Each image has 1–8 font layers. The `json_content` field is a JSON string:
```json
{
"id": 3034722,
"num_layers": 2,
"layers": [
{
"font_name": "Wet Paint",
"font_filename": "Wetpaitt.ttf",
"text": "\"Everyone!\"",
"font_size": 768,
"rotation": [-1.6, -3.62, -35.62],
"style": {
"weight": "regular",
"style": "italic",
"underline": true,
"strikeout": false,
"alignment": "right",
"char_spacing_px": 0.0,
"line_spacing_px": 0.0,
"weight_value": 80.0,
"slant_value": 0.0,
"is_variable": false,
"variation_index": 0
},
"coordinates": {"left": 4, "right": 307, "top": 597, "bottom": 699},
"center_point": [155, 648]
}
]
}
```
**Note**: `coordinates` and `center_point` are present in ~43% of images; the rest
have the text placed but without a recorded bounding box.
## Scale & Validation
- **1,523,517** images, **153 parquet shards** (~700 MB each)
- ~314,000 unique font names across the full dataset
- **All images are WebP** (9 rows, 0.0006%, have corrupt/missing bytes)
- **100% valid JSON** metadata
- Total uncompressed: ~108 GB
## Notes
- Some images are NSFW (the diffusion model was given creative freedom).
- Bounding-box data is absent in some images (older generation batches).
- Many fonts may have missing glyphs that render as blank/squares; filter by
metadata if this is a problem for your use case.
- Images were generated using FLUX.1 schnell as the diffusion backbone.
提供机构:
Nafnlaus



