Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–ΌοΈ Image Caption Generator β€” Deep Learning Image Captioning System

Python 3.10+ PyTorch Transformers Flask License: MIT

An end-to-end deep learning image captioning and storytelling system featuring an interactive parallax web interface, Vision Transformer + GPT-2 encoder-decoder models, multi-style generation (Short, Balanced, Detailed Story), and custom PyTorch training pipelines for the Flickr30k dataset.


🌟 Key Capabilities

1. 🎭 Multi-Style Caption Generation

  • Short: Crisp 8–10 word caption highlighting primary subjects, actions, and objects (ideal for Alt-Text and accessibility).
  • Balanced: Structured multi-sentence paragraph analyzing the setting, atmosphere, color palette, and contextual cues.
  • Detailed Narrative: Creative narrative story exploring emotional depth, environmental background, character motivation, and visual composition.

2. 🧠 Model Architectures & Pipelines

  • Vision Transformer (ViT) & GPT-2: Pre-trained Vision-Encoder-Decoder model with beam search decoding.
  • Dual Visual Feature Fusion (DEFF): Combines global scene context with localized visual embeddings.
  • Story Generator: Fine-tuned Transformer decoder mapping visual cues into multi-paragraph stories.
  • BLEU Evaluation: Automated BLEU-1 through BLEU-4 metrics for evaluation.

3. 🌐 Modern Parallax Web Dashboard

  • Dynamic drag-and-drop image upload.
  • Real-time generation with style toggle buttons.
  • One-click copy, audio playback, and export.

πŸš€ Quick Start Guide

1. Clone the Repository

git clone https://github.com/harshrameshnerkar/Image-Caption-Generator.git
cd Image-Caption-Generator

2. Install Dependencies

pip install -r requirements.txt

3. Run the Web Application

python app.py

(Or double-click start_app.bat on Windows)

Open your browser at http://localhost:5000.


πŸ“‚ Project Structure

Image-Caption-Generator/
β”œβ”€β”€ app.py                      # Main Flask web application entry point
β”œβ”€β”€ start_app.bat               # 1-click Windows launch script
β”œβ”€β”€ requirements.txt            # Project dependencies
β”œβ”€β”€ index.html                  # Showcase and portfolio page
β”œβ”€β”€ README.md                   # Complete documentation
β”‚
β”œβ”€β”€ 🧠 Custom Model Architectures & Training
β”‚   β”œβ”€β”€ model.py                # Visual feature fusion (DEFF) + Transformer Decoder
β”‚   β”œβ”€β”€ story_model.py          # Multi-style story generation model
β”‚   β”œβ”€β”€ dataset.py              # PyTorch Dataset loaders
β”‚   β”œβ”€β”€ train_caption.py        # Caption model training script
β”‚   β”œβ”€β”€ train_story.py          # Story model fine-tuning script
β”‚   β”œβ”€β”€ generate_all_texts.py   # Multi-mode caption generation from checkpoints
β”‚   β”œβ”€β”€ sample_captions.py      # Beam search sample generation
β”‚   β”œβ”€β”€ extract_features.py     # Image feature extraction
β”‚   └── eval_bleu.py            # BLEU evaluation
β”‚
β”œβ”€β”€ πŸ“¦ Model Weights & Tokenizers
β”‚   β”œβ”€β”€ model_weights/          # Keras/PyTorch model weights
β”‚   β”œβ”€β”€ tokenizer/              # Tokenizer vocabulary indices
β”‚   └── storage/                # Feature mappings & vocabulary dictionary
β”‚
β”œβ”€β”€ 🌐 Web Interface Assets
β”‚   β”œβ”€β”€ templates/              # Flask HTML templates
β”‚   └── static/                 # CSS, JavaScript, and UI assets
β”‚
└── πŸ““ Research Notebooks
    β”œβ”€β”€ image caption.ipynb     # Interactive exploration notebook
    └── working_code.ipynb      # Prototype implementation notebook

πŸ› οΈ Technical Requirements

  • Python 3.10+
  • PyTorch >= 2.0.0
  • HuggingFace Transformers >= 4.30.0
  • Flask >= 2.0.0
  • 4 GB RAM minimum (GPU recommended for sub-second inference)

πŸ‘€ Author

Harsh Nerkar


πŸ“„ License

This project is licensed under the MIT License.

About

πŸ–ΌοΈ Deep Learning Image Caption Generator powered by CNN (ResNet50), RNN/LSTM & Vision Transformer (ViT) with multi-style narrative generation and interactive Flask UI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages