ImageTagMan is a Python-based tool for automatically tagging images in MacOS using the OpenAI Vision API. It processes images in a specified directory, retrieves existing tags, and sets new tags if none exist.
This defaults to using gpt-4o-mini which, according to their pricing,is $0.15/Million tokens and using the low-quality vision API uses 85 tokens per image return. You still pay for upload tokens so doing several thousand images is a like $5.
You will need an OpenAI API key to use imgtagman.
.jpg, .jpeg, .png, .gif, .bmp, .tiff, .webpmdls commandxattrClone the repository:
git clone https://github.com/joeldg/imgtagman.git
cd imgtagman
Install:
python setup.py sdist bdist_wheel && pip install .
Set the necessary environment variables:
OPENAI_API_KEY: Your OpenAI API key
export OPENAI_API_KEY=\{key from openai\}
—-OPTIONAL—-
IMAGE_DIRECTORY: Path to the directory containing images (default: current directory)DETAIL_LEVEL: Level of detail for tags (low or high, default: low)Run the script using Python:
imgtagman --help
usage: imgtagman [-h] {tag,remove-tags,summary} ...
Image Tag Management Tool
positional arguments:
{tag,remove-tags,summary}
Available commands
tag Tag images in the directory
remove-tags Remove tags from images
summary Summarize image tags
options:
-h, --help show this help message and exit
You can configure the tool by setting environment variables:
low or high).Example:
export IMAGE_DIRECTORY=/path/to/images
export DETAIL_LEVEL=high
python imgtag.py
https://joeldg.github.io/imgtagman/
This project is licensed under the MIT License.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.