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.
- 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.pylibrary that can be imported into any custom Python script.
- 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 (resolvingadditionalPropertieserrors). - Streamlit Dynamic Hot-Reloading: Added
importlib.reloadinapp_gui.pyfor instant code updates without server restart conflicts.
- Multi-image side-by-side comparison
- Export analysis reports to PDF / CSV
- Custom prompt templates for specialized domains (real estate, e-commerce)
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 streamlitCreate 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)
.\.venv\Scripts\python.exe -m streamlit run app_gui.pyOpen browser at: http://localhost:8501
# 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 extractapp_gui.py: Interactive Streamlit Web Applicationanalyzer.py: Core Gemini API vision engine modulemain.py: Command Line Interface (CLI) runnermy_app.py: Custom test script templaterequirements.txt: Python dependency list
Licensed under the Apache 2.0 License.