Git Product home page Git Product logo

font2font's Introduction

font2font: Learning Chinese Calligraphy with Conditional Adversarial Networks

display

Introduction

Learning Eastern Asian language fonts with conditional adversarial networks. This is an extension of the recent work "Image-to-image translation with conditional adversarial networks" by Isola P. et al.

Model

display

The network is based on conditional adversarial networks, with the addition of L1 loss and semantic reconstruction loss (Lrecon), which is inspired by the recent work "Perceptual losses for real-time style transfer and super-resolution" by Johnson J. et al.

Currently, the network is only capable of performing one-to-one font style transfer. We may extend it to support one-to-many style transfer in the future.

Experiment

Chinese Characters

display

Training: 3000 Chinese characters.

Korean Characters

display

Training: 3000 Chinese characters.

Notably, the network has never seen any Korean characters before the inferring stage. The experiment shows that our network is capable of performing style transfer on previously unseen characters.

Setup

Prerequisites

  • Linux or OSX
  • NVIDIA GPU + CUDA CuDNN

Getting Started

  • Download the fonts (.ttf or .otf)
  • Generating corresponding images for the fonts, call:
python script/generate.py --src_font=xxx.ttf --dst_font=xxx.otf --charset=CN --shuffle=1 --filter=1 --sample_count=3000 --sample_dir=.

Train

DATA_ROOT=/path/to/data/ name=expt_name which_direction=AtoB th train.lua

Switch AtoB to BtoA to train translation in opposite direction. See opt in train.lua for additional training options.

Test

DATA_ROOT=/path/to/data/ name=expt_name which_direction=AtoB phase=val th test.lua

See opt in test.lua for additional testing options.

font2font's People

Contributors

weijia-xu avatar

Stargazers

胡小根 avatar Jiawei Chen avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Forkers

haolongjie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.