img2tags
Tag images by using ONNX Runtime. The current default model is SmilingWolf/wd-vit-large-tagger-v3. It works fine for anime images and with batch sizes greater than 1.
Setup
# For CPU
pip install -U 'img2tags[cpu]'
# For GPU
pip install -U 'img2tags[gpu]'
# If you use CUDA 12.2, the following packages may be needed
sudo apt install libcufft10 libcudart11.0
Run
# Generate .txt file
img2tags -i input_dir
# Generate .json file in another directory with CPU
# --offline: Do not fetch model files (You must have downloaded that model)
img2tags --ext json \
--cpu \
-i input_dir \
-o output_dir \
--offline
# Output to a single file (JSONL)
img2tags --ext jsonl \
--cpu \
-i input_dir \
-o output_filename.jsonl \
--offline
# You can use filelist
img2tags --ext jsonl \
--cpu \
-i target_file_list.txt \
-o output_filename.jsonl \
--offline
You can set thresholds 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
Metadata
Release files for img2tags 1.6.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| img2tags-1.6.6.tar.gz | 916.0 kB | Without provenance | Details for img2tags-1.6.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| img2tags-1.6.6-py3-none-any.whl | Python 3 | none | any | Details for img2tags-1.6.6-py3-none-any.whl |
Total release size: 927.9 kB
Security for img2tags 1.6.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.