Datasets:

Modalities:
Image
Text
Formats:
parquet
Languages:
English
Size:
< 1K
ArXiv:
Libraries:
Datasets
pandas
License:
tomoyukun commited on
Commit
c9fb4e3
1 Parent(s): 56d5518

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +265 -40
README.md CHANGED
@@ -1,40 +1,265 @@
1
- ---
2
- license: cdla-permissive-2.0
3
- dataset_info:
4
- features:
5
- - name: id
6
- dtype: string
7
- - name: canvas_width
8
- dtype: int64
9
- - name: canvas_height
10
- dtype: int64
11
- - name: num_frames
12
- dtype: int64
13
- - name: num_sprites
14
- dtype: int64
15
- - name: matrix
16
- sequence:
17
- sequence:
18
- sequence: float32
19
- - name: opacity
20
- sequence:
21
- sequence: float32
22
- - name: texture
23
- sequence: image
24
- splits:
25
- - name: val
26
- num_bytes: 25434568.0
27
- num_examples: 186
28
- - name: test
29
- num_bytes: 13396478.0
30
- num_examples: 113
31
- download_size: 35687645
32
- dataset_size: 38831046.0
33
- configs:
34
- - config_name: default
35
- data_files:
36
- - split: val
37
- path: data/val-*
38
- - split: test
39
- path: data/test-*
40
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cdla-permissive-2.0
3
+ dataset_info:
4
+ features:
5
+ - name: id
6
+ dtype: string
7
+ - name: canvas_width
8
+ dtype: int64
9
+ - name: canvas_height
10
+ dtype: int64
11
+ - name: num_frames
12
+ dtype: int64
13
+ - name: num_sprites
14
+ dtype: int64
15
+ - name: matrix
16
+ sequence:
17
+ sequence:
18
+ sequence: float32
19
+ - name: opacity
20
+ sequence:
21
+ sequence: float32
22
+ - name: texture
23
+ sequence: image
24
+ splits:
25
+ - name: val
26
+ num_bytes: 25434568.0
27
+ num_examples: 186
28
+ - name: test
29
+ num_bytes: 13396478.0
30
+ num_examples: 113
31
+ download_size: 35687645
32
+ dataset_size: 38831046.0
33
+ configs:
34
+ - config_name: default
35
+ data_files:
36
+ - split: val
37
+ path: data/val-*
38
+ - split: test
39
+ path: data/test-*
40
+ ---
41
+
42
+
43
+ # Crello Animation
44
+
45
+ ## Table of Contents
46
+
47
+ - [Crello Animation](#crello-animation)
48
+ - [Table of Contents](#table-of-contents)
49
+ - [Dataset Description](#dataset-description)
50
+ - [Dataset Summary](#dataset-summary)
51
+ - [Usage](#usage)
52
+ - [Supported Tasks](#supported-tasks)
53
+ - [Dataset Structure](#dataset-structure)
54
+ - [Data Instances](#data-instances)
55
+ - [Data Splits](#data-splits)
56
+ - [Visualization](#visualization)
57
+ - [Dataset Creation](#dataset-creation)
58
+ - [Curation Rationale](#curation-rationale)
59
+ - [Source](#source)
60
+ - [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
61
+ - [Who are the source language producers?](#who-are-the-source-language-producers)
62
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
63
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
64
+ - [Social Impact of Dataset](#social-impact-of-dataset)
65
+ - [Discussion of Biases](#discussion-of-biases)
66
+ - [Other Known Limitations](#other-known-limitations)
67
+ - [Additional Information](#additional-information)
68
+ - [Dataset Curators](#dataset-curators)
69
+ - [Licensing Information](#licensing-information)
70
+ - [Citation Information](#citation-information)
71
+ - [Contributions](#contributions)
72
+
73
+ ## Dataset Description
74
+
75
+ - **Paper:** Fast Sprite Decomposition from Animated Graphics
76
+ - **Point of Contact:** [Tomoyuki Suzuki](https://github.com/tomoyukun)
77
+
78
+ ### Dataset Summary
79
+
80
+ The Crello Animation dataset is a collection of animated graphics. Animated graphics are videos composed of multiple sprites, with each sprite rendered by animating a texture. The textures are static images, and the animations involve time-varying affine warping and opacity. The original templates were collected from [create.vista.com](https://create.vista.com/) and converted to a low-resolution format suitable for machine learning analysis.
81
+
82
+ ### Usage
83
+
84
+ ```python
85
+ import datasets
86
+
87
+ dataset = datasets.load_dataset("cyberagent/crello-animation")
88
+ ```
89
+
90
+ ### Supported Tasks
91
+
92
+ Sprite decomposition task is studied in Suzuki et al., "Fast Sprite Decomposition from Animated Graphics" (to be published in ECCV 2024).
93
+
94
+ ## Dataset Structure
95
+
96
+ ### Data Instances
97
+
98
+ Each instance has the following attributes.
99
+
100
+ | Attribute | Type | Shape | Description |
101
+ | ------------- | ------- | ---------------------------- | -------------------------------------- |
102
+ | id | string | () | Template ID from crello.com |
103
+ | canvas_width | int64 | () | Canvas pixel width |
104
+ | canvas_height | int64 | () | Canvas pixel height |
105
+ | num_frames | int64 | () | The number of frames |
106
+ | num_sprites | int64 | () | The number of sprites |
107
+ | texture | image | (num_sprites) | List of textures (256x256 RGBA images) |
108
+ | matrix | float32 | (num_sprites, num_frames, 9) | List of time-varying warping matrices |
109
+ | opacity | float32 | (num_sprites, num_frames) | List of time-varying opacities |
110
+
111
+ NOTE:
112
+
113
+ - The `matrix` is normalized to a canonical space taking coordinates in the range
114
+ [-1, 1], assuming rendering with PyTorch functions (see [Visualization](#visualization) for details).
115
+ - Currently, the `num_frames` is fixed to 50, which corresponds to 5 seconds at 10 fps.
116
+ - The first sprite in each example is the static background, and its `matrix` and `opacity` are always the identity matrix and 1, respectively.
117
+
118
+ ### Data Splits
119
+
120
+ The Crello Animation dataset has val and test split.
121
+ Note that the dataset is primarily intended for evaluation purposes rather than training since it is not large.
122
+
123
+ | Split | Count |
124
+ | ----- | ----- |
125
+ | val | 154 |
126
+ | test | 145 |
127
+
128
+ ### Visualization
129
+
130
+ Each example can be rendered using PyTorch functions as follows.
131
+ We plan to add rendering example code using libraries other than PyTorch, such as [skip-python](https://kyamagu.github.io/skia-python/).
132
+
133
+ ```python
134
+ import datasets
135
+ import numpy as np
136
+ import torch
137
+ from einops import rearrange, repeat
138
+ from PIL import Image
139
+
140
+
141
+ def render_layers(
142
+ textures: torch.Tensor, matrices: torch.Tensor, opacities: torch.Tensor, canvas_height: int, canvas_width: int
143
+ ):
144
+ """Render multiple layers using PyTorch functions."""
145
+ tex_expand = repeat(textures, "l h w c -> (l t) c h w", t=matrices.shape[1])
146
+ grid = torch.nn.functional.affine_grid(
147
+ torch.linalg.inv(matrices.reshape(-1, 3, 3))[:, :2],
148
+ (tex_expand.shape[0], tex_expand.shape[1], canvas_height, canvas_width),
149
+ align_corners=True,
150
+ )
151
+ tex_warped = torch.nn.functional.grid_sample(tex_expand, grid, align_corners=True)
152
+ tex_warped = rearrange(tex_warped, "(l t) c h w -> l t h w c", l=len(textures))
153
+ tex_warped[..., -1] = tex_warped[..., -1] * opacities[:, :, None, None]
154
+ return tex_warped
155
+
156
+
157
+ def alpha_blend_torch(fg: torch.Tensor, bg: torch.Tensor, norm_value: float = 255.0) -> torch.Tensor:
158
+ """Blend two images as torch.Tensor."""
159
+ fg_alpha = fg[..., 3:4] / norm_value
160
+ bg_alpha = bg[..., 3:4] / norm_value
161
+ alpha = fg_alpha + bg_alpha * (1 - fg_alpha)
162
+ fg_rgb = fg[..., :3]
163
+ bg_rgb = bg[..., :3]
164
+ rgb = fg_rgb * fg_alpha + bg_rgb * bg_alpha * (1 - fg_alpha)
165
+ return torch.cat([rgb, alpha * norm_value], dim=-1)
166
+
167
+
168
+ def render(
169
+ textures: torch.Tensor, matrices: torch.Tensor, opacities: torch.Tensor, canvas_height: int, canvas_width: int
170
+ ) -> torch.Tensor:
171
+ """Render example using PyTorch functions."""
172
+ layers = render_layers(textures, matrices, opacities, canvas_height, canvas_width)
173
+ backdrop = layers[0]
174
+ for layer in layers[1:]:
175
+ backdrop = alpha_blend_torch(layer, backdrop)
176
+ return backdrop
177
+
178
+
179
+ ds = datasets.load_dataset("cyberagent/crello-animation")
180
+ example = ds["val"][0]
181
+
182
+ canvas_height = example["canvas_height"]
183
+ canvas_width = example["canvas_width"]
184
+ matrices_tr = torch.tensor(example["matrix"])
185
+ opacities_tr = torch.tensor(example["opacity"])
186
+ textures_tr = torch.tensor(np.array([np.array(t) for t in example["texture"]])).float()
187
+
188
+ frames_tr = render(textures_tr, matrices_tr, opacities_tr, canvas_height, canvas_width)
189
+ frames = [Image.fromarray(frame_np.astype(np.uint8)) for frame_np in frames_tr.numpy()]
190
+
191
+ ```
192
+
193
+ ## Dataset Creation
194
+
195
+ ### Curation Rationale
196
+
197
+ The Crello Animation is created with the aim of promoting general machine-learning research on animated graphics, such as sprite decomposition.
198
+
199
+ ### Source Data
200
+
201
+ #### Initial Data Collection and Normalization
202
+
203
+ The dataset is initially scraped from the former `crello.com` and pre-processed to the above format.
204
+
205
+ #### Who are the source language producers?
206
+
207
+ While [create.vista.com](https://create.vista.com/) owns those templates, the templates seem to be originally created by a specific group of design studios.
208
+
209
+ ### Personal and Sensitive Information
210
+
211
+ The dataset does not contain any personal information about the creator but may contain a picture of people in the design template.
212
+
213
+ ## Considerations for Using the Data
214
+
215
+ ### Social Impact of Dataset
216
+
217
+ This dataset is constructed for general machine-learning research on animated graphics. If used effectively, it is expected to contribute to the development of technologies that support creative tasks by designers, such as sprite decomposition.
218
+
219
+ ### Discussion of Biases
220
+
221
+ The templates contained in the dataset reflect the biases appearing in the source data, which could present gender biases in specific design categories.
222
+
223
+ ### Other Known Limitations
224
+
225
+ Due to the unknown data specification of the source data, textures and animation parameters do not necessarily accurately reproduce the original design templates. The original template is accessible at the following URL if still available.
226
+
227
+ https://create.vista.com/artboard/?template=<template_id>
228
+
229
+ ## Additional Information
230
+
231
+ ### Dataset Curators
232
+
233
+ The Crello Animation dataset was developed by [Tomoyuki Suzuki](https://tomoyukun.github.io/biography/).
234
+
235
+ ### Licensing Information
236
+
237
+ The origin of the dataset is [create.vista.com](https://create.vista.com) (formally, `crello.com`).
238
+ The distributor ("We") do not own the copyrights of the original design templates.
239
+ By using the Crello dataset, the user of this dataset ("You") must agree to the
240
+ [VistaCreate License Agreements](https://create.vista.com/faq/legal/licensing/license_agreements/).
241
+
242
+ The dataset is distributed under [CDLA-Permissive-2.0 license](https://cdla.dev/permissive-2-0/).
243
+
244
+ NOTE: We do not re-distribute the original files as we are not allowed by terms.
245
+
246
+ ### Citation Information
247
+
248
+ To be published in ECCV 2024.
249
+
250
+ ```
251
+ @inproceedings{suzuki2024fast,
252
+ title={Fast Sprite Decomposition from Animated Graphics},
253
+ author={Suzuki, Tomoyuki and Kikuchi, Kotaro and Yamaguchi, Kota},
254
+ booktitle={ECCV},
255
+ year={2024}
256
+ }
257
+ ```
258
+
259
+ ### Releases
260
+
261
+ 1.0: v1 release (July XX, 2024)
262
+
263
+ ### Acknowledgments
264
+
265
+ Thanks to [Kota Yamaguchi](https://github.com/kyamagu) for providing the [Crello dataset](https://huggingface.co/datasets/cyberagent/crello) that served as a valuable reference for this project.