Wataru Shimoda1, Daichi Haraguchi2, Seiichi Uchida2, Kota Yamaguchi1
1CyberAgent.Inc, 2 Kyushu University
Accepted to ICCV2021.
[paper]
[project-page]
This repository contains the codes for "De-rendering stylized texts".
We propose to parse rendering parameters of stylized texts utilizing a neural net.
The proposed model parses rendering parameters based on famous 2d graphic engine[Skia.org], which has compatibility with CSS in the Web. We can export the estimated rendering parameters and edit texts by an off-the-shelf rendering engine.
- Python >= 3.7
- Pytorch >= 1.8.1
- torchvision >= 0.9.1
pip install - r requiements.txt
- The proposed model is trained with google fonts.
- Download google fonts and locate in
data/fonts/
asgfonts
.
cd data/fonts
git clone https://github.com/google/fonts.git gfonts
- The proposed model parses rendering parameters and refines them through the differentiable rendering model, which uses pre-rendered alpha maps.
- Generate pre-rendered alpha maps.
python -m utilLib.gen_pams
Pre-rendered alpha maps would be generated in data/fonts/prerendered_alpha
.
- Download the pre-trained weight from this link (weight).
- Locate the weight file in
weights/font100_unified.pth
.
Example usage.
python test.py --imgfile=example/sample.jpg
Note
- imgfile option: path of an input image
- results would be generated in
res/
in progress
in progress
- Testing codes
- Codes for the text image generator
- Training codes
- Add notebooks for the guide
@inproceedings{shimoda2021dst,
title = {De-rendering Stylized Texts},
author = {Wataru, Shimoda and Daichi, Haraguchi and Seiichi, Uchida and Koata, Yamaguchi},
booktitle = {Proceedings of the IEEE / CVF International Conference on Computer Vision.},
year = {2021}
}
This repository is maintained by Wataru shimoda(wataru_shimoda[at]cyberagent.co.jp).