Image-to-Text
Transformers
Safetensors
English
qwen2_5_vl
image-text-to-text
svg
hivg
vector-graphics
text-to-svg
image-to-svg
hierarchical-tokenization
autoregressive-generation
code-generation
text-generation-inference
Instructions to use xingxm/HiVG-3B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xingxm/HiVG-3B-Base with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="xingxm/HiVG-3B-Base")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("xingxm/HiVG-3B-Base") model = AutoModelForImageTextToText.from_pretrained("xingxm/HiVG-3B-Base") - Notebooks
- Google Colab
- Kaggle
Add model card and metadata
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,3 +1,61 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: image-text-to-text
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# HiVG: Hierarchical SVG Tokenization
|
| 8 |
+
|
| 9 |
+
[**Project Page**](https://hy-hivg.github.io/) | [**Paper**](https://huggingface.co/papers/2604.05072) | [**GitHub**](https://github.com/ximinng/HiVG)
|
| 10 |
+
|
| 11 |
+
HiVG is a hierarchical SVG tokenization framework tailored for autoregressive vector graphics generation. It decomposes raw SVG strings into structured *atomic tokens* and further compresses executable command–parameter groups into geometry-constrained *segment tokens*, substantially improving sequence efficiency while preserving syntactic validity.
|
| 12 |
+
|
| 13 |
+
## Installation
|
| 14 |
+
|
| 15 |
+
To use this model, install the official implementation from the GitHub repository:
|
| 16 |
+
|
| 17 |
+
```bash
|
| 18 |
+
git clone https://github.com/ximinng/HiVG.git
|
| 19 |
+
cd HiVG
|
| 20 |
+
pip install -e .
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
## Quick Start
|
| 24 |
+
|
| 25 |
+
You can use the provided inference pipeline for both image-to-SVG and text-to-SVG tasks.
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
from hivg_infer import HiSVGInferencePipeline
|
| 29 |
+
|
| 30 |
+
pipeline = HiSVGInferencePipeline(
|
| 31 |
+
model_path="xingxm/HiVG-3B-Base",
|
| 32 |
+
coord_range=234,
|
| 33 |
+
temperature=0.7,
|
| 34 |
+
top_p=0.9,
|
| 35 |
+
max_new_tokens=4096,
|
| 36 |
+
)
|
| 37 |
+
|
| 38 |
+
# Image-to-SVG
|
| 39 |
+
result = pipeline.img2svg("path/to/your_image.png")
|
| 40 |
+
if result["success"]:
|
| 41 |
+
print(result["svg"])
|
| 42 |
+
|
| 43 |
+
# Text-to-SVG
|
| 44 |
+
result = pipeline.text2svg("A minimalist black phone icon with an outline style")
|
| 45 |
+
if result["success"]:
|
| 46 |
+
with open("output.svg", "w") as f:
|
| 47 |
+
f.write(result["svg"])
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Citation
|
| 51 |
+
|
| 52 |
+
If you find HiVG useful in your research, please consider citing:
|
| 53 |
+
|
| 54 |
+
```bibtex
|
| 55 |
+
@article{xing2026hivg,
|
| 56 |
+
title={Hierarchical SVG Tokenization: Learning Compact Visual Programs for Scalable Vector Graphics Modeling},
|
| 57 |
+
author={Xing, Ximing and Xue, Ziteng and Li, Zhenxi and Liang, Weicong evangelist, Wang, Linqing and Yang, Zhantao and Hang, Tiankai and Yin, Zijin and Lu, Qinglin and Wang, Chunyu and Yu, Qian},
|
| 58 |
+
journal={arXiv preprint arXiv:2604.05072},
|
| 59 |
+
year={2026}
|
| 60 |
+
}
|
| 61 |
+
```
|