Add model card for GlyphPrinter
Browse filesHi! I'm Niels from the Hugging Face community science team. I noticed this repository was missing a model card, so I've opened this PR to add one. This model card includes metadata to improve discoverability, links to the paper and project pages, and sample usage instructions based on the official repository. Feel free to merge this if it looks good!
README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: text-to-image
|
| 3 |
+
library_name: diffusers
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
# GlyphPrinter: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering
|
| 7 |
+
|
| 8 |
+
[Paper](https://huggingface.co/papers/2603.15616) | [Project Page](https://henghuiding.com/GlyphPrinter/) | [GitHub](https://github.com/FudanCVL/GlyphPrinter)
|
| 9 |
+
|
| 10 |
+
**GlyphPrinter** is a preference-based text rendering framework designed to eliminate the reliance on explicit reward models for visual text generation. It addresses common failure cases in existing text-to-image models, such as stroke distortions and incorrect glyphs, especially when rendering complex Chinese characters, multilingual text, or out-of-domain symbols.
|
| 11 |
+
|
| 12 |
+
## Key Features
|
| 13 |
+
|
| 14 |
+
- **R-GDPO (Region-Grouped Direct Preference Optimization):** A region-based objective that optimizes inter- and intra-sample preferences over annotated regions, substantially enhancing glyph accuracy.
|
| 15 |
+
- **GlyphCorrector Dataset:** A specialized dataset with region-level glyph preference annotations.
|
| 16 |
+
- **Regional Reward Guidance (RRG):** An inference strategy that samples from an optimal distribution with controllable glyph accuracy.
|
| 17 |
+
|
| 18 |
+
## Usage
|
| 19 |
+
|
| 20 |
+
To use this model, please follow the installation instructions in the [official GitHub repository](https://github.com/FudanCVL/GlyphPrinter).
|
| 21 |
+
|
| 22 |
+
### CLI Inference
|
| 23 |
+
|
| 24 |
+
You can run inference using the provided `inference.py` script:
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
# list available saved conditions
|
| 28 |
+
python3 inference.py --list-conditions
|
| 29 |
+
|
| 30 |
+
# run inference using a prompt
|
| 31 |
+
python3 inference.py \
|
| 32 |
+
--prompt "The colorful graffiti font <sks1> printed on the street wall" \
|
| 33 |
+
--save-mask
|
| 34 |
+
|
| 35 |
+
# run inference using a specific condition file
|
| 36 |
+
python3 inference.py \
|
| 37 |
+
--condition condition_1.npz \
|
| 38 |
+
--output-dir outputs_inference
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### Gradio Demo
|
| 42 |
+
|
| 43 |
+
Alternatively, you can run the interactive Gradio app:
|
| 44 |
+
```bash
|
| 45 |
+
python app.py
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## Citation
|
| 49 |
+
```bibtex
|
| 50 |
+
@inproceedings{GlyphPrinter,
|
| 51 |
+
title={{GlyphPrinter}: Region-Grouped Direct Preference Optimization for Glyph-Accurate Visual Text Rendering},
|
| 52 |
+
author={Shuai, Xincheng and Li, Ziye and Ding, Henghui and Tao, Dacheng},
|
| 53 |
+
booktitle={CVPR},
|
| 54 |
+
year={2026}
|
| 55 |
+
}
|
| 56 |
+
```
|