Code Monkey home page Code Monkey logo

seq2seq_temporal_attention's Introduction

Sequence-to-sequence Model with Temporal Attention

seq2seq_temporal_attention is a tool for automatic video captioning. This is an implementation of Generating Video Description using Sequence-to-sequence Model with Temporal Attention (PDF).

Requirements (Linux/Mac)

For requirements for Windows, read docs/requirements-windows.md.

Examples

Captioning a video

To test out the tool, run example.sh. It gives a caption for an excerpt of the video titled playing wool ball with my cat : ). Our models were trained on Microsoft Video Description Dataset.

cat video thumbnail

git clone [email protected]:aistairc/seq2seq_temporal_attention.git --recursive
./download.sh
./example.sh --gpu GPU_ID  # It will generate a caption *a cat is playing with a toy*

Note: In most cases, setting GPU_ID to 0 will work. If you want to run it without GPU, set the parameter to -1.

Training

This is an example command to train.

cd code
python chainer_seq2seq_att.py \
    --mode train \
    --gpu GPU_ID \
    --batchsize 40 \
    --dropout 0.3 \
    --align ('dot'|'bilinear'|'concat'|'none') \
    --feature feature_file_name \
    output_folder

Test

There are two ways for test, test and test-batch. The latter runs much faster, but it does not use beam search. Be careful to specify which alignment model you want to use. It has to match your pre-trained model, in order to make it work correctly.

cd code
python chainer_seq2seq_att.py \
    --mode ('test'|'test-batch') \
    --gpu GPU_ID \
    --model path_to_model_file \
    --align ('dot'|'bilinear'|'concat'|'none') \
    --feature feature_file_name \
    output_folder

seq2seq_temporal_attention's People

Contributors

natsudalkr avatar nzw0301 avatar pecorarista avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

seq2seq_temporal_attention's Issues

Error in Code

running ./example.sh --gpu 0

pickle.PickleError: can't pickle repeated message fields, convert to list first

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.