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

Uploaded Source

Built Distribution

img2tags-1.6.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for img2tags-1.6.5.tar.gz
Algorithm Hash digest
SHA256 8d271986633f9b0185780c3509de0ec27d354ae1ffabc9de411bd505321f073d
MD5 4f4fe8efac7c2eec3dd707c05ae9f42a
BLAKE2b-256 a69a416fb02d50ccb78debf006ad44757909d0b599cdde30cd63ce2ba07c4280

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for img2tags-1.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 1b4a39e2c203e4b37b4c5e2646d9c35f818d068224fc04cb2e99fbb51fe718bb
MD5 148f8279c48b5abb4335b2f0c4dae5b9
BLAKE2b-256 5981f8599825f6ef8748f43b788c71ec1c5d8770c329db3afba12120f773a502

See more details on using hashes here.

Supported by

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