This code can be integrated with an existing project and captioning model can be load using object creation with loading the checkpoint just once.
- Pretrained Model with 5 Million checkpoints.
- Single instance loading.
- Removed Bazel-bin dependenct.
- Fixed vocab and checkpoints errors.
First ensure that you have installed the following required packages:
- Python 3.6 or greater
- TensorFlow Below 2.0(Ideal 1.15) (instructions)
- NumPy (instructions)
- Natural Language Toolkit (NLTK):
- First install NLTK (instructions)
- Then install the NLTK data package "punkt" (instructions)
Step 1: cd im2txt
Step 2: python im2txt.py
Captions for image cycling.jpg:
0) a person riding a bike on a city street (p=0.003317)
1) a man riding a bike down a street . (p=0.000723)
2) a person riding a bike on a street (p=0.000362)
Reference tensorflow model - Tensorflow: Show and Tell
If you find the repository useful, you can Star it as an appreciation.