Coder Social home page Coder Social logo

selfsupervisedimagetext's Introduction

Self-supervised Image-to-text and Text-to-image Synthesis

This is the official implementation of Self-supervised Image-to-text and Text-to-image Synthesis. The architecture of image atutoencoder and end-to-end network are shown.

Dataset

We use Caltech-UCSD Birds-200-2011 and Oxford-102 datasets in this work.

  • Download Flower images
  • Rename the jpg folder to images and unzip 102flowers.zip and put it inside 102flowers folder
  • put 102flowers folder inside data folder
  • Download Birds data and put inside Data/
  • Download image data Extract them to Data/birds/

Dependencies

  • pytorch
  • torchvision
  • tensorboardX
  • pickle

Training

Training the image autoencoder

The driver program for training the image autoencoder is main.py

To train the image autoencoder on flower dataset

python main.py --cfg cfg/flowers_3stages.yml --gpu 0

To train the image autoencoder birds dataset

python main.py --cfg cfg/birds_3stages.yml --gpu 0

Models will automatically saved after a fixed number of iteration, to restart from a failed step edit netG_version in respective .yml file

Training the text autoencoder

python run_text_test.py dataset_type Input_Folder output_file.txt
  • For Flower Dataset dataset_type=1, for Birds Dataset dataset_type=2 e.g.
python run_text_test.py 2 /home/user/dev/unsup/data_datasets/CUB_200_2011 outbirds_n.txt

Training the mapping networks

Train the GAN-based mapping network

python MappingImageText.py Dataset_folder

e.g.

python MappingImageText.py /home/user/dev/unsup/data_datasets/CUB_200_2011

Train the MMD-based mapping network

python mmd_ganTI.py --dataset /home/das/dev/data_datasets/birds_dataset/CUB_200_2011 --gpu_device 0
python mmd_ganIT.py --dataset /home/das/dev/data_datasets/birds_dataset/CUB_200_2011 --gpu_device 0

selfsupervisedimagetext's People

Contributors

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