Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

# πŸ–ΌοΈ AI-Powered Image Caption Generator ✨
This is a full-stack **AI Caption Generator** that automatically recognizes the content of an uploaded image and returns **short, fancy social media captions**.
It uses **BLIP (Salesforce)** for image understanding and **LLaMA 3 (via Groq)** for generating enhanced, catchy captions. The frontend is built with **HTML, CSS, and JavaScript**, and the backend is powered by **Flask**.
---
## πŸš€ Features
- 🧠 **BLIP Model** for intelligent image captioning
- ✨ **Fancy Caption Generation** with LLaMA 3 via Groq
- πŸ“· Simple drag-and-drop image upload
- 🌍 Frontend built with HTML, CSS, and JavaScript
- πŸ” Secure API integration using environment variables
- 🌐 CORS-enabled backend
---
## 🎯 Use Case
Perfect for:
- Social media content creators
- Marketing agencies
- Travel/lifestyle bloggers
- Memers and content designers
---
## 🧠 How It Works
1. πŸ“€ User uploads an image through the web UI.
2. πŸ€– Flask backend uses the **BLIP model** to generate a base caption.
3. πŸ§‘β€πŸ’» That caption is passed to **LLaMA 3 (Groq API)** to return **5 short & catchy captions**.
4. πŸ” The fancy caption is returned and shown on the frontend.
---
## πŸ› οΈ Tech Stack
### Backend
- Python
- Flask
- BLIP (`Salesforce/blip-image-captioning-base`)
- Groq API with LLaMA 3
- Pillow (Image processing)
### Frontend
- HTML
- CSS
- JavaScript (AJAX + Fetch API)
---
## πŸ“¦ Installation
### πŸ”§ Backend Setup
1. **Clone the repository**
 ```bash
 git clone https://github.com/yourusername/ai-caption-generator.git
 cd ai-caption-generator
  1. Create virtual environment and activate

    python -m venv venv
    source venv/bin/activate # For Windows: venv\Scripts\activate
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up .env file

    GROQ_API_KEY=your_groq_api_key_here
    
  4. Run the Flask server

    python app.py

🌐 Frontend Setup

  1. Navigate to the /frontend folder.
  2. Open index.html in a browser or serve it using a live server.
  3. Upload an image and get your caption!

πŸ“ Project Structure

ai-caption-generator/
β”œβ”€β”€ app.py # Flask backend
β”œβ”€β”€ .env # Groq API key
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ frontend/
β”‚ β”œβ”€β”€ index.html # Main frontend file
β”‚ β”œβ”€β”€ styles.css # CSS styles
β”‚ └── script.js # JavaScript to call Flask API
└── README.md # Project documentation

πŸ“· Example

Input Image: A person standing on a mountain at sunset πŸŒ„

Generated Captions:

1. Chasing horizons β˜€οΈ
2. Sunset vibes only πŸŒ„
3. Peaks and peace 🏞️
4. Golden hour goals ✨
5. On top of the world 🌍

πŸ” Security Note

Never expose your .env file or API keys in public repositories. Add .env to .gitignore.


πŸ“¬ Contact

Built by [Your Name] πŸ“§ labibalif2001@gmail.com πŸ”— LinkedIn


πŸ“œ License

This project is licensed under the MIT License.

About

This is 'AI Caption Generator' that automatically recognizes the content of an uploaded image and returns short, fancy social media captions.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /