/ Модель

Характеристики

Контекст
8 192 токена
Параметры
1,7 млрд
Размер весов
5,1 ГБ
Лицензия
Apache 2.0
Архитектура
starvector · dense
Библиотека
transformers
Опубликована
11 янв 2025

starvector-1b-im2svg

Генерация текстаТекст → текст3 профессии

StarVector-1B-im2svg создаёт код SVG по изображению или текстовому описанию, особенно для иконок, логотипов и технических диаграмм.

3 743скачиваний за 30 дней200лайковвеса обновлены19 мар 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

StarVector-1B-im2svg — мультимодальная модель семейства StarVector, разработанная ServiceNow Research совместно с Mila — Quebec AI Institute и ÉTS Montréal. Она генерирует код SVG по изображению или текстовому запросу, используя визуальный энкодер на основе Vision Transformer, адаптер LLM и языковую модель. Вариант содержит 1,7 млрд параметров, работает через Transformers, принимает изображения и текст и выдаёт текстовый код SVG; длина контекста — 8192 токена. В карточке указан английский язык для текстовых запросов, обучение на наборе SVG-Stack с более чем 2 млн примеров и оценка на SVG-Bench.

Модель предназначена для векторизации и создания иконок, логотипов, схем, графиков и диаграмм. Она не рассчитана на фотографии, реалистичные изображения, иллюстрации и сложную 3D-графику; качество векторизации может зависеть от типа входа и точности текстовой инструкции. Лицензия — Apache 2.0.

Сценарии применения

  • Векторизация растровых иконок в SVG
  • Создание SVG-логотипа по текстовому описанию
  • Преобразование технической схемы в SVG
  • Создание SVG-графика или диаграммы по текстовому запросу

Ограничения

Модель не предназначена для фотографий, реалистичных изображений, иллюстраций и сложной 3D-графики; качество векторизации и следование текстовым инструкциям могут быть ограничены. Возможны смещения, связанные с составом обучающих данных.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Model Card for StarVector

image/png

StarVector is a foundation model for generating Scalable Vector Graphics (SVG) code from images and text. It utilizes a Vision-Language Modeling architecture to understand both visual and textual inputs, enabling high-quality vectorization and text-guided SVG creation.

Model Details

Model Description

This is the model card for the StarVector model, a 🤗 transformers model. StarVector is a foundation model for generating Scalable Vector Graphics (SVG) code from images and text. It utilizes a Vision-Language Modeling architecture to understand both visual and textual inputs, enabling high-quality vectorization and text-guided SVG creation.

  • Developed by: ServiceNow Research, Mila - Quebec AI Institute, ETS, Montreal.
  • Shared by : Juan A Rodriguez, Abhay Puri, Shubham Agarwal, Issam H. Laradji, Sai Rajeswar, Pau Rodriguez, David Vazquez, Christopher Pal, Marco Pedersoli.
  • Model type: Vision-Language Model for SVG Generation.
  • Language(s) (NLP): English.
  • License: Apache 2.0

Model Architecture

The StarVector architecture integrates an image encoder and a Large Language Model (LLM) Adapter to generate SVG code from both image and text inputs. Images are first converted into embeddings using a Vision Transformer (ViT), after which the LLM Adapter maps these embeddings into the LLM's embedding space to create visual tokens. Text prompts are handled through the LLM’s tokenizer and embedder. This unified multimodal approach ensures precise and contextually rich SVG output.

Model Sources

Uses

Direct Use

Image-to-SVG generation, Text-to-SVG generation.

Downstream Use

Creation of icons, logotypes, technical diagrams, and other vector graphics.

Out-of-Scope Use

Generating realistic photographic images or complex 3D graphics.

Bias, Risks, and Limitations

Potential biases may exist in the model due to the composition of the training data (SVG-Stack). The model's ability to perfectly vectorize all types of images and interpret all textual instructions may have limitations. Users should be aware of these potential issues, especially in critical applications.

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. Further investigation into the model's behavior across different types of inputs is recommended.

How to Get Started with the Model

Use the code below to get started with the model.

from PIL import Image
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
from starvector.data.util import process_and_rasterize_svg
import torch
 
model_name = "starvector/starvector-1b-im2svg"
 
starvector = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, trust_remote_code=True)
processor = starvector.model.processor
tokenizer = starvector.model.svg_transformer.tokenizer
 
starvector.cuda()
starvector.eval()
 
image_pil = Image.open('assets/examples/sample-18.png')
 
image = processor(image_pil, return_tensors="pt")['pixel_values'].cuda()
if not image.shape[0] == 1:
    image = image.squeeze(0)
batch = {"image": image}
 
raw_svg = starvector.generate_im2svg(batch, max_length=4000)[0]
svg, raster_image = process_and_rasterize_svg(raw_svg)

Training Details

Training Data

SVG-Stack: A dataset of over 2 million SVG samples.

Training Procedure

The model utilizes a Vision-Language Modeling architecture. Images are projected into embeddings via an image encoder, then mapped to the LLM hidden space using an LLM Adapter, generating Visual Tokens. Text conditioning is achieved with the LLM's tokenizer and embedder. The model learns to map token sequences (visual or textual) to SVG code.

Evaluation

Testing Data & Factors

Testing Data

SVG-Bench

Factors

SVG-Stack, SVG-Fonts, SVG-Icons, SVG-Emoji, SVG-Diagrams.

Models

StarVector models achieve state-of-the-art performance on SVG generation tasks

We provide Hugging Face 🤗 model checkpoints for image2SVG vectorization, for 💫 StarVector-8B and 💫 StarVector-1B. These are the results on SVG-Bench, using the DinoScore metric.

MethodSVG-StackSVG-FontsSVG-IconsSVG-EmojiSVG-Diagrams
AutoTrace0.9420.9540.9460.9750.874
Potrace0.8980.9670.9720.8820.875
VTracer0.9540.9640.9400.9810.882
Im2Vec0.6920.7330.7540.732-
LIVE0.9340.9560.9590.9690.870
DiffVG0.8100.8210.9520.8140.822
GPT-4-V0.8520.8420.8480.850-
💫 StarVector-1B0.9260.9780.9750.9290.943
💫 StarVector-8B0.9660.9820.9840.9810.959

Note: StarVector models will not work for natural images or illustrations, as they have not been trained on those images. They excel in vectorizing icons, logotypes, technical diagrams, graphs, and charts.

As shown in the table above, StarVector-8B achieves the highest performance across all benchmark datasets, demonstrating its effectiveness in generating high-quality SVG code from images. The model's ability to understand and reproduce complex vector graphics makes it particularly valuable for applications requiring precise vectorization of icons, logos, and technical diagrams.

Summary

StarVector represents a significant advancement in the field of vector graphics generation. By combining the power of vision-language models with a comprehensive training dataset, we've created a system that can accurately translate images into high-quality SVG code. The model's performance on SVG-Bench demonstrates its effectiveness across a wide range of vector graphics tasks.

We believe that StarVector will enable new applications in design, illustration, and technical documentation, making vector graphics more accessible and easier to create. We invite the research community to build upon our work and explore new directions in this exciting field.

For more details, please refer to our paper and explore our code repository.

BibTeX entry and citation info

@misc{rodriguez2024starvector,
      title={StarVector: Generating Scalable Vector Graphics Code from Images and Text},
      author={Juan A. Rodriguez and Abhay Puri and Shubham Agarwal and Issam H. Laradji and Pau Rodriguez and Sai Rajeswar and David Vazquez and Christopher Pal and Marco Pedersoli},
      year={2024},
      eprint={2312.11556},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2312.11556},
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
StarVectorForCausalLM
Ревизия весов
380ab95

0 моделей