Git Product home page Git Product logo

image_captioning's Introduction

Image_Captioning

A man is riding an atv in the field . A brown and white dog is shaking it self by water .

Our project is to generate captions for a given image. We implemented show attend and tell paper.

Model:

Encoder:

  • The Encoder encodes the image and outputs a smaller iamge(14*14) with 2048 learned which acts as the summary representaion of input image
  • We used 52 layered Residual Network trained on the ImageNet classification task, already available in PyTorch.

Attention:

  • Attention network computes the weights corresponding to each encoded pixels which reflects the importance of that pixel in effecting the prediction of next word.
  • The weights corresponding to each pixel at a time instant are calculated using hidden state of previous time instant and the encoder output. We used soft attention where the sum of weigths of pixels add up to one.

Decoder:

  • By looking at the encoded image with probabilities assigned to each pixels, last hidden it tries to predict the next word in the sequence.
  • Since generating a sequence would need recurrent neural network we used lstms.

Results :

โ€‹
-

Requirements:

  • python 3.5+
  • pytorch
  • Numpy
  • cuda

Setup:

python main.py # for training
python main.py --load modelName --eval True # for testing 

References:

  1. Show attend and tell
  2. Reference for image captioning code

image_captioning's People

Contributors

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