All Projects → tsenghungchen → Show Adapt And Tell

tsenghungchen / Show Adapt And Tell

Licence: mit
Code for "Show, Adapt and Tell: Adversarial Training of Cross-domain Image Captioner" in ICCV 2017

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Show Adapt And Tell

Pytorch Rl
PyTorch implementation of Deep Reinforcement Learning: Policy Gradient methods (TRPO, PPO, A2C) and Generative Adversarial Imitation Learning (GAIL). Fast Fisher vector product TRPO.
Stars: ✭ 658 (+350.68%)
Mutual labels:  reinforcement-learning, policy-gradient
Slm Lab
Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".
Stars: ✭ 904 (+519.18%)
Mutual labels:  reinforcement-learning, policy-gradient
Rlseq2seq
Deep Reinforcement Learning For Sequence to Sequence Models
Stars: ✭ 683 (+367.81%)
Mutual labels:  reinforcement-learning, policy-gradient
Policy Gradient
Minimal Monte Carlo Policy Gradient (REINFORCE) Algorithm Implementation in Keras
Stars: ✭ 135 (-7.53%)
Mutual labels:  reinforcement-learning, policy-gradient
Torchrl
Highly Modular and Scalable Reinforcement Learning
Stars: ✭ 102 (-30.14%)
Mutual labels:  reinforcement-learning, policy-gradient
Tensorflow Reinforce
Implementations of Reinforcement Learning Models in Tensorflow
Stars: ✭ 480 (+228.77%)
Mutual labels:  reinforcement-learning, policy-gradient
Btgym
Scalable, event-driven, deep-learning-friendly backtesting library
Stars: ✭ 765 (+423.97%)
Mutual labels:  reinforcement-learning, policy-gradient
Awesome Monte Carlo Tree Search Papers
A curated list of Monte Carlo tree search papers with implementations.
Stars: ✭ 387 (+165.07%)
Mutual labels:  reinforcement-learning, policy-gradient
Reinforcement learning
강화학습에 대한 기본적인 알고리즘 구현
Stars: ✭ 100 (-31.51%)
Mutual labels:  reinforcement-learning, policy-gradient
Reinforcement learning
Reinforcement learning tutorials
Stars: ✭ 82 (-43.84%)
Mutual labels:  reinforcement-learning, policy-gradient
Reinforcement learning tutorial with demo
Reinforcement Learning Tutorial with Demo: DP (Policy and Value Iteration), Monte Carlo, TD Learning (SARSA, QLearning), Function Approximation, Policy Gradient, DQN, Imitation, Meta Learning, Papers, Courses, etc..
Stars: ✭ 442 (+202.74%)
Mutual labels:  reinforcement-learning, policy-gradient
Pytorch Rl
Tutorials for reinforcement learning in PyTorch and Gym by implementing a few of the popular algorithms. [IN PROGRESS]
Stars: ✭ 121 (-17.12%)
Mutual labels:  reinforcement-learning, policy-gradient
Deep Rl Keras
Keras Implementation of popular Deep RL Algorithms (A3C, DDQN, DDPG, Dueling DDQN)
Stars: ✭ 395 (+170.55%)
Mutual labels:  reinforcement-learning, policy-gradient
Hands On Reinforcement Learning With Python
Master Reinforcement and Deep Reinforcement Learning using OpenAI Gym and TensorFlow
Stars: ✭ 640 (+338.36%)
Mutual labels:  reinforcement-learning, policy-gradient
Pytorch Rl
This repository contains model-free deep reinforcement learning algorithms implemented in Pytorch
Stars: ✭ 394 (+169.86%)
Mutual labels:  reinforcement-learning, policy-gradient
Reinforcement Learning With Tensorflow
Simple Reinforcement learning tutorials, 莫烦Python 中文AI教学
Stars: ✭ 6,948 (+4658.9%)
Mutual labels:  reinforcement-learning, policy-gradient
Text summurization abstractive methods
Multiple implementations for abstractive text summurization , using google colab
Stars: ✭ 359 (+145.89%)
Mutual labels:  reinforcement-learning, policy-gradient
Lagom
lagom: A PyTorch infrastructure for rapid prototyping of reinforcement learning algorithms.
Stars: ✭ 364 (+149.32%)
Mutual labels:  reinforcement-learning, policy-gradient
Rl Course Experiments
Stars: ✭ 73 (-50%)
Mutual labels:  reinforcement-learning, policy-gradient
Easy Rl
强化学习中文教程,在线阅读地址:https://datawhalechina.github.io/easy-rl/
Stars: ✭ 3,004 (+1957.53%)
Mutual labels:  reinforcement-learning, policy-gradient

show-adapt-and-tell

This is the official code for the paper

Show, Adapt and Tell: Adversarial Training of Cross-domain Image Captioner
Tseng-Hung Chen, Yuan-Hong Liao, Ching-Yao Chuang, Wan-Ting Hsu, Jianlong Fu, Min Sun
To appear in ICCV 2017

In this repository we provide:

If you find this code useful for your research, please cite

@article{chen2017show,
  title={Show, Adapt and Tell: Adversarial Training of Cross-domain Image Captioner},
  author={Chen, Tseng-Hung and Liao, Yuan-Hong and Chuang, Ching-Yao and Hsu, Wan-Ting and Fu, Jianlong and Sun, Min},
  journal={arXiv preprint arXiv:1705.00930},
  year={2017}
}

Requirements

P.S. Please clone the repository with the --recursive flag:

# Make sure to clone with --recursive
git clone --recursive https://github.com/tsenghungchen/show-adapt-and-tell.git

Data Preprocessing

MSCOCO Captioning dataset

Feature Extraction

  1. Download the pretrained ResNet-101 model and place it under data-prepro/MSCOCO_preprocess/resnet_model/.
  2. Please modify the caffe path in data-prepro/MSCOCO_preprocess/extract_resnet_coco.py.
  3. Go to data-prepro/MSCOCO_preprocess and run the following script: ./download_mscoco.sh for downloading images and extracting features.

Captions Tokenization

  1. Clone the NeuralTalk2 repository and head over to the coco/ folder and run the IPython notebook to generate a json file for Karpathy split: coco_raw.json.
  2. Run the following script: ./prepro_mscoco_caption.sh for downloading and tokenizing captions.
  3. Run python prepro_coco_annotation.py to generate annotation json file for testing.

CUB-200-2011 with Descriptions

Feature Extraction

  1. Run the script ./download_cub.sh to download the images in CUB-200-2011.
  2. Please modify the input/output path in data-prepro/MSCOCO_preprocess/extract_resnet_coco.py to extract and pack features in CUB-200-2011.

Captions Tokenization

  1. Download the description data.
  2. Run python get_split.py to generate dataset split following the ECCV16 paper "Generating Visual Explanations".
  3. Run python prepro_cub_annotation.py to generate annotation json file for testing.
  4. Run python CUB_preprocess_token.py for tokenization.

Models from the paper

Pretrained Models

Download all pretrained and adaption models:

Example Results

Here are some example results where the captions are generated from these models:

MSCOCO: A large air plane on a run way. CUB-200-2011: A large white and black airplane with a large beak. TGIF: A plane is flying over a field. Flickr30k: A large airplane is sitting on a runway. MSCOCO: A traffic light is seen in front of a large building. CUB-200-2011: A yellow traffic light with a yellow light. TGIF: A traffic light is hanging on a pole. Flickr30k: A street sign is lit up in the dark
MSCOCO: A black dog sitting on the ground next to a window. CUB-200-2011: A black and white dog with a black head. TGIF: A dog is looking at something in the mirror. Flickr30k: A black dog is looking out of the window. MSCOCO: A man riding a skateboard up the side of a ramp. CUB-200-2011: A man riding a skateboard on a white ramp. TGIF: A man is doing a trick on a skateboard. Flickr30k: A man in a blue shirt is doing a trick on a skateboard.

Training

The training codes are under the show-adapt-tell/ folder.

Simply run python main.py for two steps of training:

Training the source model with paired image-caption data

Please set the Boolean value of "G_is_pretrain" to True in main.py to start pretraining the generator.

Training the cross-domain captioner with unpaired data

After pretraining, set "G_is_pretrain" to False to start training the cross-domain model.

License

Free for personal or research use; for commercial use please contact me.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].