This is the official implementation of: Joint Implicit Neural Representation for High-fidelity and Compact Vector Fonts.
- Python 3.8 or higher
- PyTorch 1.9.0
- Torchvision 0.10.0
- Clone the repository.
git clone https://github.com/Acc-plus/Joint-Implicit-Representation.git
git --init --recursive
cd Joint-Implicit-Representation
pip install -r requirements.txt
- Install the extension.
cd utils/extension
python setup.py install
- Install torchmeta.
cd torch meta
python setup.py install
- (Recommend) Install specified version of pytorch. If you install a higher version of pytorch, the torchmeta module will not be import correctly. You might resolve the problem by commenting out line 39 in torchmeta/dataset/utils.py. This operation has been verified on torch2.0.0+cu118.
conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=10.2 -c pytorch
-
Download VecFont dataset, following the instruction in DeepVecFont and place the test_all.pkl in ./dataset/ folder.
-
Generate the training data.
python gen_fonts.py
- Train the SDF Net.
python train.py --config utils/sdf.yaml
- Train the CF Net.
python train.py --config utils/cf.yaml
You can download pretrained model from Google Drive.
- Generate binary image from SDF Net.
python inf_sdf.py --config utils/sdf.yaml
- Generate corners from CF Net.
python inf_cf.py --config utils/cf.yaml
- Generate SVGs.
python vectorization.py
Please cite the following paper if this work helps your research:
@inproceedings{chen2023joint,
title={Joint Implicit Neural Representation for High-fidelity and Compact Vector Fonts},
author={Chia-Hao Chen and Ying-Tian Liu and Zhifei Zhang and Yuan-Chen Guo and Song-Hai Zhang},
booktitle={IEEE International Conference on Computer Vision},
year={2023}
}
If you have any questions, please contact accplusjh@gmail.com
Licensed under the MIT license.
- This implementation takes DIF-Net as a reference. We thank the authors for their excellent work.
- DeepVecFont