Skip to main content

img2tags

PyPI version Python Versions License Downloads

CI Typos

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)

Source distribution for img2tags 1.6.6
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)

Table of built distributions (wheels) for img2tags 1.6.6
File Interpreter ABI Platform Actions
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

Release files / img2tags-1.6.6.tar.gz

Download URL img2tags-1.6.6.tar.gz
Size 916.0 kB
Tags Source
SHA-256 checksum
How to use checksums
84e0685d3b3e6242acc1d64e9dc990cdfced3b0924b0f1d97bccc3a6729b37f8
BLAKE2b-256 checksum
How to use checksums
e4d1f0ece11e09e8d2b5a9517c04b5a9d78677966a3d693b41648d059fc2c8f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / img2tags-1.6.6-py3-none-any.whl

Download URL img2tags-1.6.6-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4588d30ef66400403435206a050ce73fe7d1e24e84d718ef0c2d7a88c6b1989
BLAKE2b-256 checksum
How to use checksums
76b4c5adb210593729eb975719927383826871d5c08ec5566d95e314da5805a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page