anuragmishracse / caption_generator

A modular library built on top of Keras and TensorFlow to generate a caption in natural language for any input image.
MIT License
265 stars 120 forks source link

Generating Captions on non-Flickr8k images #16

Closed crowoy closed 6 years ago

crowoy commented 6 years ago

How do you go about generating captions on images of your choice?

The testing code seems to reply on the pre-generated encoded_images.py file, which only contains encodings for Flickr8k images in this case. The prepare_dataset.py file does not seem easy to adapt to encode images of your choice into encoded_images.py.

Any help would be appreciated.

anuragmishracse commented 6 years ago

@crowoy You have functions for that. In the prepare_dataset.py, you can use the functions load_encoding_model() and get_encoding(model, image_path) to get the encoded vector of an image. Once you have the vector, just tweak the test_model.py or use function in it to get the predictions for the image.