Files
pytorch-tutorial/tutorials/09 - Image Captioning
2017-05-26 14:02:27 +09:00
..
2017-05-26 14:02:27 +09:00
2017-04-13 19:51:14 +09:00
2017-04-14 09:39:54 +09:00
2017-04-13 19:49:10 +09:00
2017-04-13 19:49:10 +09:00
2017-05-24 08:27:32 -07:00
2017-04-13 19:49:10 +09:00
2017-04-13 19:51:14 +09:00
2017-04-13 19:49:10 +09:00
2017-05-11 11:11:45 +08:00

Usage

1. Clone the repositories

$ git clone https://github.com/pdollar/coco.git
$ cd coco/PythonAPI/
$ make
$ python setup.py build
$ python setup.py install
$ cd ../../
$ git clone https://github.com/yunjey/pytorch-tutorial.git
$ cd pytorch-tutorial/tutorials/09\ -\ Image\ Captioning

2. Download the dataset

$ pip install -r requirements.txt
$ chmod +x download.sh
$ ./download.sh

3. Preprocessing

$ python build_vocab.py   
$ python resize.py

4. Train the model

$ python train.py    

5. Generate captions

$ python sample.py --image='path_for_image'

Pretrained model

If you do not want to train the model yourself, you can use a pretrained model. I have provided the pretrained model as a zip file. You can download the file here and extract it to ./models/ directory.