AITAG AutomaticTitleTagger is a PyQt5-based desktop application for processing images, analyzing their content, and managing metadata. It provides a user-friendly interface for configuring settings, selecting directories, and executing image processing tasks.
The application integrates with OpenAI's GPT-4 model to analyze images and generate titles, keywords, and categories. It offers features such as recursive directory processing, file renaming, and metadata updating for JPEG images.
App/
: Contains the main application logic and view modelsViewModel/
: View model classes for different componentsapp_launcher.py
: Entry point for launching the application
Data/
: Manages configuration and environment settingsconfig.json
: Application configuration fileenv_manager.py
: Handles environment variables and API keysjson_manager.py
: Manages JSON data storage and retrieval
Logic/
: Core image processing and analysis functionalityworker/
: Background processing workerfile_manager.py
: File operations and CSV creationgpt4o_mini.py
: Integration with OpenAI's GPT-4 for image analysisimage_processor.py
: Main image processing logicmetadata_manager.py
: Updates image metadata
View/
: User interface componentsLeftPanel/
: Left panel widgets and componentsconfiguration_window/
: Configuration window and related viewstitulador_app.py
: Main application window
test/
: Unit tests for various componentsmain.py
: Application entry point
- Ensure you have Python 3.10+ installed.
- Clone the repository:
git clone https://github.com/AuYahyire/AutomaticTitleTagger cd AutomaticTitleTagger
- Install required dependencies:
pip install -r requirements.txt
Execute the following command in the project root:
python main.py
- Set up your OpenAI API key:
- Open configuration and add your API key.
- This will create an .env file to store locally your API.
-
Configure allowed file extensions selecting those you want to process.
-
Add platform name (ex. AnyImageStock) and optionally system and user prompts, to give detailed instructions to the AI
- Select the image directory using the "Explore" button.
- Choose the platform (created before) from the dropdown menu.
- Click "Run Titulador" to start processing images.
- Monitor progress in the left panel.
- A CSV will be created where the images are located, if recursive, CSV's will be in each folder with images on it.
- If the application fails to start, ensure all dependencies are installed correctly.
- Check the console output for any error messages. (Status bar is not yet implemented)
- Verify that the OpenAI API key is set correctly in the
.env
file. - If image processing fails, ensure the selected directory contains supported image formats.
The Titulador application processes image data through the following steps:
- User selects an image directory and platform through the UI.
- The application scans the directory for supported image files.
- Each image is processed by the
ImageProcessor
:- Image is resized and encoded.
- GPT-4 analyzes the image using the
ImageAnalyzer
. - File is renamed based on the analysis.
- Metadata is updated for JPEG files.
- Progress is reported back to the UI.
- Results are saved in a CSV file.
[User Input] -> [UI] -> [ImageProcessor] -> [ImageAnalyzer (GPT-4)] -> [Metadata Update] -> [CSV Output]
^ |
| |
+------------------------------------------------------------+
Progress Updates