GithubHelp home page GithubHelp logo

m516825 / caption-generation Goto Github PK

View Code? Open in Web Editor NEW
6.0 4.0 0.0 2.24 MB

License: MIT License

Python 100.00%
deep-learning tensorflow caption generative-model beam-search greedy-search rnn-encoder-decoder

caption-generation's Introduction

Caption-Generation

Machine generate a reasonable caption for input video, using attention-based seq2seq model with LSTM cell

Model Prediction : "a small dog is playing with a ball"

Environment

python3
tensorflow 1.0

Data

source link
google drive link

Usage

Download hw2 data from kaggle, and GloVe 300 dim

./Caption-Generation/MLDS_hw2_data/*
./Caption-Generation/MLDS_hw2_data/glove/glove.6B.300d.txt

Train

First time use, you need to do the preprocessing

$ python3 caption_gen.py --prepro 1

If you already have done the preprocessing

$ python3 caption_gen.py --prepro 0

Model

There are three different models available.

  1. CaptionGeneratorBasic
  • greedy inference
  1. CaptionGeneratorMyBasic
  • beam search
  • greedy inference
  1. CaptionGeneratorSS
  • schedule sampling
  • beam search
  • greedy search

You can set model_type to new different model. e.g.

$ python3 caption_gen.py --prepro [1/0] --model_type=CaptionGeneratorSS

Inference

This code provide two inference methods, Greedy Search and Beam Search
beam search inference is not available in CaptionGeneratorBasic model.
(default beam search @k is set to 5)

caption-generation's People

Contributors

m516825 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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