Skip to content

Tufan2416/OptiCaption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖼️ OptiCaption - AI Image Captioning Application

OptiCaption is an AI-powered image captioning application that generates natural language descriptions from uploaded images. Built with Streamlit, Hugging Face Transformers, and Microsoft's Florence-2 vision-language model, the application provides accurate, context-aware captions in real time.

🚀 Features

  • Upload images in multiple formats (JPG, PNG, JPEG, WEBP)
  • Generate AI-powered image captions instantly
  • Clean and interactive Streamlit interface
  • State-of-the-art Vision Language Model (Florence-2)
  • Fast and easy deployment
  • Supports CPU and GPU execution

🛠️ Tech Stack

  • Python
  • Streamlit
  • Hugging Face Transformers
  • PyTorch
  • Pillow
  • Florence-2 Large

📂 Project Structure

OptiCaption/
│
├── app.py
├── requirements.txt
├── README.md
├── .gitignore
├── assets/
└── screenshots/

⚙️ Installation

1. Clone the Repository

git clone https://github.com/your-username/OptiCaption.git
cd OptiCaption

2. Create a Virtual Environment

python -m venv venv

3. Activate Virtual Environment

Windows:

venv\Scripts\activate

Linux/Mac:

source venv/bin/activate

4. Install Dependencies

pip install -r requirements.txt

5. Run the Application

streamlit run app.py

The application will open automatically in your browser.

🎯 How It Works

  1. Upload an image.
  2. The image is processed using the Florence-2 Vision-Language Model.
  3. The model analyzes visual content and context.
  4. A descriptive caption is generated and displayed.

📸 Example

Input: Image of a dog playing with a ball in a park.

Generated Caption:

"A brown dog playing with a red ball on a grassy field."

🔥 Future Improvements

  • Multi-language caption generation
  • Voice narration of captions
  • Image tagging and object detection
  • Caption customization options
  • Cloud deployment with AWS

🤝 Contributing

Contributions are welcome. Feel free to fork the repository and submit pull requests.

📜 License

This project is licensed under the MIT License.

👨‍💻 Author

Tufan Chowdhury

B.Tech CSE Student | Cloud & AI Enthusiast

Connect with me on LinkedIn and GitHub for collaboration and project discussions.

About

OptiCaption is an AI-powered image captioning application built with Streamlit, Hugging Face Transformers, and Microsoft's Florence-2 model. Users can upload images and instantly generate accurate, context-aware captions using state-of-the-art vision-language AI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages