It generates captions according to the given images. For example:
app.py
Main code to run to create the servergenerate_captions.py
Python module that compiles the AI model and makes predictions.embedding_matrix.pkl
Matrix for the word embeddings of the vocabulary.train_descriptions.pkl
Dictionary to map image names to the captions for training data.word_to_index.pkl
Dictionary to map words in the vocabulary to their index numbers.index_to_word.pkl
Dictionary to map index number to their words in the vocabulary.results
Contains samples of results on testing.static
Stores images input by the user while generating captions.templates
Contains the<index.html>
to generate the UI.preparing_data.ipynb
Jupyter Notebook to prepare the data for training.training_model.ipynb
Jupyter Notebook to train the model.generate_captions.ipynb
Jupyter Notebook to import all the essentials and generate the captions.model_weights
Folder that contains the models number 28-40 generated in 40 epochs during the training. (Model below 28 were useless).
glove.6B.50d.txt
Text file to contain mapping of words to their corresponding 50-dimensional vector. (Link:https://drive.google.com/open?id=1mqHRTOyF87fHoiuRZwOlgcYwcCynQ5Ki
encoding_train_features.pkl
Dictionary to map training images to their corresponding 2048 dimensional vector. (Link:https://drive.google.com/open?id=1qO4fgm8qUu0eIslMpg6oqqmcZil5qs9k
flickr30k_images
Training images and their captions. (Link:https://www.kaggle.com/hsankesara/flickr-image-dataset
)
-
Make the environment.
python -m venv captioner
For any other name:python -m venv <name>
-
Activate the environment.
source captioner/bin/activate
For any other name:source <name>/bin/activate
-
Clone the repository.
git clone https://github.com/parask11/image-captioner.git
-
Go in the directory.
cd image-captioner
-
Install requirements.
pip install -r requirements.txt
Run the python script.
python app.py
It will start a server.
Open the link from the browser.
localhost:5000
The UI will appear. Upload images and generate the captions!