Giter Site home page Giter Site logo

asciiko's Introduction

asciiko (アス子)


A deep ascii art generator. Work done during MSR Montreal hackathon 2018.

Requirements

  • Python 2/3
  • Install Pytorch, follow this.
  • Install OpenCV2, conda install opencv should work.
  • Ask for permission of using ETL (a Japanese handwritten character recognition dataset) from here, then unzip and put ETL1 or ETL6 inside asciiko/ (we recommend using ETL6, which contains more punctuation marks, they might be helpful for generating ascii arts).

First Time Running

It will take some time if you run the first time, asciiko will preprocess and parse the ETL datasets, save the useful part into .npy files.

To Run

  • In config/config.yaml, enable CUDA if you have access to it, also specify which split of ETL data are you using.
  • To train a model, run python train.py -c config/.
  • To generate ascii strings from an image, modify and run python img2charid.py, it will generate a .json file;
  • To generate ascii strings from a video, run python utils/get_video_frames.py, to get all frames of a video into a folder, then modify and run python img2charid.py, it will generate a .json file.
  • To render the ascii arts, run python char_classifier/renderer.py, with your .json file specified inside.
  • a pretrained model (on ETL6) is provided in saved_models/.

Image Processing

Image processing is an important step before generating ascii arts, and the performance of the latter steps are highly relying on how good the images are processed, i.e., how good the edges are extracted. To our knowledge there's no 'panacea' for all input images/videos, so depending on which specific image or video you are using, sometimes you need to massage your edge detector carefully. Thanks to OpenCV, one can do some standard image processing tricks in one line of python code. We provide code to help tweaking your edge detector in utils/.

Demo

Authors

eric yuan, @oya0306, @penzant

LICENSE

GLWTPL

References

DeepAA

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.