File size: 2,279 Bytes
cf835ce
 
ac40830
 
 
cf835ce
ac40830
cf835ce
 
ac40830
 
cf835ce
 
b848414
 
 
 
ac40830
 
 
 
 
 
b848414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ac40830
b848414
 
 
 
 
ac40830
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
title: Decomate
emoji: πŸ“‰
colorFrom: gray
colorTo: purple
sdk: gradio
sdk_version: 5.44.1
app_file: app.py
pinned: false
license: cc-by-nc-4.0
short_description: SVG decomposition and animation generation
---

## Overview

Decomate is a Gradio-based application designed for intelligent SVG decomposition and animation generation. It leverages advanced machine learning models to analyze SVG files, group elements semantically, and create animations based on user descriptions.

## Example Animation Result

| <img src="assets/animation-bunny.gif" width="200"/> | <img src="assets/duck.gif" width="200"/> |
| :-------------------------------------------------: | :--------------------------------------: |
|                        Bunny                        |                   Duck                   |

## Features

- **SVG Decomposition**: Automatically parse and decompose SVG files into semantic groups such as characters, objects, and backgrounds.
- **Animation Suggestions**: Generate animation ideas tailored to the SVG structure.
- **Interactive UI**: User-friendly interface for uploading SVGs, analyzing them, and previewing animations.
- **Custom Animation**: Create animations using AI-driven suggestions and user inputs.

## Installation

1. Clone the repository:

   ```bash
   git clone https://github.com/your-repo/decomate.git
   cd decomate
   ```

2. Install dependencies:

   ```bash
   pip install -r requirements.txt
   ```

3. Set up environment variables:
   - Create a `.env` file in the root directory.
   - Add your `ANTHROPIC_API_KEY`:
     ```
     ANTHROPIC_API_KEY=your_api_key_here
     ```

## Usage

1. Launch the application:

   ```bash
   python app.py
   ```

2. Open the Gradio interface in your browser.

3. Upload an SVG file or paste SVG markup to start analyzing and animating.

## File Structure

- **`app.py`**: Main application file.
- **`utils.py`**: Utility functions for SVG processing.
- **`requirements.txt`**: List of dependencies.
- **`prompts/`**: Prompt Templates.
- **`dataset/`**: Sample SVG files for testing.
- **`.env`**: Environment variables (not included in the repository).

## License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).