Hello! Have you ever needed to sort and classify a folder full of anime pictures but felt too lazy to do it manually because you have thousands of images? I made this small script to help you out.
You can specify an input folder full of images (JPG, JPEG, PNG, TIF) and select a booru tag for the character along with some trait tags.
For example:
character: tamamo_(fate)
traits: fox_ears, pink_hair, animal_ear_fluff.
Then, select an input folder and an output folder.
With just one click, all the images will be copied and sorted into folders:
one for images with all the tags.
one for images with 2 or more tags.
individual folders single tag images.
finally one for images that don’t contain any of the specified tags.
In the "all_tags" folder, you will find almost 100% accurate images of the character you want. The other folders will contain images that are less and less likely to match what you're looking for.
Making it much faster to classify your gallery!
You don't need to specify a character; just a main tag and secondary tags, so it's a general classifier for you to use.
Additionally, there is a simple inference button to analyze an image and obtain its booru tags.
The threshold at the top left is for inference and classification, so you can adjust it for better performance.
I hope this helps you, and I'm looking forward to your feedback!
how to install:
You need to have python and pip installed
create a venv:
$ python -m venv dicEnv
activate the Venv:
$ cd dicEnv\Scripts
$ activate
return to root folder:
$ cd..
$ cd..
install dependencies:
$ pip install tensorflow
$ pip install tensorflow-io
$ pip install deepdanbooru
$ pip install gradio
Run the python script:
$ python DIC.py