File size: 4,652 Bytes
45d60ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
pretty_name: Slide2SVG
license: cc-by-4.0
tags:
- raster-to-vector
- svg
- slides
- document-layout
- derendering
language:
- en
size_categories:
- 10K<n<100K
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: test
    path: data/test-*
dataset_info:
  features:
  - name: id
    dtype: string
  - name: image
    dtype: image
  - name: svg
    dtype: string
  - name: assets_zip
    dtype: binary
  - name: assets
    dtype: string
  - name: num_assets
    dtype: int32
  splits:
  - name: train
    num_bytes: 8298450173.191999
    num_examples: 39472
  - name: test
    num_bytes: 54768897
    num_examples: 225
  download_size: 9049767829
  dataset_size: 8353219070.191999
task_categories:
- image-to-text
---

# Slide2SVG

Slide2SVG was released as part of the paper “Semantic Document Derendering: SVG Reconstruction via Vision-Language Modeling” (AAAI 2026).

Slide2SVG is a real-world dataset for **semantic document derendering**: transforming a rasterized presentation slide into a structured, editable SVG representation. Curated from publicly available academic conference presentations, it captures diverse design styles, font choices, image placements, and layout configurations found in real slides.

Each sample includes:
- the raster slide in PNG format
- an SVG representation that preserves editability (composed of only image and text SVG elements)
- individual PNG image assets referenced by the SVG

The dataset is split into roughly **40,000 training** samples and **225 test** samples.

---

## Dataset format

This dataset is formatted with Parquet shards. Each example contains:

- `id` (string): unique sample id
- `image` (Image): raster slide (PNG)
- `svg` (string): SVG markup as text
- `assets_zip` (binary): a ZIP archive containing the PNG image assets referenced by the SVG
- `assets` (list[string]): filenames contained in `assets_zip`
- `num_assets` (int): number of assets in the ZIP


---

## Quickstart

### Install

    pip install datasets pillow

### Load the dataset

    from datasets import load_dataset

    ds = load_dataset("ahazimeh/slide2svg")
    print(ds)

### Inspect an example

    ex = ds["train"][0]
    print(ex["id"])
    print(type(ex["image"]))
    print(ex["num_assets"])
    print(ex["assets"])
    print(ex["svg"])

### Extract asset PNGs from `assets_zip`

    import io
    import zipfile

    ex = ds["train"][0]

    zf = zipfile.ZipFile(io.BytesIO(ex["assets_zip"]))
    names = zf.namelist()
    print("assets:", names)

    # Read one asset as bytes
    asset0_bytes = zf.read(names[0])

    # Convert bytes to a PIL image
    from PIL import Image
    asset0 = Image.open(io.BytesIO(asset0_bytes)).convert("RGBA")

### Save one complete example to disk (PNG + SVG + assets)

    import os
    import io
    import zipfile
    
    out_dir = "sample_export"
    os.makedirs(out_dir, exist_ok=True)
    
    ex = ds["train"][0]
    
    # Save raster slide
    ex["image"].save(os.path.join(out_dir, f"{ex['id']}.png"))
    
    # Save SVG
    with open(os.path.join(out_dir, f"{ex['id']}.svg"), "w", encoding="utf-8") as f:
        f.write(ex["svg"])
    
    # Save assets
    zf = zipfile.ZipFile(io.BytesIO(ex["assets_zip"]))
    os.makedirs(out_dir, exist_ok=True)
    zf.extractall(out_dir)

---

## Data collection and processing

Slide2SVG was assembled using the following pipeline:

1. **PDF Collection**  
   Presentation slides in PDF format were collected from archives of several major machine learning conferences.

2. **SVG Conversion**  
   PDFs were converted to Figma designs and exported as raw SVG files. This conversion is used only for dataset creation. At inference time, we assume the slide is available only as a raster image.

3. **Asset Grouping**  
   Figma-exported SVGs often group text elements using non-semantic heuristics. To improve structure, text elements are reorganized using a zero-shot DocLayout-YOLO-based procedure so that text assets belonging to one entity are merged into a unified text object with updated spatial attributes.

4. **Outlier Filtering**  
   Slides with more than 8 image assets or 31 text assets (95th percentile thresholds) are filtered out as unusually complex.

5. **Rasterization**  
   The final SVGs are rendered into PNG format to obtain paired raster slides.

---

## Intended use

This dataset supports research and development in:
- raster-to-SVG conversion / derendering
- slide/document understanding
- layout analysis and generation
- editability-preserving reconstruction

---

## Maintainer

- Adam Hazimeh
- Contact: adam(dot)hazimeh(at)epfl(dot)ch