--- title: AI Art Historian emoji: 🎨 colorFrom: blue colorTo: purple sdk: gradio sdk_version: 5.33.0 app_file: app.py pinned: true license: mit short_description: Expert AI artwork analysis with historical insights tags: - agent-demo-track --- # 🎨 AI Art Historian **Expert-level artwork analysis powered by Microsoft Phi-3.5-Vision and SmolAgent Framework** ## 🚀 How to use 1. **Upload an artwork** - Supports JPG, PNG and other image formats 2. **Ask questions** (optional) - Get specific analysis on style, symbols, or history 3. **Get expert analysis** - Receive detailed art historical insights in seconds ### Core Components #### 1. **Vision Agent** - Phi-3.5-Vision-Instruct - Converts artwork images to detailed descriptions - Identifies visual elements, colors, composition, style indicators #### 2. **Analysis Agent** - SmolAgent Framework - Processes descriptions using specialized art tools - Multi-step reasoning for comprehensive analysis - Fallback system for reliability ## 🔧 Specialized Tools ### 🎨 Style Detector ```python @tool def art_style_detector(visual_description: str) -> str: """Identifies artistic movements and styles""" ``` **Detects**: Renaissance, Baroque, Impressionism, Expressionism, Cubism, Surrealism, Abstract, Pop Art, Minimalism ### 📚 Historical Context Provider ```python @tool def historical_context_provider(art_period: str) -> str: """Provides historical and cultural context""" ``` **Includes**: Time periods, key artists, cultural influences, movement characteristics ### 🔍 Symbolism Interpreter ```python @tool def symbolism_interpreter(visual_elements: str) -> str: """Decodes symbolic meanings in artwork""" ``` **Analyzes**: Colors (red, blue, gold), Objects (crown, flowers, skull), Religious symbols (cross, dove) ## ⚡ Processing Workflow 1. **Image Analysis**: Phi-3.5-Vision describes artwork details 2. **Agent Reasoning**: SmolAgent processes description using tools: - Style detection from visual cues - Historical context for identified period - Symbol interpretation from elements 3. **Structured Output**: Comprehensive art historical analysis ## 🛡️ Robust Design - **Dual Processing**: Vision model + reasoning agent - **Fallback System**: Direct tool usage if agent fails - **GPU Optimization**: Fast image processing - **Dark Theme**: Eye-friendly interface ## 🙏 Acknowledgements Made with ❤️ by **Gizem Sarsinlar** ([@gizemsarsinlar](https://huggingface.co/gizemsarsinlar)) ## 🎥 Demo Video Watch the full project walkthrough and live demonstration: [![AI Art Historian Demo](https://img.shields.io/badge/▶️-Watch%20Demo-red?style=for-the-badge&logo=youtube)](https://youtu.be/xyNKr05Vvls?si=OmHjtOfBez2FjOTv)