--- license: apache-2.0 pretty_name: RIROCommon task_categories: - image-to-image tags: - arxiv:2610.27592 - textriro - scene-text-editing - scene-text-recognition - benchmark - image-editing - lmdb --- # RIROCommon **A scene text editing benchmark with equal-length and variable-length targets.** Benchmark accompanying **[Real In, Real Out: What If We Only Use Real Data for Scene Text Editing?](https://huggingface.co/papers/2610.27592)**, accepted at **NeurIPS 2026**. [HF Paper](https://huggingface.co/papers/2610.27592) · [arXiv](https://arxiv.org/abs/2610.27592) · [NeurIPS 2026](https://neurips.cc/virtual/2026/loc/sydney/poster/153296) · [Code](https://github.com/YesianRohn/TextRIRO) · [Model](https://huggingface.co/Yesianrohn/TextRIRO) · [Demo](https://huggingface.co/spaces/Yesianrohn/TextRIRO-Demo) · [TextRIRO-3M](https://huggingface.co/datasets/Yesianrohn/TextRIRO-3M) · [RIROCommon](https://huggingface.co/datasets/Yesianrohn/RIROCommon) ## Overview RIROCommon adapts six established scene text recognition benchmarks for scene text editing. Each source image is associated with an equal-length replacement and a variable-length target, enabling evaluation of content changes under both settings. It provides source crops, their original transcriptions, and target strings for editors to render. The paper evaluates generated text with SVTRv2 using normalized word accuracy: non-vocabulary characters and spaces are removed, and text is lowercased before scoring. See the paper for the complete evaluation protocol. ## Repository structure The repository contains **12 LMDB databases**: six source datasets in each editing setting. | Setting | Directory | Description | | --- | --- | --- | | Equal-length editing | `Equal/` | Replacement text matches the source text length | | Variable-length editing | `Variable/` | Replacement text is not constrained to match the source text length | Both directories contain these subsets: | Directory name | Benchmark name used in the paper | | --- | --- | | `IIIT5k` | IIIT | | `SVT` | SVT | | `IC13` | IC13 | | `IC15` | IC15 | | `SVTP` | SVTP | | `CUTE80` | CUTE | Each subset directory, such as `Equal/IC13/`, contains `data.mdb` and `lock.mdb`. ## Data format The [official benchmark reader](https://github.com/YesianRohn/TextRIRO/blob/main/inference_RIROCommon.py) uses the following LMDB keys. Sample indices start at 1 and use nine-digit zero padding. | Key | Value | | --- | --- | | `num-samples` | Number of samples in the database | | `image-000000001` | Source image bytes | | `label-000000001` | Original transcription, encoded as UTF-8 | | `editlabel-000000001` | Target text, encoded as UTF-8 | ## Download ```bash python -m pip install huggingface_hub ``` ```python from huggingface_hub import snapshot_download dataset_dir = snapshot_download( repo_id="Yesianrohn/RIROCommon", repo_type="dataset", local_dir="RIROCommon", ) ``` To download only one subset, add `allow_patterns=["Equal/IC13/*"]` to the call. ## Run TextRIRO on the benchmark First follow the [TextRIRO installation and checkpoint instructions](https://github.com/YesianRohn/TextRIRO). Place the downloaded `RIROCommon/` directory in the code repository root, or adjust `--input_lmdb` to its actual location. Run: ```bash python inference_RIROCommon.py \ --config configs/train.yaml \ --ckpt_path textriro.pth \ --input_lmdb RIROCommon/Equal/IC13 \ --output_lmdb RIROOut/Equal/IC13 \ --num_inference_steps 20 \ --guidance_scale 2.2 \ --batch_size 32 \ --seed 42 ``` Repeat for the desired subsets in `Equal/` and `Variable/`, using a separate output directory for each. This command generates edited-image LMDBs; metric computation follows the paper's evaluation protocol. For recognition training data generated with TextRIRO, see **[TextRIRO-3M](https://huggingface.co/datasets/Yesianrohn/TextRIRO-3M)**. ## Citation If you use RIROCommon in your research, please cite: ```bibtex @inproceedings{ye2026textriro, title = {Real In, Real Out: What If We Only Use Real Data for Scene Text Editing?}, author = {Ye, Xingsong and Du, Yongkun and Zhang, Jiaxin and Sun, Chong and Chen, Zhineng}, booktitle = {Advances in Neural Information Processing Systems}, year = {2026}, url = {https://neurips.cc/virtual/2026/loc/sydney/poster/153296} } ```