Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📸 AI Picture Analyzer Studio (Phase 1)

A modern, full-featured Python web application and CLI library for AI multimodal picture analysis, object detection, color extraction, interactive Q&A, and document text reading using the Google Gemini API.


📌 Phase 1 Features (Released)

  • AI Visual Description: Generates detailed narrative breakdowns of images, lighting, scenery, and subjects.
  • Structured Object & Color Badges: Parses main subjects, environment settings, detected items, and color palettes as structured JSON.
  • Interactive Photo Q&A: Ask custom questions about any photo and get instant AI answers.
  • Document & Receipt Reader: Parses text blocks and key-value pairs from receipts or document photos.
  • Streamlit Web Dashboard: Drag-and-drop web app UI running on http://localhost:8501.
  • Modular Python Engine: Clean analyzer.py library that can be imported into any custom Python script.

🔧 v1.0.1 Stability Patch & Fixes

  • Gemini 3.5 Flash Engine: Upgraded default models and fallbacks (gemini-3.5-flash, gemini-3.1-flash-lite) to guarantee active quota availability.
  • Document OCR Schema Compliance: Refactored JSON extraction schema to list[KeyValuePair] to fully comply with Gemini Developer API specs (resolving additionalProperties errors).
  • Streamlit Dynamic Hot-Reloading: Added importlib.reload in app_gui.py for instant code updates without server restart conflicts.

🔮 Future Roadmap (Phase 2 - Upcoming)

  • Multi-image side-by-side comparison
  • Export analysis reports to PDF / CSV
  • Custom prompt templates for specialized domains (real estate, e-commerce)

🚀 Quick Start Guide

1. Installation & Environment Setup

Clone or download this repository, then create a virtual environment:

# Create virtual environment
python -m venv .venv

# Install dependencies
.\.venv\Scripts\python.exe -m pip install google-genai pillow pydantic python-dotenv streamlit

2. Configure API Key

Create a .env file in the project root directory:

GEMINI_API_KEY=your_gemini_api_key_here

(Get a free API key from Google AI Studio)


💻 How to Run

Launch the Visual Web App (Streamlit)

.\.venv\Scripts\python.exe -m streamlit run app_gui.py

Open browser at: http://localhost:8501

Run Command Line Interface (CLI)

# Describe an image
.\.venv\Scripts\python.exe main.py --image sample_image.jpg --task describe

# Ask a custom question
.\.venv\Scripts\python.exe main.py --image sample_image.jpg --task ask --prompt "What colors are present?"

# Extract structured JSON
.\.venv\Scripts\python.exe main.py --image sample_image.jpg --task extract

📁 Project Architecture

  • app_gui.py: Interactive Streamlit Web Application
  • analyzer.py: Core Gemini API vision engine module
  • main.py: Command Line Interface (CLI) runner
  • my_app.py: Custom test script template
  • requirements.txt: Python dependency list

📄 License

Licensed under the Apache 2.0 License.

About

AI Multimodal Picture Analysis web app using Python, Streamlit, and Gemini API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages