Image caption generator using Chainer

Requirement

Usage

Download dataset

  1. Download flickr8k.zip, flickr30k.zip, or coco.zip from: http://cs.stanford.edu/people/karpathy/deepimagesent/
  2. Extract downloaded zip file, and you'll get dataset.json and vgg_feats.mat.

Convert dataset

$ python src/convert_dataset.py dataset.json dataset.pkl

Parameters:

Train dataset

$ python src/train.py -g 0 -s dataset.pkl -i vgg_feats.mat -o model/caption_gen

Options:

Convert VGG 19-layer caffemodel to pkl file

$ python src/convert_caffemodel_to_pkl.py VGG_ILSVRC_19_layers.caffemodel vgg19.pkl

Parameters:

Generate image caption

$ python src/generate_caption.py -s dataset.pkl -i vgg19.pkl -m model/caption_gen_0010.model -l image/list.txt

Options:

Image path list file sample

image/asakusa.jpg
image/tree.jpg

License

MIT License