Skip to content

Acc-plus/Joint-Implicit-Representation

Repository files navigation

Joint-Implicit-Representation

image

This is the official implementation of: Joint Implicit Neural Representation for High-fidelity and Compact Vector Fonts.

Installation

Requirement

  • Python 3.8 or higher
  • PyTorch 1.9.0
  • Torchvision 0.10.0
  1. 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
  1. Install the extension.
cd utils/extension
python setup.py install
  1. Install torchmeta.
cd torch meta
python setup.py install
  1. (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

Training a model from scratch

Data preparation

  1. Download VecFont dataset, following the instruction in DeepVecFont and place the test_all.pkl in ./dataset/ folder.

  2. Generate the training data.

python gen_fonts.py

Training

  1. Train the SDF Net.
python train.py --config utils/sdf.yaml
  1. Train the CF Net.
python train.py --config utils/cf.yaml

Inference

You can download pretrained model from Google Drive.

  1. Generate binary image from SDF Net.
python inf_sdf.py --config utils/sdf.yaml
  1. Generate corners from CF Net.
python inf_cf.py --config utils/cf.yaml
  1. Generate SVGs.
python vectorization.py

Citation

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}
}

Contact

If you have any questions, please contact accplusjh@gmail.com

License

Licensed under the MIT license.

Acknowledgement

  • This implementation takes DIF-Net as a reference. We thank the authors for their excellent work.
  • DeepVecFont

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors