anya-ji commited on
Commit
5907948
·
verified ·
1 Parent(s): ebec9e0

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +130 -0
README.md ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ pretty_name: Animation2Code
4
+ task_categories:
5
+ - video-text-to-text
6
+ language:
7
+ - en
8
+ tags:
9
+ - code
10
+ - html
11
+ - css
12
+ - javascript
13
+ - animation
14
+ - web
15
+ - codepen
16
+ - video-to-code
17
+ - benchmark
18
+ size_categories:
19
+ - 1K<n<10K
20
+ ---
21
+
22
+ # Animation2Code
23
+
24
+ **Animation2Code** is a benchmark for video-to-code generation of web animations. It contains 1,069 examples, each with a rendered web animation video and self-contained HTML/CSS/JavaScript that produced it.
25
+
26
+ - **Paper:** *Animation2Code: Evaluating Temporal Visual Reasoning in Video-to-Code Generation* (NeurIPS 2026)
27
+ - **Project page:** https://anya-ji.github.io/animation2code-website/
28
+ - **Mirror:** [Harvard Dataverse](https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/RUX7KA) (doi:10.7910/DVN/RUX7KA)
29
+
30
+ ## Dataset Structure
31
+
32
+ ```
33
+ data/
34
+ ├── train/ 769 examples
35
+ ├── val/ 86 examples
36
+ └── test/ 214 examples
37
+ └── codepen-<collection_id>-<pen_id>[-<k>]/
38
+ ├── animation.mp4
39
+ ├── full.html
40
+ └── metadata.json
41
+ ```
42
+
43
+ Each example directory contains exactly three files:
44
+
45
+ | File | Description |
46
+ |------|-------------|
47
+ | `animation.mp4` | The rendered reference video (the task input). H.264 (`yuv444p`), 1024×768, 30 fps, about 2–8 s. |
48
+ | `full.html` | A self-contained HTML document with inline `<style>` and `<script>` tags (the ground-truth target). |
49
+ | `metadata.json` | Provenance and dependency information (see below). |
50
+
51
+ ### Example IDs
52
+ `codepen-<collection_id>-<pen_id>` names the CodePen collection and pen the example came from. When a single pen contained several independent animations, it was split into sub-examples with a `-<k>` suffix (e.g. `codepen-DrPkOq-poyOMgr-1` … `-4`). All sub-examples of a pen are in the same split.
53
+
54
+ ### Metadata fields
55
+
56
+ In `metadata.json`:
57
+
58
+ | Field | Presence | Description |
59
+ |-------|----------|-------------|
60
+ | `title` | always | Pen title given by the original author. |
61
+ | `url` | always | Canonical CodePen URL, kept for attribution. |
62
+ | `external_resources` | 486 / 1,069 | `{"scripts": [...], "stylesheets": [...]}`: URLs of external libraries and stylesheets the pen loads. These are **not** inlined into `full.html` and must be loaded from the network when rendering. |
63
+ | `jquery_translated` | 41 / 1,069 | The jQuery URL that was removed when the pen's jQuery code was translated to vanilla JavaScript. |
64
+
65
+ Example:
66
+
67
+ ```json
68
+ {
69
+ "title": "Merry Christmas Tree!",
70
+ "url": "https://codepen.io/chrisgannon/pen/dypvKvR",
71
+ "external_resources": {
72
+ "scripts": [
73
+ "https://unpkg.co/gsap@3/dist/gsap.min.js",
74
+ "https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/MorphSVGPlugin3.min.js"
75
+ ]
76
+ }
77
+ }
78
+ ```
79
+
80
+ ## Usage
81
+
82
+ The data is stored as raw files (one directory per example), so download it with `huggingface_hub`:
83
+
84
+ ```python
85
+ import json
86
+ from pathlib import Path
87
+ from huggingface_hub import snapshot_download
88
+
89
+ root = Path(snapshot_download("anim2code/dataset", repo_type="dataset"))
90
+ # For a single split only: snapshot_download(..., allow_patterns="data/test/*")
91
+
92
+ for ex_dir in sorted((root / "data" / "test").iterdir()):
93
+ video_path = ex_dir / "animation.mp4"
94
+ html = (ex_dir / "full.html").read_text()
95
+ meta = json.loads((ex_dir / "metadata.json").read_text())
96
+ ```
97
+
98
+ Or with the CLI:
99
+
100
+ ```bash
101
+ hf download anim2code/dataset --repo-type dataset --local-dir anim2code_data
102
+ ```
103
+
104
+ ## Dataset Statistics
105
+
106
+ | Split | Examples |
107
+ |-------|----------|
108
+ | train | 769 |
109
+ | val | 86 |
110
+ | test | 214 |
111
+ | **total** | **1,069** |
112
+
113
+ **Durations:** 2–8 s (mean 5.1 ± 2.4 s). Looping animations are captured for at least one full cycle.
114
+
115
+ ## License
116
+
117
+ This dataset is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). The original code comes from public CodePen pens, which are MIT-licensed ([CodePen licensing](https://blog.codepen.io/documentation/licensing/)). Each example's `metadata.json` keeps the original pen URL so the original author can be credited.
118
+
119
+ ## Citation
120
+
121
+ ```bibtex
122
+ @article{ji2026animation2code,
123
+ title = {Animation2Code: Evaluating Temporal Visual Reasoning in Video-to-Code Generation},
124
+ author = {Ji, Anya and Mudunuri, Abhijith Varma and Chan, David M. and Suhr, Alane},
125
+ year = {2026},
126
+ eprint = {2606.28593},
127
+ archivePrefix = {arXiv},
128
+ url = {https://arxiv.org/abs/2606.28593},
129
+ }
130
+ ```