Tag images
Project description
img2tags
Tag images by using ONNX Runtime.
The current default model is the converted WD 1.4 ConvNext Tagger V2
on https://huggingface.co/shirayu/img2tags.
It works fine for anime images.
Setup
# For CPU
pip install -U 'img2tags[cpu]'
# For GPU
pip install -U 'img2tags[gpu]'
Run
# Generate .txt file
img2tags -i input_dir
# Generate .json file in another directory with CPU
img2tags --model shirayu/img2tags/SmilingWolf__wd-v1-4-convnext-tagger-v2 \
--batch 4 \
--ext json \
--cpu \
-i input_dir \
-o output_dir
The values of default thresholds are stored in config.json
in each model like this.
You can set values in JSON format like --th {"0": 0.3, "4":0.2, "9":0.3}
.
LICENSE
Apache 2.0
Some codes are based on codes in the following project.
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
img2tags-1.2.0.tar.gz
(9.3 kB
view hashes)
Built Distribution
img2tags-1.2.0-py3-none-any.whl
(10.3 kB
view hashes)