DerHansVader's picture
Document Pointerbench inference protocol
34bf819 verified
|
Raw
History Blame Contribute Delete
7.88 kB
# Pointerbench-Text
**A 500-example GUI grounding benchmark for text.** Given a screenshot of a
text-rich interface and a short instruction (e.g. *"Click the word 'invoice'"*,
*"Place the cursor between the 'r' and 'e' in 'erfolgreich'"*, *"Return the
bounding box of this paragraph"*), a model must output either a pixel coordinate
or a bounding box. Point answers are correct if they land inside the target box.
Bbox answers are correct if they reach the configured IoU threshold.
![teaser](assets/teaser.png)
## Why text?
General GUI-grounding suites (ScreenSpot, ScreenSpot-v2, ScreenSpot-Pro) target
icons, buttons, and widgets, but they barely test **pointing inside running
text**: a specific word among hundreds of near-identical ones, a single
character, a punctuation mark, or a caret position between two letters.
That precision is exactly what cursor-based editing, proofreading, and
text-selection agents need. Pointerbench-Text isolates it across many real text
surfaces and five languages.
## What's inside
- **500** examples, one instruction per image.
- **1024x768** PNG screenshots, fully synthetic (no scraping, no PII).
- **Many text surfaces**: articles, books, email inbox and threads, chat,
Slack, code editors, terminals, markdown notes, docs sites, forums, social
feeds, search results, data tables, log viewers, and dozens more.
- **6 data types** (interaction granularity):
| data_type | example instruction |
| ------------- | ---------------------------------------------------- |
| `word` | *Click the word "invoice".* |
| `char` | *Click the second "e" in "settlement".* |
| `punctuation` | *Click the period after "done".* |
| `caret` | *Place the cursor between the "r" and "e" in "core".* |
| `chrome` | *Click "Settings" in the toolbar.* |
| `bbox` | *Return the bbox of the paragraph beginning with "In".* |
- **17 fine-grained categories** under those types (word center, char center,
punctuation, caret before/after/between, between words, line start/end,
sentence boundary, paragraph start/end, blank line, chrome label, word bbox,
char bbox, line bbox, paragraph bbox).
- **5 languages, Latin alphabet only**: 50% English; the other 50% split evenly
across German, French, Spanish, Italian, Dutch.
- **Difficulty** tag (`easy` / `medium` / `hard`) from font size, target kind,
and theme contrast.
- Randomized realism: 20 font families, mixed sizes, per-span color / bold /
italic / underline / highlight / link / code / strike / faded styling, light
and dark themes, plus film grain, JPEG artifacts, and fake caret / cursor
distractors.
## Schema
Each line of `data/test/metadata.jsonl` (HuggingFace `imagefolder` layout):
```json
{
"file_name": "0000.png",
"id": "pbt_0000",
"instruction": "Click the word \"invoice\".",
"bbox": [596, 376, 681, 395],
"point": [638, 385],
"answer_type": "point",
"eval": {"type": "point_in_bbox", "bbox": [596, 376, 681, 395]},
"data_type": "word",
"category": "word_center",
"surface": "email_thread",
"language": "en",
"difficulty": "medium",
"image_size": [1024, 768]
}
```
- **`bbox`**: ground-truth target, **`[x1, y1, x2, y2]` in absolute pixels**
(top-left, bottom-right) on the 1024x768 image. For point rows, a prediction
is correct iff it lands inside this box. For bbox rows, the prediction is
scored against this box with IoU.
- **`point`**: a reference click point inside the box.
- **`answer_type`**: `point` or `bbox`.
- **`eval`**: binary evaluation rule for this row.
- **`data_type`**: coarse interaction granularity (see table above).
- **`category`**: the fine-grained target kind.
- **`surface`**: the rendered surface (app/document skin).
- **`language`**: instruction language (`en`, `de`, `fr`, `es`, `it`, `nl`).
- **`difficulty`**: `easy` / `medium` / `hard`.
## Quickstart
### Load the data
Via HuggingFace `datasets` (after the set is pushed to the Hub):
```python
from datasets import load_dataset
ds = load_dataset("YOUR_ORG/pointerbench-text", split="test")
ex = ds[0]
ex["image"] # PIL.Image, 1024x768
ex["instruction"] # "Click the word \"invoice\"."
ex["bbox"] # [x1, y1, x2, y2]
```
Or locally with the imagefolder loader:
```python
from datasets import load_dataset
ds = load_dataset("imagefolder", data_dir="data", split="test")
```
Or with no dependencies at all, read `data/test/metadata.jsonl` and open the
sibling PNGs yourself.
### Evaluate
1. Print the recommended system prompt with `python eval.py --show-system-prompt`,
or edit it for your inference stack while keeping the 1024x768 coordinate
frame fixed.
2. Run your model on every example's `instruction` + image and collect a
predicted click point or bbox (absolute pixels on the 1024x768 image).
3. Write predictions as JSONL, one object per example:
```json
{"id": "pbt_0000", "point": [612, 388]}
{"id": "pbt_0001", "bbox": [193, 643, 807, 688]}
```
4. Score (pure standard library, no dependencies):
```bash
python eval.py --predictions preds.jsonl
```
```
Pointerbench-Text: 500 examples
============================================
Accuracy: 64.20% (321/500)
By data type:
caret 48.81% (n=168)
char 55.56% (n=18)
...
```
The scorer reports overall accuracy plus per-data-type, per-category,
per-surface, per-language, and per-difficulty breakdowns. `--json report.json`
writes the full report.
### Turning model output into a point
Models emit clicks in many shapes; map them to `[x, y]` pixels before scoring.
For example, a `<click>x,y</click>` tag or a normalized `0-1` / `0-999` point:
```python
import re
def to_point(text, w=1024, h=768):
m = re.search(r"(-?\d+(?:\.\d+)?)\s*[,\s]\s*(-?\d+(?:\.\d+)?)", text)
x, y = float(m.group(1)), float(m.group(2))
if max(x, y) <= 1.0: x, y = x * w, y * h # normalized 0-1
elif max(x, y) <= 999: x, y = x / 999 * w, y / 999 * h # 0-999 grid
return [round(x), round(y)]
```
## Baselines
| Model | Accuracy | Notes |
| ----------------------------- | -------- | ------------------------- |
| Center-click (512, 384) | low | sanity floor |
| _your model here_ | n/a | open a PR |
## Construction and reproducibility
Examples are rendered programmatically (pure PIL, no browser, no real files), so
every ground-truth box is pixel-exact: the layout engine records per-glyph
geometry and an independent verifier confirms each instruction resolves to
exactly one target before the example is kept. The set is **held out**: it is
built with a generation seed disjoint from any training data, so no benchmark
page is reused for training. The generator and the exact build command live in
the [source repo](https://github.com/YOUR_ORG/YOUR_GENERATOR_REPO); see
[`REPRODUCE.md`](REPRODUCE.md).
## Limitations
- Fully synthetic: realistic but not screenshots of real applications.
- Fixed 1024x768 resolution; Latin-script languages only.
- Non-English instructions reference targets by quoted word or chrome label;
the fine-grained caret/char/punctuation categories are English and German.
- Targets are words, characters, punctuation, caret positions, and chrome
labels, and text bboxes, not icons, images, or widgets.
## Citation
```bibtex
@misc{pointerbench_text_2026,
title = {Pointerbench-Text: A GUI Grounding Benchmark for Text},
author = {Pointerbench-Text contributors},
year = {2026},
url = {https://github.com/YOUR_ORG/pointerbench-text}
}
```
## License
- **Data** (images + annotations): [CC BY 4.0](LICENSE).
- **Code** (`eval.py`): MIT.