Giter Site home page Giter Site logo

im2txt's Introduction

Show and Tell: A Neural Image Caption Generator*

Rewritten version of tensorflow/models/im2txt

A TensorFlow implementation* of the image-to-text model described in the paper:

"Show and Tell: Lessons learned from the 2015 MSCOCO Image Captioning Challenge."

Oriol Vinyals, Alexander Toshev, Samy Bengio, Dumitru Erhan.

IEEE transactions on pattern analysis and machine intelligence (2016).

Full text available at: http://arxiv.org/abs/1609.06647

*Some key elements was changed:

Advantages

  • CNN removed from training loop (train is ~150 times faster)
  • Less memory needed for same batch
  • Model written with tf.estimator.Estimator and tf.dataset.Dataset

Disadvantages

  • Model spited in 2 parts
  • CNN removed from training loop (paper's finetun not possible, CNN is not trainable)

Preprocessing

python3 preprocess.py

Training

150 epoch training will take 8h with 1024 bath on GTX1080

python3 im2txt.py train --optimizer Adagrad  --initial_learning_rate 4 --num_epochs_per_decay 20  --batch_size 1024 --max_train_epochs 150 --save_checkpoints_steps 1000 --log_step_count_steps 500

For other options call

python3 im2txt.py --help

Train loss Train loss

Evaluation

python3 im2txt.py eval

For other options call

python3 im2txt.py --help

Testing

Test last model (just past output in Markdown editor)

python3 im2txt.py test --test_urls https://cdn132.picsart.com/245236991011202.jpg,https://cdn141.picsart.com/245236965014202.jpg

force run on CPU

CUDA_VISIBLE_DEVICES=""; python3 im2txt.py test ...
python3 im2txt.py 

<S> a woman in a dress standing on a street corner . </S> (-11.629340171813965)

<S> a man sitting on a bench in a room . </S> (-8.756865501403809)

im2txt's People

Contributors

agasy18 avatar

Watchers

James Cloos avatar

Forkers

nixworks

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.