In this project, We propose a font generator based on Generative Adversarial Networks (GANs) and texture synthesis with Convolutional Neural Networks.
To run the code, Go to this Google colab: notebook and playaround the system.
You can either run the .ipynb notebook or run the main.py.
GPU is required for both testing and training.
# For training and testing
pip install pytorch
# For font parser
pip install beautifulsoup4
Some generated font images are shown below:
The system contains two sub-nets: A glyph generation netowrk to generate glyph image and a texture synthesis network to synthesis texture and apply them on glyph images.
We also provide a font image dataset with 7 different font theme. You can download from google drive
Notebook provide a downloader, you can download glyph training data in the notebook. Or you can manually download font dataset from google drive: link download them and drag them into ./data/GAN_training_data/ folder.
--->data:
------>GAN_training_data: training data for glyph generation
------>Glyph_parser_data: raw training data for glyph generation(unzip files)
------>texture_data: training data and generated texture images
--->font_parser: glyph images parser
--->models: pre-trained glyph generation models
--->nets: glyph generation and texture synthesis network
--->results:
------>GAN_opt: glyph generation results during training
------>Texture_opt: texture synthesis results during training
--->utils: some tools for training and testing
->evaluator.py: evaluator for trained models
->info_GAN_train.py main glyph generation file
->texture_synthesis_train.py main texture synthesis file
->playground.ipynb notebook for training and testing
->main.py testing file(recommend using playground.ipynb)
if you want to train you texture, you need to download the pre-trained vgg16.npy file from google drive: link download them and drag it into ./nets, or automatically download them in the notebook.
MIT If you have any questions about operating the system, please contact my email address: [email protected]