A machine learning solution for the Kaggle "Text-to-SVG Generation" competition that converts text descriptions into high-quality SVG images.
Text-to-SVG Genie is an AI system that generates Scalable Vector Graphics (SVG) code from text descriptions. Given a text prompt describing an image, the model generates SVG code that renders the described scene as accurately as possible.
This project was developed for the Kaggle competition aimed at building specialized solutions that outperform general-purpose LLMs in generating image-rendering code, providing greater transparency in the process.
Clone the repository and install the required dependencies:
git clone https://github.com/Harsh-BH/text-to-svg-genie.git
cd text-to-svg-genie
pip install -r requirements.txt
The project relies on the following key libraries:
Our model adheres to the following competition requirements:
The model is optimized for the SVG Image Fidelity Score, which combines:
# Import the model
from text_to_svg_genie.model import Model
# Initialize the model
model = Model()
# Generate SVG from a text description
text_prompt = "A red apple sitting on a wooden table"
svg_code = model.predict(text_prompt)
# Save the SVG to a file
with open("apple.svg", "w") as f:
f.write(svg_code)
Run the demo script to test the model with sample prompts:
python demo.py
Our approach combines:
text-to-svg-genie/
βββ README.md # Project documentation
βββ requirements.txt # Dependencies
βββ .gitignore # Git ignore file
βββ text_to_svg_genie/ # Main package directory
β βββ __init__.py # Package initialization
β βββ model.py # Model implementation
β βββ svg_generator.py # SVG generation utilities
β βββ utils.py # Helper functions
βββ examples/ # Example SVGs and outputs
βββ demo.py # Demonstration script
βββ tests/ # Test suite
Our model aims to:
8 commits
Python
82.9%
Jupyter Notebook
16.3%
A machine learning solution for the Kaggle "Text-to-SVG Generation" competition that converts text descriptions into high-quality SVG images.
Text-to-SVG Genie is an AI system that generates Scalable Vector Graphics (SVG) code from text descriptions. Given a text prompt describing an image, the model generates SVG code that renders the described scene as accurately as possible.
This project was developed for the Kaggle competition aimed at building specialized solutions that outperform general-purpose LLMs in generating image-rendering code, providing greater transparency in the process.
Clone the repository and install the required dependencies:
git clone https://github.com/Harsh-BH/text-to-svg-genie.git
cd text-to-svg-genie
pip install -r requirements.txt
The project relies on the following key libraries:
Our model adheres to the following competition requirements:
The model is optimized for the SVG Image Fidelity Score, which combines:
# Import the model
from text_to_svg_genie.model import Model
# Initialize the model
model = Model()
# Generate SVG from a text description
text_prompt = "A red apple sitting on a wooden table"
svg_code = model.predict(text_prompt)
# Save the SVG to a file
with open("apple.svg", "w") as f:
f.write(svg_code)
Run the demo script to test the model with sample prompts:
python demo.py
Our approach combines:
text-to-svg-genie/
βββ README.md # Project documentation
βββ requirements.txt # Dependencies
βββ .gitignore # Git ignore file
βββ text_to_svg_genie/ # Main package directory
β βββ __init__.py # Package initialization
β βββ model.py # Model implementation
β βββ svg_generator.py # SVG generation utilities
β βββ utils.py # Helper functions
βββ examples/ # Example SVGs and outputs
βββ demo.py # Demonstration script
βββ tests/ # Test suite
Our model aims to:
8 commits
Python
82.9%
Jupyter Notebook
16.3%