Datasets:
Download README.md from ATH-MaaS/TextRefinementBench: direct link, hf CLI and curl.
- Browser
- Download file 3.51 kB
-
https://huggingface.co/datasets/ATH-MaaS/TextRefinementBench/resolve/main/README.md
- Command line
-
hf download hf://datasets/ATH-MaaS/TextRefinementBench/README.md
-
curl -L -o README.md https://huggingface.co/datasets/ATH-MaaS/TextRefinementBench/resolve/main/README.md
language:
- zh
license: apache-2.0
task_categories:
- image-to-image
pretty_name: TextRefinementBench
size_categories:
- 1K<n<10K
configs:
- config_name: images
data_files:
- split: test
path: data/images/test-*.parquet
- config_name: annotations
data_files:
- split: test
path: data/annotations/test-*.parquet
TextRefinementBench is a benchmark for glyph-conditioned local text refinement. Every item is a full-resolution image paired with the text regions that should be re-rendered: each target carries the intended text, the polygon of that region, and its axis-aligned box in original-image pixels. A model is given the image and the targets and has to regenerate those regions in place, so the benchmark measures both whether the intended text comes out correct and complete and whether everything outside the edited regions survives untouched.
The test split holds 960 images and 2,357 target regions.
Dataset configurations
images
The test split contains 960 rows:
image_id: image identifier, also the sample name used across the annotation rows.image: embedded RGB PNG image, byte-identical to the source file.image_path: canonical relative path,images/<image_id>.png.width,height: image dimensions.
annotations
The test split contains 2,357 rows, one per target region:
sample_id: unique target-level identifier,<image_id>-<item_index>.image_id: foreign key into theimagesconfiguration.image_path: canonical relative image path.item_index: index of the target within its image, in annotation order.text: the text that region should contain.box: four polygon corner points[x, y]in original-image pixels.rect: axis-aligned[x0, y0, x1, y1]crop rectangle in original-image pixels.annotation_status: how the targets of that image were produced, eitherexisting_human_annotation(167 images) orreviewed_miner_proposals(793 images).
Join the two configurations on image_id.
Loading
from datasets import load_dataset
images = load_dataset(
"parquet",
data_files={"test": "data/images/test-00000-of-00001.parquet"},
split="test",
)
annotations = load_dataset(
"parquet",
data_files={"test": "data/annotations/test-00000-of-00001.parquet"},
split="test",
)
Group the annotation rows by image_id to recover the ordered target list of each image.
Running a refinement model
Each annotation row is one edit request. With the PixText inference interface, the targets of a single image become a list of edits:
from pixtext import PixTextPipeline, TextEdit
pipeline = PixTextPipeline.from_pretrained("models/PixText-MeanFlow")
edits = [TextEdit(bbox=tuple(row["rect"]), text=row["text"]) for row in image_rows]
result = pipeline.edit("images/sample_000001.png", edits=edits, seed=42)
Boxes are half-open intervals in original-image pixel coordinates and targets are processed in annotation order. Pixels outside the edited footprints are expected to be preserved exactly, so preservation is part of the measurement.
License
The benchmark images and annotations are released under the Apache License 2.0. See LICENSE.