Giter Site home page Giter Site logo

google / autocjk Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 4.0 19.67 MB

AutoCJK is a tool for generating low-resolution predictions of uncommon CJK characters, given full-width images of their components.

License: Apache License 2.0

Starlark 7.22% Python 92.78%
cjk fonts

autocjk's Introduction

AutoCJK

AutoCJK is a tool for generating low-resolution predictions of uncommon CJK characters, given full-width images of their components.

Example:

U+20E74

(Left-to-right: (a) source left-hand component, (b) source right-hand component, (c) expected composition, (d) predicted composition, (e) c/d difference)

How do I generate a new character?

First install the project and its dependencies. See platform-specific instructions on the wiki.

Given a font at ~/Downloads/font.otf, we can render ⿰市來 and write the generated image to /tmp/out.png with:

bazel run //src:main -- \
  --font_path=<path_to_font> \
  --input='⿰市來' \
  --out=/tmp/out.png

Usage guide:

Bundled with this repo is /src/generator.h5, a trained model with pretty good results. This generator was trained on ~270k image pairs, generated by extracting characters from the fonts NotoSansCJKsc-* and NotoSerifCJKsc-*.

The resultant generator is pretty good at generating characters in that style. It might even be pretty good at generating characters in a new style. If you discover it's not, you can (a) generate a new batch of training images in your own font style, and (b) run model.py in order to train a new model. If you save that model as src/generator.h5, you can continue to use bazel run //src:main as expected.

autocjk's People

Contributors

ambuc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

autocjk's Issues

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.