Datasets:
File size: 3,514 Bytes
2f604a8 | 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 | ---
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
---
<div align="center">
# TextRefinementBench
[](https://arxiv.org/abs/2610.18284)
[](LICENSE)
**English** | [简体中文](README.zh-CN.md)
</div>
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 the `images` configuration.
- `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, either `existing_human_annotation` (167 images) or `reviewed_miner_proposals` (793 images).
Join the two configurations on `image_id`.
## Loading
```python
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:
```python
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`.
|