Git Product home page Git Product logo

image-captioning's Introduction

Image-Captioning using InceptionV3 and Beam Search

Using Flickr8k dataset since the size is 1GB. MS-COCO is 14GB!

Used Keras with Tensorflow backend for the code. InceptionV3 is used for extracting the features.

I am using Beam search with k=3, 5, 7 and an Argmax search for predicting the captions of the images.

The loss value of 1.5987 has been achieved which gives good results. You can check out some examples below. The rest of the examples are in the jupyter notebook. You can run the Jupyter Notebook and try out your own examples. unique.p is a pickle file which contains all the unique words in the vocabulary.

Everything is implemented in the Jupyter notebook which will hopefully make it easier to understand the code.

I have also written a blog post describing my experience while implementing this project. You can find it here.

You can download the weights here.

Examples

"first2" "second2" "third" "last1"

Dependencies

  • Keras 1.2.2
  • Tensorflow 0.12.1
  • tqdm
  • numpy
  • pandas
  • matplotlib
  • pickle
  • PIL
  • glob

References

[1] M. Hodosh, P. Young and J. Hockenmaier (2013) "Framing Image Description as a Ranking Task: Data, Models and Evaluation Metrics", Journal of Artificial Intelligence Research, Volume 47, pages 853-899 http://www.jair.org/papers/paper3994.html

[2] Oriol Vinyals, Alexander Toshev, Samy Bengio, Dumitru Erhan Show and Tell: A Neural Image Caption Generator

[3] CS231n Winter 2016 Lesson 10 Recurrent Neural Networks, Image Captioning and LSTM https://youtu.be/cO0a0QYmFm8?t=32m25s

image-captioning's People

Contributors

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

Watchers

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

image-captioning's Issues

Poor performance with time_inceptionV3_1.5987_loss.h5

When i try your weights name 'time_inceptionV3_1.5987_loss.h5', the performance of image-caption model is poor.

Taking the basketball image as a example, the output is as follows:
"""Normal Max search: man ."""

Have you met this problem before?

PS: My keras version is 2.1.2.

============================
I also load this weights on Keras 1.2.2 and Tensorflow 0.12.1, but it failed again. It seems the weights file 'time_inceptionV3_1.5987_loss.h5' is useless.

Garbage output using the given weights

image

@yashk2810 I tried creating an inference pipeline using the weights and the dictionary given in the repo, and got the output as shown in the image above. can you please help me out as to what I can do to fix this??

Weird output, using weights from repo

Hi there,

Thank you so much for the Jupyter version of image captioning!

I wanted to use your pre-trained model to generate captions. So I skipped the parts that you generated weights and loaded the weights in the repository. But the output captions look really weird like this:

2017-12-03 9 12 54

I got a warning about keras merge algorithm:

2017-12-03 9 32 16

does this have to do with the weird output?

I am a beginner in deep learning and I am trying to use captions for any given images for my final project in NLP class. Any suggestions would be welcomed!

Thanks!!!

Flicker 8k Dataset

How do you download the flicker 8k dataset and set those in different folders? Because the link to download the dataset has separate images each

beam search

Hi:
when I use beam search in my seq2seq model, the performence is worse than greedy search, have you ever encountered a similar situation?

Wrong way to persuade readers.

I feel other than trying to tune parameters to train model to get loss of 1.59, you have just named the weight file as 1.59. Its very clear on seeing output template in your ipynb notebook.

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.