/Image-Caption-Generator

Giving short discription of Image using AI

Primary LanguagePython

Image-Caption-Generator


Description

This repository contains files related to my project on Image Caption Generation.


Dataset

  1. Flickr30k Dataset has been used for the training of model. Flickr30K
  2. Glove6B dataset Link

Reference Paper


Requirements

  • Python 3.5
  • Matplotlib
  • Pandas
  • Numpy
  • PIL
  • Tkinter
  • keras
  • tensorflow

Project Structure


├── beamsearch.py
├── clean_captions.py
├── Dataset
├── Glove
│   └── glove.6B.300d.txt
├── GreedyCaption.py
├── gui.py
├── gui_sub.py
├── gui_sub.py
├── ImageFeature_extraction.py
├── images
│   ├── 101654506_8eb26cfb60.jpg
│   ├── 102455176_5f8ead62d5.jpg
│   ├── 106490881_5a2dd9b7bd.jpg
│   ├── 10815824_2997e03d76.jpg
│   ├── 20190908_182047.jpeg
│   ├── 20190908_185519.jpeg
│   ├── 47870024_73a4481f7d.jpg
│   ├── 56494233_1824005879.jpg
│   └── pic.jpeg
├── index.jpeg
├── model_weights
│   └── FinalModel.h5
├── Preprocessed Data
│   ├── clean_captions.pkl
│   ├── Image_features.pkl
│   └── vocabulary.pkl
├── requirements.txt
├── training.py
└── vocabulary.py

Model flow Chart


```

Run Model in steps


Image Feature Extraction

$ python3 ImageFeature_extraction.py

Caption Preprocessing step

$ python3 clean_captions.py

Generating Vocabulary of Caption words

$ python3 vocabulary.py

Training of the Model

$ python3 training.py

Test model

$ python3 gui.py

this gui is made using python Tkinter package 

Testing The Model


model can be tested using below command after clonning the repository

$ python3 gui.py

Test Results

When you run the gui.py using above command it will show you welcome screen and will ask you to choose the image from your local directory.
alt text
Here you can choose the Algorithm which you want to use to predict/generate a caption for chosen image.
Here, some glimpses of Best results which i have got during testing.
alt text alt text alt text alt text alt text alt text