This is a fork of https://github.com/Linaqruf/cafe-aesthetic-scorer
It adds a simple way of using the tool, as well as preview the results.
The tool is meant to rate the image aesthetically, as well as provide some other metadata based on the type of image it is.
Set up a virtual environment to run the script. Feel free to run the setup.bat
to automatically set one up.
Install the requirements pip install -r requirements.txt
. This is optionally done by the setup script.
Install the correct version of pytorch for your CUDA. It's usually:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
or
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
- Place the images or folders of images in the /input/ directory.
- Run
1-rate.bat
to rate the images with the system.
You can now view the images and their rating as a website:
- Run
2-view.bat
to launch the server and website.
On the website, you can expand the arrow below the title to show the options.
- From the options, you can set the gallery column count, width and sorting options.
- You can also play with the filter/pruning settings. Use > or < and integers as % to set the filter values
Example: Aesthetics >50 will keep only images that are rated at 0.5 or higher in aesthetics
- By pressing the
Prune
-button, the pruning script will move any currently hidden images to apruned
directory, along with a json containing the pruned images data.
You can also do this by running the
3-prune.bat
script. This will use thepruneconfig.ini
as the pruning settings.
Alternatively:
- Place the images or folders of images in the /input/ directory.
- Activate your environment and run
rate.py
. - (Optional) Launch a web server:
python -m http.server 8000
and openhttp://localhost:8000/index.html
in your web browser. - Edit
pruneconfig.ini
with your pruning preferences (using < and > and full integers as %-values). - Run
prune.py
.
- The realistic value isn't properly being sorted with the drop-down menu (therefore commented out)