Skip to main content

No project description provided

Project description

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

Project details


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.6.6.tar.gz (916.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

img2tags-1.6.6-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file img2tags-1.6.6.tar.gz.

File metadata

  • Download URL: img2tags-1.6.6.tar.gz
  • Upload date:
  • Size: 916.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for img2tags-1.6.6.tar.gz
Algorithm Hash digest
SHA256 84e0685d3b3e6242acc1d64e9dc990cdfced3b0924b0f1d97bccc3a6729b37f8
MD5 1d052e68d4427f0de4e628011ea9ba77
BLAKE2b-256 e4d1f0ece11e09e8d2b5a9517c04b5a9d78677966a3d693b41648d059fc2c8f9

See more details on using hashes here.

File details

Details for the file img2tags-1.6.6-py3-none-any.whl.

File metadata

  • Download URL: img2tags-1.6.6-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for img2tags-1.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b4588d30ef66400403435206a050ce73fe7d1e24e84d718ef0c2d7a88c6b1989
MD5 24101a7cfa4ad4f91fcceea6f4ee0931
BLAKE2b-256 76b4c5adb210593729eb975719927383826871d5c08ec5566d95e314da5805a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page