Simple python script to rate image quality and aesthetics using one-align
The unquantized version of this model takes about 16GB of VRAM, luckily, JIT quantization doesn't seem to cause much quality loss.
- 3090 - 4090: Can run full unquantized
- 3080+ : Can run in 8-bit
- 2070+ : Can run in 4-bit
This torch version worked for me with an NVIDIA card. I had issues with the latest version.
pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 xformers --index-url https://download.pytorch.org/whl/cu121 --upgrade
Transformers version 4.36.1 is required.
I recommend setting up a venv
- torch
- transformers==4.36.1
- pil
python inference.py [--db path] [--image path] [--dir path] [--r] [--q4 | --q8]
- --db {path} : Path to an SQLite database file | Optional - To store results
- --image {path} : Path to a single image
- --dir {path} : Path to a folder of images
- --r : Recursively search for images in the directory provided | Optional
- --q4 : Load model with 4-bit quantization (~4GB + PyTorch) | Optional
- --q8 : Load model with 8-bit quantization (~8GB + PyTorch) | Optional
Prints ratings to console as they are generated
Stores ratings in SQLite database if path provided
- Will create new database if one does not exist in that location
Powered by https://github.com/Q-Future/Q-Align