Coder Social home page Coder Social logo

scrabble-gan's Introduction

ScrabbleGAN (TensorFlow 2/ Python3)

Implementation of ScrabbleGAN for adversarial generation of handwritten text images in TensorFlow 2.1.

More details can be found here

Implementational notes

  • the BigGAN-part/ structure of ScrabbleGAN is based on google/compare_gan rewritten in TF2
  • all dependencies (batch size, epochs etc.) are handled using google gin-config

Setup (only tested on MacOS)

  1. Download and extract IAM-Handwriting DB and random word list as described in src/dinterface/dinterface.py

    wget --user <user-id> --password <pw> http://www.fki.inf.unibe.ch/DBs/iamDB/data/words/words.tgz 
    wget --user <user-id> --password <pw> http://www.fki.inf.unibe.ch/DBs/iamDB/data/ascii/words.txt
    wget -O random_words.txt https://www.dropbox.com/s/o60ubzh3m163j0x/random_words.txt?dl=0
    tar zxvf words.tgz
    rm -rf words.tgz       
    
  2. Move folders into correct position (see File Structure); update file paths in scrabble_gan.gin + main.py

  3. Install dependencies (e.g. AWS P3)

Usage

Train model

python3 main.py

File Structure

 doc
     ├── installation_aws_p3.txt                    # how to install dependencies on AWS P3 instance
     ├── ...                                        # addtional README resources
 res                               
     ├── data/                                      # various word datasets (e.g. RIMES, IAM, ...)
         ├── iamDB/                                              
             ├── words/                                          
             ├── words-Reading/ 
             ├── words.txt                                            
         ├── random_words.txt/                                  
     ├── out/                                       # location where to store generated output files   
         ├── big_ac_gan/                            # output of ScrabbleGAN (here denoted as big_ac_gan)
             ├── images/                            
             ├── model/                             
             ├── training_checkpoints/              
         ├── ...                                    # potentially output of more models   
 src
     ├── bigacgan/                                  # ScrabbleGAN implementation
         ├── ...                                           
     ├── dinterface/                                # purpose: bring various datasets into equal format
         ├── ...                                         
     ├── main.py                                    # core of this repo - train ScrabbleGAN
     ├── scrabble_gan.gin                           # all dependencies are handled here (gin config file)

License

License

scrabble-gan's People

Contributors

nikolai10 avatar

Watchers

James Cloos avatar

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.