Coder Social home page Coder Social logo

sriharsha-sammeta / sentence-to-pixels-representation-using-gan Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 23.31 MB

This is a deep learning code written in PyTorch that convert a given text into image.

Python 100.00%
pytorch deep-learning gan generative-adversarial-network cocodataset infogan infogan-pytorch dcgan wgan

sentence-to-pixels-representation-using-gan's Introduction

Sentence to Pixel Representations using GANs

Project by:

  1. Venkata Sai Sriharsha Sammeta (vs2626)
  2. Smitha Edakalavan (se2444)
  3. Yuval Schaal (ys3055)

This code requires GPU and the following libraries needs to be installed.

Requirements

  • pytorch
  • visdom
  • numpy
  • h5py
  • PIL

Individual Contributions

Venkata Sai Sriharsha Sammeta - vs2626

  • CoreModels/infogan.py
  • CoreModels/coremodel.py
  • CoreModels/repository.py
  • RNNModel/utility.py
  • RNNModel/attentive_weights.py
  • RNNModel/data.py
  • RNNModel/model.py
  • RNNModel/train.py
  • CustomDatasetLoader.py
  • helper.py
  • main.py
  • train_gan.py
  • train_infogan.py

Smitha Edakalavan - se2444

  • CoreModels/wgan.py
  • train_wgan.py
  • config.yaml
  • logger.py

Yuval Schaal - ys3055

  • CoreModels/dcgan.py
  • train_dcgan.py
  • scripts/script_hd5.py
  • created figure 1 and figure 3 in reports shown in img/fig1 and img/fig3

Code Organization

  • main.py - It is the starting point of the code. It will read config.yaml and accordingly call the appropriate training/testing methods on corresponding gans
  • {root directory} - Has Train_{gan_type} files like train_dcgan.py, train_wgan.py and train_infogan.py that are used to train / test the corresponding gan models
  • CoreModels directory - Has all the models (DCGAN, WGAN and INFOGAN) in it
  • RNNModel directory- Has the entire model and training process for the Attention Based RNN Embedding that we used
  • RNNModel/utility.py - has code for tools and helper methods used inside RNN model
  • RNNModel/attentive_weights.py - code for evaluating the attention model
  • RNNModel/data.py - has the code to load and modify corpus
  • RNNModel/model.py - Has the code which defines the architecture of the model
  • RNNModel/train.py - Has the code required to train the RNN model
  • scripts directory - Has the script required to convert the given data into hd5 format as required for pytorch
  • CustomDataSetLoader.py - It is used for loading datasamples as required by the code via pytorch
  • logger.py - has code for logging purpose
  • helper.py - has code for some tools & visualization

Quick Run Instructions

If you want to quickly test the implementation:

  • Downaload this file which has flowers dataset in the format need for pytorch.
  • Put it in root directory
  • run the command python main.py

Detailed instructions to test various datasets and models

We are using 3 datasets to train our gan models.

To download the dataset, please follow this for Flowers, Birds, COCO and put it in the root directory.

Update config.yaml file with the above downloaded filename (already default is flowers.hd5):

dataset: 'filename'

Likewise, we can switch between gan_type of dcgan, infogan and wgan by

gan_type: 'dcgan' or 'wgan' or 'infogan'

Training

To run the training process:

python main.py

Testing

To run the inference/testing: In the config.yaml file, set inference: True. Then run,

python main.py

Reference Links

sentence-to-pixels-representation-using-gan's People

Contributors

edakksm avatar sriharsha-sammeta avatar yuvsc avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  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.