This tool uses Google's Gemini AI to analyze images and sort them into different folders based on their potential as stock images and their quality.
- Analyzes images using Gemini AI's vision capabilities
- Sorts images into categories:
- High/Low stock image potential
- Good/Bad image quality
- Provides detailed logging of the analysis process
- Handles multiple image formats (PNG, JPG, JPEG, GIF, BMP)
- Install the required dependencies:
pip install -r requirements.txt-
Set up your Gemini API key:
- Get your API key from Google AI Studio (https://makersuite.google.com/app/apikey)
- Set it as an environment variable:
export GEMINI_API_KEY='your-api-key-here'
-
Prepare your images:
- Create an
input_imagesfolder in the same directory as the script - Place all images you want to analyze in this folder
- Create an
- Run the script:
python image_sorter.py- The script will:
- Process all images in the
input_imagesfolder - Create sorted folders under
sorted_images/:high_potential/: Images with high stock photo potentiallow_potential/: Images with low stock photo potentialgood_quality/: Images with good technical qualitybad_quality/: Images with poor technical quality
- Generate a log file (
image_sorter.log) with detailed processing information
- Process all images in the
.
├── input_images/
│ └── (your images here)
├── sorted_images/
│ ├── high_potential/
│ ├── low_potential/
│ ├── good_quality/
│ └── bad_quality/
└── image_sorter.log
- Images are copied (not moved) to their respective folders
- Each image can appear in two folders (one for potential and one for quality)
- Check the log file for detailed processing information and any errors