Giter Site home page Giter Site logo

rubickh / controllable_xgating Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vsislab/controllable_xgating

0.0 2.0 0.0 2.66 MB

ICCV2019: Controllable Video Captioning with POS Sequence Guidance Based on Gated Fusion Network

Python 98.92% Shell 1.08%

controllable_xgating's Introduction

Controllable Video Captioning with POS Sequence Guidance Based on Gated Fusion Network

Introduction

In this paper, we propose to guide the video caption generation with POS information, based on a gated fusion of multiple representations of input videos. We construct a novel gated fusion network, with one cross-gating (CG) block, to effectively encode and fuse different types of representations, e.g., the motion and content features. One POS sequence generator relies on this fused representation to predict the global syntactic structure, which is thereafter leveraged to guide the video captioning generation and control the syntax of the generated sentence. This code is a Pytorch implement of this work. image

Dependencies

  • Python 2.7
  • Pytorch 0.3.1.post3
  • Cuda 8.0
  • Cudnn 7.0.5

Prepare

  1. Download Inception_ResNet_V2 features of MSRVTT-10K RGB frames and I3D features of MSRVTT-10K optical flows, and put them in datas folder.
  2. Download pre-trained models, and put them in results folder.
  3. Download the automatic evaluation metrics -- coco-caption, and link it to caption_src/ as well as pos_src/.
ln -s coco-caption caption_src/coco-caption
ln -s coco-caption pos_src/coco-caption
  1. Finally, the document structure of the root path should be like this: image

Evaluation

We provide the pre-trained models of "Ours(IR+M)" and "Ours_RL(IR+M)" in paper to reproduce the result reported in paper. Users can change the command in evaluation.sh to reproduce "Ours(IR+M)" or "Ours_RL(IR+M)".

Metrics Ours(IR_M) Ours_RL(IR+M)
BLEU@1 0.7875 0.8175
BLEU@2 0.6601 0.6788
BLEU@3 0.5339 0.5376
BLEU@4 0.4194 0.4128
METEOR 0.2819 0.2869
ROUGE-L 0.6161 0.6210
CIDEr 0.4866 0.5337
cd caption_src/
sh evaluation.sh

Training

Actually, training in this repository is divided into two steps:

  1. Train a global pos generator and extract the global postag features.
cd pos_src/
sh run_train.sh

After early stopping, extract and store the postag features in pos_src/globalpos_features/xxx.hdf5, where xxx.hdf5 can be customized at line36 of pos_src/eval_utils.py

sh run_extract_pos.sh

Rember to copy the postag features hdf5 into datas/.

  1. Train the caption model.
cd caption_src/
sh run_train.sh

Citation

If you use our code in your research or wish to refer to the baseline results, please use the use the following BibTeX entry.

@article{wang2019controllable,
  title={Controllable Video Captioning with POS Sequence Guidance Based on Gated Fusion Network},
  author={Wang, Bairui and Ma, Lin and Zhang, Wei and Jiang, Wenhao and Wang, Jingwen and Liu, Wei},
  journal={arXiv preprint arXiv:1908.10072},
  year={2019}
}

Acknowledge

Special thanks to Ruotian Luo, as our codes about Self-critical Sequence Training was inspired by and references to his repository.

controllable_xgating's People

Contributors

siyilingting avatar

Watchers

 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.