https://github.com/cyberagentailab/sprite-decompose
Fast Sprite Decomposition from Animated Graphics [ECCV2024]
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.3%) to scientific vocabulary
Keywords
Repository
Fast Sprite Decomposition from Animated Graphics [ECCV2024]
Basic Info
- Host: GitHub
- Owner: CyberAgentAILab
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://cyberagentailab.github.io/sprite-decompose
- Size: 53.1 MB
Statistics
- Stars: 25
- Watchers: 1
- Forks: 3
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
Fast Sprite Decomposition from Animated Graphics (ECCV2024)
This repository is an official implementation of the paper "Fast Sprite Decomposition from Animated Graphics". Please also refer to the project page, paper, and our Crello Animation dataset.

Setup
We check the reproducibility under this environment.
- Python 3.10
- CUDA 11.3
After constructing Python environment, install this project with the following command:
bash
pip install -e fsd
Decomposition
Sample-level
You can decompose a video by running the following command:
bash
./scripts/optimize_sample.sh \
in_dir="./inputs/62a87468079dcd93634632e7" \
out_dir="./_outputs/62a87468079dcd93634632e7" \
engine.n_iters=60000 \
device=cuda
We provide some examples of inputs (video and foreground box) from Crello Animation in ./inputs and corresponding outputs (sprites) in ./outputs.
You can specify the input data by changing the in_dir argument.
We manage configurations using hydra and you can override the default configuration (our best) by specifying the arguments. We illustrate some useful arguments to adjust your optimization as follows:
engine.n_iters: number of iterations for optimization.engine.save_interval: iteration interval for saving the optimization progress.engine.eval_interval: iteration interval for evaluating the decomposition quality, which is logged inprogress.json.engine.timelimit_minute: time limit for each optimization in minutes. If the optimization exceeds this limit, it will be terminated even if the number of iterations is not reached.engine.resume: ifTrue, resume the optimization from the last checkpoint inout_dir.device: device to run the optimization. You can specifycudaorcpu.
Outputs are stored in the following directory structure:
bash
{out_dir}
├── sprites # Decomposed sprites
│ ├── iter_*
│ │ ├── params.json # Parameters including affine matrices and opacity
│ │ └── textures # Textures
│ │ ├── 0.png
│ │ ├── 1.png
│ │ └── 2.png
│ └── iter_*.png # Output visualization
├── last_checkpoint.pth # Last checkpoint of optimization
└── progress.json # Progress log including evaluation results and elapsed time
You can refer to ./inputs/{VIDEO_ID}/{VIDEO_ID}.png and ./outputs/{VIDEO_ID}/animation/iter_*.png for a brief understanding of the decomposition result. Below is an example:
Input:

Output visualization:
The leftmost is the reconstruction result, the next is the background, and the rest are sprites.
on Crello Animation
You can also conduct decomposition and evaluation on Crello Animation by running the following command:
bash
./scripts/optimize.sh \
out_dir="./_outputs/crello-animation/" \
data.split="val" \
device=cuda
data.split can be val or test.
You will obtain the same output structure as the sample-level decomposition for all samples in Crello Animation.
Citation
If you find this code useful for your research, please cite our paper.
bibtex
@inproceedings{suzuki2024fast,
title={Fast Sprite Decomposition from Animated Graphics},
author={Suzuki, Tomoyuki and Kikuchi, Kotaro and Yamaguchi, Kota},
booktitle={ECCV},
year={2024}
}
Acknowledgments
Thanks to the following repositories that we referred to in part: Track-Anything and deformable-sprites
Owner
- Name: CyberAgent AI Lab
- Login: CyberAgentAILab
- Kind: organization
- Location: Japan
- Website: https://cyberagent.ai/ailab/
- Twitter: cyberagent_ai
- Repositories: 7
- Profile: https://github.com/CyberAgentAILab
GitHub Events
Total
- Watch event: 8
Last Year
- Watch event: 8
Dependencies
- Pillow ==9.4.0
- apng ==0.3.4
- av ==11.0.0
- datasets ==2.20.0
- easydict ==1.12
- einops ==0.7.0
- fsspec ==2024.2.0
- gcsfs ==2024.2.0
- hydra-core ==1.3.2
- imageio ==2.34.0
- lpips ==0.1.4
- matplotlib ==3.8.3
- mypy ==1.8.0
- numpy ==1.26.3
- opencv-python ==4.7.0.72
- pandas >=1.1.5
- scipy ==1.12.0
- skia-python ==87.5
- torch ==2.0.1
- torchvision ==0.15.2
- tqdm >=4.65.0