ahazimeh commited on
Commit
2cc16eb
·
verified ·
1 Parent(s): 3bdb1f6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +162 -3
README.md CHANGED
@@ -1,7 +1,166 @@
1
  ---
 
2
  license: cc-by-4.0
3
  task_categories:
4
- - image-text-to-text
 
 
 
 
 
 
5
  language:
6
- - en
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ pretty_name: Slide2SVG
3
  license: cc-by-4.0
4
  task_categories:
5
+ - document-understanding
6
+ tags:
7
+ - raster-to-vector
8
+ - svg
9
+ - slides
10
+ - document-layout
11
+ - derendering
12
  language:
13
+ - en
14
+ size_categories:
15
+ - 10K<n<100K
16
+ ---
17
+
18
+ # Slide2SVG
19
+
20
+ Slide2SVG was released as part of the paper “Semantic Document Derendering: SVG Reconstruction via Vision-Language Modeling” (AAAI 2026).
21
+
22
+ 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.
23
+
24
+ Each sample includes:
25
+ - the raster slide in PNG format
26
+ - an SVG representation that preserves editability (composed of only image and text SVG elements)
27
+ - individual PNG image assets referenced by the SVG
28
+
29
+ The dataset is split into roughly **38,000 training** samples and **225 test** samples.
30
+
31
+ ---
32
+
33
+ ## Dataset format
34
+
35
+ This dataset is formatted with Parquet shards. Each example contains:
36
+
37
+ - `id` (string): unique sample id
38
+ - `image` (Image): raster slide (PNG)
39
+ - `svg` (string): SVG markup as text
40
+ - `assets_zip` (binary): a ZIP archive containing the PNG image assets referenced by the SVG
41
+ - `assets` (list[string]): filenames contained in `assets_zip`
42
+ - `num_assets` (int): number of assets in the ZIP
43
+
44
+
45
+ ---
46
+
47
+ ## Quickstart
48
+
49
+ ### Install
50
+
51
+ pip install datasets pillow
52
+
53
+ ### Load the dataset
54
+
55
+ from datasets import load_dataset
56
+
57
+ ds = load_dataset("ahazimeh/slide2svg")
58
+ print(ds)
59
+ # DatasetDict({
60
+ # train: Dataset(...),
61
+ # test: Dataset(...)
62
+ # })
63
+
64
+ ### Inspect an example
65
+
66
+ ex = ds["train"][0]
67
+ print(ex["id"])
68
+ print(type(ex["image"]))
69
+ print(ex["svg"][:200])
70
+ print(ex["num_assets"])
71
+ print(ex["assets"][:10])
72
+
73
+ ### Extract asset PNGs from `assets_zip`
74
+
75
+ import io
76
+ import zipfile
77
+
78
+ ex = ds["train"][0]
79
+
80
+ zf = zipfile.ZipFile(io.BytesIO(ex["assets_zip"]))
81
+ names = zf.namelist()
82
+ print("assets:", names)
83
+
84
+ # Read one asset as bytes
85
+ asset0_bytes = zf.read(names[0])
86
+
87
+ # Convert bytes to a PIL image (optional)
88
+ from PIL import Image
89
+ asset0 = Image.open(io.BytesIO(asset0_bytes)).convert("RGBA")
90
+ asset0.size
91
+
92
+ ### Save one complete example to disk (PNG + SVG + assets)
93
+
94
+ import os
95
+ import io
96
+ import zipfile
97
+
98
+ out_dir = "sample_export"
99
+ os.makedirs(out_dir, exist_ok=True)
100
+
101
+ ex = ds["train"][0]
102
+
103
+ # Save raster slide
104
+ ex["image"].save(os.path.join(out_dir, f"{ex['id']}.png"))
105
+
106
+ # Save SVG
107
+ with open(os.path.join(out_dir, f"{ex['id']}.svg"), "w", encoding="utf-8") as f:
108
+ f.write(ex["svg"])
109
+
110
+ # Save assets
111
+ zf = zipfile.ZipFile(io.BytesIO(ex["assets_zip"]))
112
+ assets_dir = os.path.join(out_dir, f"{ex['id']}_assets")
113
+ os.makedirs(assets_dir, exist_ok=True)
114
+ zf.extractall(assets_dir)
115
+
116
+ ---
117
+
118
+ ## Data collection and processing
119
+
120
+ Slide2SVG was assembled using the following pipeline:
121
+
122
+ 1. **PDF Collection**
123
+ Presentation slides in PDF format were collected from archives of several major machine learning conferences.
124
+
125
+ 2. **SVG Conversion**
126
+ 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.
127
+
128
+ 3. **Asset Grouping**
129
+ 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.
130
+
131
+ 4. **Outlier Filtering**
132
+ Slides with more than **8 image assets** or **31 text assets** (95th percentile thresholds) are filtered out as unusually complex.
133
+
134
+ 5. **Rasterization**
135
+ The final SVGs are rendered into PNG format to obtain paired raster slides.
136
+
137
+ ---
138
+
139
+ ## Intended use
140
+
141
+ This dataset supports research and development in:
142
+ - raster-to-SVG conversion / derendering
143
+ - slide/document understanding
144
+ - layout analysis and generation
145
+ - editability-preserving reconstruction
146
+
147
+ ---
148
+
149
+ ## Citation
150
+
151
+ If you use Slide2SVG, please cite:
152
+
153
+ @misc{hazimeh2025slider,
154
+ title={Semantic Document Derendering: SVG Reconstruction via Vision-Language Modeling},
155
+ author={Adam Hazimeh and Ke Wang and Mark Collier and Gilles Baechler and Efi Kokiopoulou and Pascal Frossard},
156
+ year={2025},
157
+ eprint={2511.13478},
158
+ url={https://arxiv.org/abs/2511.13478},
159
+ }
160
+
161
+ ---
162
+
163
+ ## Maintainer
164
+
165
+ - Dataset: `ahazimeh/slide2svg`
166
+ - Contact: adam(dot)hazimeh(at)epfl(dot)ch