Giter VIP home page Giter VIP logo

gr-gan's Introduction

GR-GAN

Pytorch implementation for reproducing GR-GAN results in the paper GRADUAL REFINEMENT TEXT-TO-IMAGE GENERATION

Usage

Get the code from github:git clone https://github.com/BoO-18/GR-GAN.git

Create a new conda env:conda create -n grgan python=3.7 and conda activate grgan

Install torch==1.7.1: conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0

Folder CLIP is code from OPENAI with some changes to the output of the image encoder and text encoder. You should run:pip install CLIPto install it.

Data

  1. Download our preprocessed metadata for coco and save them to data/
  2. Download coco dataset and extract the images to data/coco/

Training

  • Pre-train ITM models: python pretrain_ITM.py --cfg cfg/ITM/coco.yml --gpu 0

  • Train GR-GAN models: python main.py --cfg cfg/coco_GRAGN.yml --gpu 1

  • *.yml files are example configuration files for training/evaluation our models.

Pretrained Model

Demo

  • File code/demo.ipynb is a detailed usage example for GR-GAN.

Validation

  • Generate images for GR-GAN models on MS-COCO: python main.py --cfg cfg/eval_coco.yml --gpu 2
  • We compute inception score for models trained on coco: python CMD_score.py --path1 image_feature.npz --path2 sent_feature.npz --path3 (your image path) --gpu 3

gr-gan's People

Contributors

boo-18 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.