Skip to content

ish-codes-magic/GPT_art_critique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Art Critique GPT

A professional art analysis tool powered by GPT-4 Vision that provides comprehensive critiques of artworks across all media types.

Features

  • Structured Analysis: Get detailed critiques with formal analysis, interpretation, context, and scoring
  • Professional UI: Clean Streamlit interface with well-organized sections
  • Type-Safe: Uses Pydantic models with instructor for structured output
  • Flexible Prompting: Jinja2 templates for customizable prompts
  • Comprehensive Scoring: Detailed scores across multiple criteria with explanations

Installation

Make sure you have uv installed, then install the dependencies:

uv pip install -r requirements.txt

Usage

Running the Streamlit App

streamlit run app.py

Then:

  1. Upload an artwork image in the sidebar
  2. Enter your OpenAI API key
  3. Click "Analyze Artwork" to get a comprehensive critique

Features of the Analysis

The app provides:

  • Overview: Initial impressions and summary
  • Formal Analysis: Composition, color, technique, and texture analysis
  • Interpretation: Emotional impact, conceptual depth, and artistic intention
  • Context: Historical and cultural context with comparisons
  • Feedback: Strengths, areas for improvement, and practical suggestions
  • Scoring: Detailed scores (1-10) across multiple criteria

API Usage

You can also use the analysis function directly:

from PIL import Image
from image_analyser_gpt.ask_gpt import analyze_artwork

# Load your image
image = Image.open("artwork.jpg")

# Analyze the artwork
critique = analyze_artwork(image, "your-openai-api-key")

# Access structured data
print(f"Overall Score: {critique.scores.overall_score.score}/10")
print(f"Overview: {critique.overview}")

Project Structure

GPT_art_critique/
├── app.py                          # Main Streamlit application
├── image_analyser_gpt/
│   ├── __init__.py
│   ├── ask_gpt.py                 # GPT interaction with instructor
│   ├── models.py                  # Pydantic models for structured output
│   └── utils.py                   # Utility functions
├── image_analyser_prompt.j2       # Jinja2 template for the prompt
├── requirements.txt
└── README.md

Supported Formats

  • Images: PNG, JPG, JPEG, GIF, BMP
  • Art Types: Paintings, sculptures, digital art, mixed media, installations, performance documentation

Requirements

  • Python 3.8+
  • OpenAI API key with GPT-4 Vision access
  • See requirements.txt for all dependencies

Configuration

The app uses the image_analyser_prompt.j2 template for generating prompts. You can customize this template to adjust the analysis criteria or output format.

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published