p1atdev / wd-swinv2-tagger-v3-hf

huggingface.co
Total runs: 2.2K
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: March 11 2024
image-classification

Introduction of wd-swinv2-tagger-v3-hf

Model Details of wd-swinv2-tagger-v3-hf

WD SwinV2 Tagger v3 with 🤗 transformers

Converted from SmilingWolf/wd-swinv2-tagger-v3 to transformers library format.

Example

Installation
pip install transformers
Pipeline
from transformers import pipeline

pipe = pipeline(
    "image-classification",
    model="p1atdev/wd-swinv2-tagger-v3-hf",
    trust_remote_code=True,
)

print(pipe("sample.webp", top_k=15))
#[{'label': '1girl', 'score': 0.9973934888839722},
# {'label': 'solo', 'score': 0.9719744324684143},
# {'label': 'dress', 'score': 0.9539461135864258},
# {'label': 'hat', 'score': 0.9511678218841553},
# {'label': 'outdoors', 'score': 0.9438753128051758},
# ...
AutoModel
from PIL import Image

import numpy as np
import torch

from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
)

MODEL_NAME = "p1atdev/wd-swinv2-tagger-v3-hf"

model = AutoModelForImageClassification.from_pretrained(
    MODEL_NAME,
)
processor = AutoImageProcessor.from_pretrained(MODEL_NAME, trust_remote_code=True)

image = Image.open("sample.webp")
inputs = processor.preprocess(image, return_tensors="pt")

with torch.no_grad():
  outputs = model(**inputs.to(model.device, model.dtype))
logits = torch.sigmoid(outputs.logits[0]) # take the first logits

# get probabilities
results = {model.config.id2label[i]: logit.float() for i, logit in enumerate(logits)}
results = {
    k: v for k, v in sorted(results.items(), key=lambda item: item[1], reverse=True) if v > 0.35 # 35% threshold
}
print(results)  # rating tags and character tags are also included
#{'1girl': tensor(0.9974),
# 'solo': tensor(0.9720),
# 'dress': tensor(0.9539),
# 'hat': tensor(0.9512),
# 'outdoors': tensor(0.9439),
# ...
Accelerate with 🤗 Optimum

Maybe about 30% faster and about 50% light weight model size than transformers version, but the accuracy is slightly degraded.

pip install optimum[onnxruntime] 
-from transformers import pipeline
+from optimum.pipelines import pipeline

pipe = pipeline(
    "image-classification",
    model="p1atdev/wd-swinv2-tagger-v3-hf",
    trust_remote_code=True,
)

print(pipe("sample.webp", top_k=15))
#[{'label': '1girl', 'score': 0.9966088533401489},
# {'label': 'solo', 'score': 0.9740601778030396},
# {'label': 'dress', 'score': 0.9618403911590576},
# {'label': 'hat', 'score': 0.9563733339309692},
# {'label': 'outdoors', 'score': 0.945336639881134},
# ...
Labels

All of rating tags have prefix rating: and character tags have prefix character: .

  • Rating tags: rating:general , rating:sensitive , ...
  • Character tags: character:frieren , character:hatsune miku , ...

Runs of p1atdev wd-swinv2-tagger-v3-hf on huggingface.co

2.2K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About wd-swinv2-tagger-v3-hf huggingface.co Model

More wd-swinv2-tagger-v3-hf license Visit here:

https://choosealicense.com/licenses/apache-2.0

wd-swinv2-tagger-v3-hf huggingface.co

wd-swinv2-tagger-v3-hf huggingface.co is an AI model on huggingface.co that provides wd-swinv2-tagger-v3-hf's model effect (), which can be used instantly with this p1atdev wd-swinv2-tagger-v3-hf model. huggingface.co supports a free trial of the wd-swinv2-tagger-v3-hf model, and also provides paid use of the wd-swinv2-tagger-v3-hf. Support call wd-swinv2-tagger-v3-hf model through api, including Node.js, Python, http.

wd-swinv2-tagger-v3-hf huggingface.co Url

https://huggingface.co/p1atdev/wd-swinv2-tagger-v3-hf

p1atdev wd-swinv2-tagger-v3-hf online free

wd-swinv2-tagger-v3-hf huggingface.co is an online trial and call api platform, which integrates wd-swinv2-tagger-v3-hf's modeling effects, including api services, and provides a free online trial of wd-swinv2-tagger-v3-hf, you can try wd-swinv2-tagger-v3-hf online for free by clicking the link below.

p1atdev wd-swinv2-tagger-v3-hf online free url in huggingface.co:

https://huggingface.co/p1atdev/wd-swinv2-tagger-v3-hf

wd-swinv2-tagger-v3-hf install

wd-swinv2-tagger-v3-hf is an open source model from GitHub that offers a free installation service, and any user can find wd-swinv2-tagger-v3-hf on GitHub to install. At the same time, huggingface.co provides the effect of wd-swinv2-tagger-v3-hf install, users can directly use wd-swinv2-tagger-v3-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

wd-swinv2-tagger-v3-hf install url in huggingface.co:

https://huggingface.co/p1atdev/wd-swinv2-tagger-v3-hf

Url of wd-swinv2-tagger-v3-hf

wd-swinv2-tagger-v3-hf huggingface.co Url

Provider of wd-swinv2-tagger-v3-hf huggingface.co

p1atdev
ORGANIZATIONS

Other API from p1atdev

huggingface.co

Total runs: 9.7K
Run Growth: 8.4K
Growth Rate: 87.11%
Updated:February 28 2023
huggingface.co

Total runs: 2.6K
Run Growth: 570
Growth Rate: 22.34%
Updated:May 12 2024
huggingface.co

Total runs: 1.0K
Run Growth: -67
Growth Rate: -6.68%
Updated:March 11 2024
huggingface.co

Total runs: 47
Run Growth: 2
Growth Rate: 4.26%
Updated:June 21 2023
huggingface.co

Total runs: 35
Run Growth: 4
Growth Rate: 11.43%
Updated:May 10 2023
huggingface.co

Total runs: 14
Run Growth: 8
Growth Rate: 57.14%
Updated:May 20 2023
huggingface.co

Total runs: 7
Run Growth: 6
Growth Rate: 85.71%
Updated:July 06 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 15 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 16 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 02 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 01 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:July 23 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 28 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:July 01 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 04 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 04 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 23 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 21 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 15 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 25 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:July 09 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 20 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:May 27 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:February 15 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:April 03 2023