Image-Text-to-Text
Transformers
Safetensors
English
qwen2_5_vl
svg
xml
image-to-svg
structured-images
diagrams
vector-graphics
qwen2.5-vl
grpo
reinforcement-learning
multimodal
conversational
text-generation-inference
Instructions to use Pengyu965/Back2Struct-Image2SVG-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Pengyu965/Back2Struct-Image2SVG-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Pengyu965/Back2Struct-Image2SVG-7B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Pengyu965/Back2Struct-Image2SVG-7B") model = AutoModelForMultimodalLM.from_pretrained("Pengyu965/Back2Struct-Image2SVG-7B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Pengyu965/Back2Struct-Image2SVG-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Pengyu965/Back2Struct-Image2SVG-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pengyu965/Back2Struct-Image2SVG-7B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Pengyu965/Back2Struct-Image2SVG-7B
- SGLang
How to use Pengyu965/Back2Struct-Image2SVG-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Pengyu965/Back2Struct-Image2SVG-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pengyu965/Back2Struct-Image2SVG-7B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Pengyu965/Back2Struct-Image2SVG-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Pengyu965/Back2Struct-Image2SVG-7B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Pengyu965/Back2Struct-Image2SVG-7B with Docker Model Runner:
docker model run hf.co/Pengyu965/Back2Struct-Image2SVG-7B
Expand Table 2 to all difficulty tiers
Browse files
README.md
CHANGED
|
@@ -70,11 +70,30 @@ Fields: `id` (string), `source` (string), `token_count` (int32), `image` (embedd
|
|
| 70 |
|
| 71 |
| Model | SR ↑ | DINO ↑ | LPIPS ↓ | SSIM ↑ | GPT ↑ |
|
| 72 |
|-------|-----:|-------:|--------:|-------:|------:|
|
|
|
|
| 73 |
| Qwen3-VL-30B-A3B | 18.8 | 0.1566 | 0.9067 | 0.1201 | 13.29 |
|
| 74 |
| StarVector-8B | 31.4 | 0.2694 | 0.7936 | 0.2170 | 21.05 |
|
| 75 |
| Qwen2.5-VL-7B (base) | 52.3 | 0.3527 | 0.7834 | 0.3276 | 27.56 |
|
| 76 |
| Qwen2.5-VL-7B (SFT) | 42.8 | 0.3715 | 0.7403 | 0.2891 | 33.49 |
|
| 77 |
| **Back2Struct (RL)** | **71.5** | **0.5622** | **0.6473** | **0.4966** | **51.85** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
**On successfully compiled outputs**, the 7B model matches or beats frontier closed models:
|
| 80 |
|
|
|
|
| 70 |
|
| 71 |
| Model | SR ↑ | DINO ↑ | LPIPS ↓ | SSIM ↑ | GPT ↑ |
|
| 72 |
|-------|-----:|-------:|--------:|-------:|------:|
|
| 73 |
+
| ***Overall*** | | | | | |
|
| 74 |
| Qwen3-VL-30B-A3B | 18.8 | 0.1566 | 0.9067 | 0.1201 | 13.29 |
|
| 75 |
| StarVector-8B | 31.4 | 0.2694 | 0.7936 | 0.2170 | 21.05 |
|
| 76 |
| Qwen2.5-VL-7B (base) | 52.3 | 0.3527 | 0.7834 | 0.3276 | 27.56 |
|
| 77 |
| Qwen2.5-VL-7B (SFT) | 42.8 | 0.3715 | 0.7403 | 0.2891 | 33.49 |
|
| 78 |
| **Back2Struct (RL)** | **71.5** | **0.5622** | **0.6473** | **0.4966** | **51.85** |
|
| 79 |
+
| ***Easy*** | | | | | |
|
| 80 |
+
| Qwen3-VL-30B-A3B | 26.5 | 0.2231 | 0.8659 | 0.1702 | 19.51 |
|
| 81 |
+
| StarVector-8B | 46.1 | 0.3923 | 0.7023 | 0.3123 | 31.90 |
|
| 82 |
+
| Qwen2.5-VL-7B (base) | 69.3 | 0.4776 | 0.7123 | 0.4196 | 39.66 |
|
| 83 |
+
| Qwen2.5-VL-7B (SFT) | 56.0 | 0.4866 | 0.6630 | 0.3789 | 44.58 |
|
| 84 |
+
| **Back2Struct (RL)** | **84.0** | **0.6384** | **0.5956** | **0.5796** | **62.63** |
|
| 85 |
+
| ***Medium*** | | | | | |
|
| 86 |
+
| Qwen3-VL-30B-A3B | 19.6 | 0.1631 | 0.9004 | 0.1288 | 13.38 |
|
| 87 |
+
| StarVector-8B | 37.0 | 0.3232 | 0.7533 | 0.2583 | 25.27 |
|
| 88 |
+
| Qwen2.5-VL-7B (base) | 51.8 | 0.3546 | 0.7816 | 0.3306 | 26.88 |
|
| 89 |
+
| Qwen2.5-VL-7B (SFT) | 45.5 | 0.3985 | 0.7161 | 0.3091 | 36.50 |
|
| 90 |
+
| **Back2Struct (RL)** | **75.6** | **0.6088** | **0.6182** | **0.5275** | **55.14** |
|
| 91 |
+
| ***Hard*** | | | | | |
|
| 92 |
+
| Qwen3-VL-30B-A3B | 10.2 | 0.0836 | 0.9536 | 0.0614 | 7.01 |
|
| 93 |
+
| StarVector-8B | 11.1 | 0.0932 | 0.9249 | 0.0808 | 6.02 |
|
| 94 |
+
| Qwen2.5-VL-7B (base) | 35.7 | 0.2263 | 0.8561 | 0.2331 | 16.17 |
|
| 95 |
+
| Qwen2.5-VL-7B (SFT) | 27.0 | 0.2297 | 0.8413 | 0.1795 | 19.43 |
|
| 96 |
+
| **Back2Struct (RL)** | **55.0** | **0.4399** | **0.7278** | **0.3830** | **37.83** |
|
| 97 |
|
| 98 |
**On successfully compiled outputs**, the 7B model matches or beats frontier closed models:
|
| 99 |
|