Skip to main content

A simple and easy-to-use wrapper for the tagger model created by [SmilingWolf](https://github.com/SmilingWolf) which is specifically designed for tagging anime illustrations.

Project description

wdtagger

CodeTime Badge

wdtagger is a simple and easy-to-use wrapper for the tagger model created by SmilingWolf which is specifically designed for tagging anime illustrations.

Installation

You can install wdtagger via pip:

pip install wdtagger

Usage

Below is a basic example of how to use wdtagger in your project:

from PIL import Image
from wdtagger import Tagger

tagger = Tagger() # You can provide the model_repo, the default is "SmilingWolf/wd-swinv2-tagger-v3"
image = Image.open("image.jpg")
result = tagger.tag(image)
print(result)

You can input a image list to the tagger to use batch processing, it is faster than single image processing (test on RTX 3090):

---------------------------------------------------------------------------------- benchmark 'tagger': 5 tests -----------------------------------------------------------------------------------
Name (time in ms)                  Min                 Max                Mean             StdDev              Median                IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_tagger_benchmark[16]     540.8711 (1.0)      598.5156 (1.04)     558.2777 (1.0)      22.2954 (4.10)     549.9650 (1.0)      21.7318 (2.51)          2;2  1.7912 (1.0)          10           1
test_tagger_benchmark[8]      558.9445 (1.03)     576.7220 (1.0)      567.9235 (1.02)      5.4381 (1.0)      568.7336 (1.03)      8.6569 (1.0)           2;0  1.7608 (0.98)         10           1
test_tagger_benchmark[4]      590.6479 (1.09)     626.7126 (1.09)     597.9712 (1.07)     11.0124 (2.03)     594.5067 (1.08)     10.7656 (1.24)          1;1  1.6723 (0.93)         10           1
test_tagger_benchmark[2]      622.8689 (1.15)     643.5122 (1.12)     630.1096 (1.13)      7.2365 (1.33)     627.1716 (1.14)      9.5823 (1.11)          3;0  1.5870 (0.89)         10           1
test_tagger_benchmark[1]      700.6986 (1.30)     816.3089 (1.42)     721.7431 (1.29)     33.9031 (6.23)     712.6850 (1.30)     12.8756 (1.49)          1;1  1.3855 (0.77)         10           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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

wdtagger-0.14.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

wdtagger-0.14.0-py3-none-any.whl (142.5 kB view details)

Uploaded Python 3

File details

Details for the file wdtagger-0.14.0.tar.gz.

File metadata

  • Download URL: wdtagger-0.14.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for wdtagger-0.14.0.tar.gz
Algorithm Hash digest
SHA256 68e053ae66b641d4295fd1fade2df3a5ab2fc3fb6983a48be098b9c703181109
MD5 8cd7bb3186ff0f3eca50adc5a3d492c6
BLAKE2b-256 b7ef962e4a0128b72604497ef828804750cd3b1bb189cea665458f5e5c78828c

See more details on using hashes here.

File details

Details for the file wdtagger-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: wdtagger-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 142.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for wdtagger-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5367269ea0ff63862c6f2279882eee4acd31b728ff83b43fcf5466eb2e03b27f
MD5 c9074230fa46404412aa9e7e684c9bbc
BLAKE2b-256 aeccb565f7febd38f3635a58411d6e498ef6ad9b118bd86481749e3d19ede11c

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