--- license: apache-2.0 language: - en - zh task_categories: - image-classification - image-feature-extraction tags: - font-recognition - visual-font-recognition - VFR - open-set - vision-language - multimodal - typography pretty_name: DesignVFR --- # DesignVFR > **Towards Universal Open-Set Visual Font Recognition via Augmented Synthetic Similarity**  Β·  CVPR 2026 Findings **DesignVFR** is the first large-scale dataset for **universal open-set Visual Font Recognition (VFR)**. While prior VFR work is limited to closed-set classification on isolated character-level grayscale images, DesignVFR covers font recognition in real-world *universal* scenarios β€” sentences, complex backgrounds, and artistic effects across **posters, films, slides and vlogs** β€” and explicitly evaluates the **open-set** regime where unseen fonts keep being added. - πŸ“° **Paper**: *Towards Universal Open-Set Visual Font Recognition via Augmented Synthetic Similarity* (CVPR 2026 Findings) - 🧩 **Path scheme**: every metadata file uses the `${DATASET_ROOT}` placeholder β€” set it once, and the dataset is portable across machines. ## πŸ“° News - **[2026.06.17]** πŸŽ‰ DesignVFR is now open-sourced on [Hugging Face](https://huggingface.co/datasets/Tunanzzz/DesignVFR)! - **[2026.06.17]** πŸš€ Code release: training, deployment and evaluation pipelines for [FontVLM](https://github.com/Tunanzzz/FontVLM) are now public. ## ✨ Highlights | | | |---|---| | **Total fonts** | **1,245** multilingual fonts (Chinese + Latin + multi-script) | | **Synthetic images** | **800,477** rendered images (664k train Β· 136k eval) | | **Real-world images** | **42,794** sentence-level crops (20,380 posters Β· 22,414 video frames) | | **Open-set protocol** | **1,068** in-domain (ID) fonts seen during training Β· **177** out-of-domain (OOD) fonts unseen at training | | **Augmentation pipeline** | Sentence-level rendering with font-faithful augmentations (color, blur, perspective, background, …) | ## πŸ“¦ Subsets DesignVFR is organised into three complementary subsets: | Subset | Source | Highlights | |---|---|---| | **`synthetic/`** | Augmented synthetic pipeline | 1,087-font training set Β· ID gallery (1,068 fonts) Β· OOD gallery (196 fonts) Β· ID/OOD query splits | | **`posterreal/`** | Real-world graphic-design posters | 20,380 sentence-level crops over 91 ID + 82 OOD fonts, with rich layout / color metadata | | **`videoreal/`** | Real-world video frames | 22,414 sentence-level frames over 130 ID + 146 OOD fonts (films / vlogs) | ## πŸ—‚οΈ Layout (after `python unpack.py`) ``` DesignVFR/ β”œβ”€β”€ synthetic/ β”‚ β”œβ”€β”€ train/ 1,087 font dirs Β· 664,375 images β”‚ β”œβ”€β”€ id_infer/ 1,068 font dirs Β· 55,351 images (synthetic ID gallery) β”‚ β”œβ”€β”€ id_need_infer/ 1,068 font dirs Β· 55,351 images (synthetic ID query) β”‚ β”œβ”€β”€ ood_infer/ 196 font dirs Β· 12,700 images (synthetic OOD reference imgs) β”‚ β”œβ”€β”€ ood_need_infer/ 196 font dirs Β· 12,700 images (synthetic OOD query) β”‚ └── metadata/ β”‚ β”œβ”€β”€ train.jsonl # 664,200 lines Β· ms-swift conversation format (special <|font|> token) β”‚ β”œβ”€β”€ train_sft.jsonl # 664,200 lines Β· plain SFT variant (font name as response) β”‚ β”œβ”€β”€ id_infer.json # 55,350 records (ID gallery, 1,068 fonts) β”‚ β”œβ”€β”€ id_need_infer.json # 55,350 records (ID query) β”‚ β”œβ”€β”€ ood_infer.json # 68,050 records β€” combined ID+OOD gallery used β”‚ β”‚ at OOD evaluation time (1,264 unique fonts) β”‚ β”œβ”€β”€ ood_need_infer.json # 12,700 records (OOD query, 196 fonts) β”‚ └── font_family_to_index.json # 1,068-class label map (synthetic training labels) β”œβ”€β”€ posterreal/ β”‚ β”œβ”€β”€ images/ 221 font dirs (real poster crops) β”‚ └── metadata/ β”‚ β”œβ”€β”€ id.json # 9,875 records over 91 fonts (overlap with synthetic train) β”‚ └── ood.json # 10,505 records over 82 fonts (unseen during training) └── videoreal/ β”œβ”€β”€ id/ 148 font dirs Β· 10,045 frames β”œβ”€β”€ ood/ 170 font dirs Β· 12,369 frames └── metadata/ β”œβ”€β”€ id.json # 10,045 records over 130 fonts └── ood.json # 12,369 records over 146 fonts ``` > **All paths inside the metadata files use the `${DATASET_ROOT}` placeholder**, e.g. > `"${DATASET_ROOT}/synthetic/train/TsangerYuMo/TsangerYuMo_normal_100_450.png"`. > Set `DATASET_ROOT` once and every jsonl/json works no matter where you put the dataset on disk. ## πŸš€ Quick Start ### 1. Download ```bash # requires huggingface_hub>=0.34 hf download Tunanzzz/DesignVFR --repo-type dataset \ --local-dir ./DesignVFR ``` ### 2. Unpack the tar shards The dataset is shipped as ~1 GB tar shards (`synthetic/train.part-001.tar`, …) to stay friendly to git-LFS. Extract them in place with the bundled unpacker: ```bash cd DesignVFR python unpack.py ``` After this step the on-disk layout matches the diagram above. The original `.tar` shards can be safely deleted. ### 3. Point your training code at it ```bash export DATASET_ROOT=/abs/path/to/DesignVFR ``` ### 4. Use it #### a. As a `datasets.Dataset` (raw metadata) Each metadata JSON is a list of records, each containing the image URL plus a font label: ```python import json, os from datasets import Dataset records = json.load(open('DesignVFR/posterreal/metadata/id.json')) # Expand ${DATASET_ROOT} for r in records: r['text_img_url'] = os.path.expandvars(r['text_img_url']) ds = Dataset.from_list(records) print(ds[0]) # {'font_family': 'Source Han Sans SC', # 'font-style': 'normal', 'font-weight': '400', 'font-size': '50.6px', # 'color': '#ffffffFF', 'text': 'ζ¬’θΏŽε’¨θ―’', # 'text_img_url': '/abs/.../posterreal/images/Source Han Sans SC Regular/...png'} ``` #### b. With ms-swift (training out of the box) `synthetic/metadata/train.jsonl` follows ms-swift's *messages* format and uses a special `<|font|>` token as the assistant response: ```jsonl {"images": ["${DATASET_ROOT}/synthetic/train/TsangerYuMo/TsangerYuMo_normal_100_450.png"], "messages": [ {"role": "user", "content": " What is the font of the text in this image?"}, {"role": "assistant", "content": "<|font|>"} ], "label": 0} ``` ms-swift's preprocessor automatically expands `${DATASET_ROOT}` at load time (see `swift/llm/dataset/preprocessor/core.py::_cast_mm_data`), so launching training is just: ```bash export DATASET_ROOT=/abs/path/to/DesignVFR swift sft \ --model Qwen/Qwen2.5-VL-3B-Instruct \ --dataset $DATASET_ROOT/synthetic/metadata/train.jsonl \ ... ``` ## πŸ”’ Statistics at a glance | Split | # fonts | # records / images | Type | |---|---:|---:|---| | `synthetic/train` | 1,087 | 664,375 | Augmented synthetic, training (664,200 records in `train.jsonl`) | | `synthetic/id_infer` | 1,068 | 55,350 | Augmented synthetic, ID gallery | | `synthetic/id_need_infer` | 1,068 | 55,350 | Augmented synthetic, ID query | | `synthetic/ood_infer` | 196 | 12,700 | Augmented synthetic, OOD reference images | | `synthetic/ood_need_infer` | 196 | 12,700 | Augmented synthetic, OOD query | | `posterreal/id` | 91 | 9,875 | Real posters, ID protocol | | `posterreal/ood` | 82 | 10,505 | Real posters, OOD protocol | | `videoreal/id` | 130 | 10,045 | Real video frames, ID protocol | | `videoreal/ood` | 146 | 12,369 | Real video frames, OOD protocol | > **About `ood_infer.json`**: it has **68,050** records spanning **1,264** fonts, even though `synthetic/ood_infer/` on disk only contains the 196 OOD fonts. This is by design β€” at OOD-evaluation time the gallery must be a **superset of the training fonts** so that ID classes still serve as distractors. The json therefore concatenates `synthetic/id_infer/*` (1,068 ID fonts) and `synthetic/ood_infer/*` (196 OOD fonts) by reference. No data is duplicated on disk. ## πŸ“‘ Metadata schema ### `synthetic/metadata/{train, train_sft}.jsonl` | Field | Type | Notes | |---|---|---| | `images` | `list[str]` | One image URL with the `${DATASET_ROOT}` prefix. | | `messages` | `list[{role, content}]` | ms-swift conversation format. | | `label` | `int` | Index into `font_family_to_index.json`, `0 ≀ label < 1068`. | - **`train.jsonl`** β€” assistant response is the special `<|font|>` token (used together with a learnable classifier head, see FontVLM). - **`train_sft.jsonl`** β€” assistant response is the literal font family name (plain SFT). Useful as a baseline / for any model that does not add a special token. ### `synthetic/metadata/{id,ood}_{infer,need_infer}.json` | Field | Type | Notes | |---|---|---| | `text_img_url` | `str` | Rendered crop, anchored on `${DATASET_ROOT}`. | | `mask_img_url` | `str` | Binary mask of the text region. | | `font_family` | `str` | **Gold label** for VFR. | | `font_file` | `str` | Concrete font file (multiple files may share one family). | | `text` | `str` | Rendered text content. | ### `posterreal/metadata/{id,ood}.json` | Field | Type | Notes | |---|---|---| | `text_img_url` | `str` | Real poster crop, anchored on `${DATASET_ROOT}`. | | `font_family` | `str` | **Gold label**. | | `text` | `str` | Recognised text content. | | `color` | `str` | Hex RGBA, e.g. `#ffffffFF`. | | `font-size` | `str` | CSS-style px size, e.g. `50.6px`. | | `font-style` | `str` | `normal` / `italic`. | | `font-weight` | `str` | CSS weight, e.g. `400`, `700`. | ### `videoreal/metadata/{id,ood}.json` | Field | Type | Notes | |---|---|---| | `text_img_url` | `str` | Real video-frame crop, anchored on `${DATASET_ROOT}`. | | `font_family` | `str` | **Gold label**. | ### `synthetic/metadata/font_family_to_index.json` `{"": }` β€” the canonical 1,068-class label map used during synthetic training. ## πŸ§ͺ Open-set protocol We split fonts into two disjoint pools: - **In-Distribution (ID)** β€” the 1,068 fonts seen during synthetic training. `*_id` query splits are evaluated by top-k accuracy against an ID gallery of size 1,068. - **Out-of-Distribution (OOD)** β€” fonts **never** seen during training (177 unique families across all OOD splits). `*_ood` query splits target the open-set capability of the recogniser; their gallery is the combined ID+OOD reference (`synthetic/metadata/ood_infer.json`, 1,264 fonts). The accompanying paper recommends two evaluation modes: 1. **Classification mode** β€” direct softmax over the 1,068 ID classes. Applicable only on ID splits. 2. **Similarity mode** β€” extract a query feature, then match it via cosine similarity against the *synthetic reference gallery*. This naturally extends to OOD fonts at inference time, **without any retraining**. Reference implementations of both modes will be released alongside the FontVLM codebase (*coming soon*). ## βš–οΈ License & responsible use - The dataset is released under the **Apache 2.0** license, **for research purposes only**. - The **font files themselves are not redistributed** β€” only rendered images are. Some fonts shipped in DesignVFR carry restrictive commercial licenses (e.g. fonts whose names contain *"Non-Commercial Use"*); please consult the original font foundries before any commercial application. - Real-world poster / video frames were collected from public sources for academic study only. If you are a copyright holder and would like a sample removed, please open a thread in the **Community** tab of this dataset and we will take it down. ## πŸ“š Citation ```bibtex @InProceedings{Zhou_2026_CVPR, author = {Zhou, Peicheng and Fang, Shancheng and Jin, Chenhui and Pu, Bowei and Xie, Hongtao}, title = {Towards Universal Open-Set Visual Font Recognition Via Augmented Synthetic Similarity}, booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings}, month = {June}, year = {2026}, pages = {6799-6808} } ``` ## πŸ™ Acknowledgement We thank the open-source projects [ms-swift](https://github.com/modelscope/ms-swift), [Qwen2.5-VL](https://github.com/QwenLM/Qwen2.5-VL), [LLaVA-OneVision](https://github.com/LLaVA-VL/LLaVA-NeXT), and [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), on top of which DesignVFR was built.