WD Tagger v3
SmilingWolf's WD v3 taggers: tag anime-style images with 10 861 Danbooru tags (general, character, rating), on ViT, ConvNeXt and EVA-02 backbones. Apache-2.0 weights.
stable Fork of huggingface/pytorch-image-models@0df212b · backends: portable, kernels
- Paper WD ViT Tagger v3 Model card · first released 4 Mar 2024
Paper 2024 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install "fastforks-core[timm]"
from fastforks import classification
model = classification.load("wd-vit-tagger-v3") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.logits
result.backend # what ran: mode, device, dtype, kernels fastforks bench wd-vit-tagger-v3 Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 448x448
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 19.0 | 0.30× | 426 MiB/442 MiB | 2.5 | 0.24 |
| Original fp16.half() on 1 modules, fp16 inputs | fp16 | 5.78 | – | 231 MiB/242 MiB | 2.3 | 0.32 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 4.01 | 1.4× | 235 MiB/242 MiB | 2.3 | 0.09 |
| Kernels | fp16 | 4.06 | 1.4× | 234 MiB/284 MiB | 2.5 | 0.06 |
| Portable + torch.compile | 5.33 | 1.1× | 282 MiB/302 MiB | 10 (build) | – | |
| TensorRT fp16 | fp16 | 3.32 | 1.7× | 204 MiBenginenot comparable | 19 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-13 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 59.6 | 2,463 MiB process | – | 448x448 |
| Portable | fp16 | 52.5 | 2,438 MiB process | matches | 448x448 | |
| Portable | fp32 | 58.9 | 2,438 MiB process | matches | 448x448 | |
| Kernels | fp16 | not implemented | – | 448x448 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0
- Weights
- Apache-2.0 source
- Training data
Our reading of the licences, not legal advice.
Weights
wd-vit-tagger-v3.safetensors 378 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download wd-vit-tagger-v3).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
ImageNet-1k val
5000 random images, top-1 / top-5 %
| Run | dtype | top-1 % ↑ | top-5 % ↑ | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 0.08 | 0.36 | 5000 | 16.7 |
| Portable | not measured | ||||
| Kernels | not measured | ||||
The original code was not run on this dataset, so the table cannot show the distance to it.
fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6f0a70e1, 2026-11-17.
COCO val2017 (first 500 images)
tag F1 at 0.35 vs the original fp32 / top-1 agreement %
| Run | dtype | tag_f1 ↑ | top1_agree ↑ | Δ tag_f1 vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 100.00 | 100.00 | reference | 500 | 19.2 |
| Original fp16 | fp16 | 99.95 | 99.80 | −0.05 | 500 | 5.86 |
| Portable fp32 | not measured | |||||
| Portable | fp16 | 99.91 | 99.80 | −0.09 | 500 | 3.97 |
| Kernels | fp16 | 99.90 | 99.20 | −0.10 | 500 | 4.07 |
fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Taggers have no public benchmark with their tag set, so the original fp32 is the reference: tag F1 = F1 of the tags at probability 0.35 of our output against the tags of the original fp32, micro-averaged over the images; top-1 agreement = share of images with the same most likely tag. The original fp16 row shows the difference of the original itself in half precision. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-16; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 33b2432c, 2026-11-16.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 1.5e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.015 and p99 <= 0.052 (absolute error of the output logits).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.000015 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.015 | 0.00717 |
| GPU default dtypes, p99 |diff| | ≤ 0.052 | 0.02504 |
Recorded for wd-vit-tagger-v3 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13, with these kernels: cudnn_haccfvm_convfvm_extrafvm_mbfvm_r3
Details
SmilingWolf's WD v3 anime image taggers: timm ViT / ConvNeXt / EVA-02 trained on Danbooru, 10 861 tags (multi-label).
- Input / output
- Input: one RGB image. Output: ImageNet-1k class logits.
- Input size
- fixed 448x448: the input is resized (short side 448) and centre-cropped to it; tested up to 448x448 (248 MiB allocated)
- Outputs
logits- Checkpoint
arch="vit_base_patch16_224",model_args="{'img_size': 448, 'class_token': False, 'global_pool': 'avg', 'fc_norm': False, 'act_layer': 'gelu_tanh'}"- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)fvm_convfused convolutions for image classifiersfvm_extrafused transformer row operations (rotary split, SwiGLU with LayerNorm)fvm_mbfused MBConv blocks (MobileNet and EfficientNet families)fvm_r3further fused classifier blocks
- Apple (MPS)
- fp32, fp16
Limitations
- An image with an alpha channel is not composited on white first, as the reference script does: pass RGB.
- Kernels allocate as much as portable (673 vs 669 MB) but reserve 806 vs 684 MB (graph / kernel workspace blocks); both are below the float32 original (1299 / 1324 MB).
Full reference, generated from the repository
SmilingWolf's WD v3 taggers: tag anime-style images with 10 861 Danbooru tags (general, character, rating), on ViT, ConvNeXt and EVA-02 backbones. Apache-2.0 weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
wd-vit-tagger-v3 | synthetic (448x448) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 19.0 5.78 4.01 4.06 5.33 3.32 | 426 / 442 231 / 242 235 / 242 234 / 284 282 / 302 421 / 446 |
wd-convnext-tagger-v3 | synthetic (448x448) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 15.3 9.60 5.59 4.46 4.45 3.10 | 481 / 516 259 / 292 260 / 292 238 / 276 380 / 392 521 / 548 |
wd-vit-large-tagger-v3 | synthetic (448x448) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 76.8 19.9 12.9 12.6 13.3 11.2 | 1287 / 1302 662 / 682 669 / 682 667 / 724 713 / 742 1266 / 1290 |
wd-eva02-large-tagger-v3 | synthetic (448x448) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 84.4 26.6 18.3 14.1 15.7 12.4 | 1299 / 1324 668 / 684 669 / 684 673 / 806 714 / 724 1280 / 1306 |
Details
- Original code: https://github.com/huggingface/pytorch-image-models at
0df212b369a5 - Code licence: Apache-2.0 (permissive); files:
- Weights licence: Apache-2.0
- Licence evidence: https://huggingface.co/SmilingWolf/wd-vit-tagger-v3/blob/7f6b584d0bd3f55c4531f14ba3d4761b2bccdc0f/README.md
- Training data: Danbooru (anime illustrations with community tags; WD taggers: image ids up to 7 220 105)
- Kernel libraries:
cudnn_hacc,fvm_conv,fvm_extra,fvm_mb,fvm_r3 - Variants:
wd-vit-tagger-v3,wd-convnext-tagger-v3,wd-vit-large-tagger-v3,wd-eva02-large-tagger-v3 - Outputs: logits; label_set:
wd-tagger-v3; probs:sigmoid - Input size: fixed 448x448: the input is resized (short side 448) and centre-cropped to it
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
wd-vit-tagger-v3448x448 (0.2 GiB peak allocated, 0.3 reserved);wd-convnext-tagger-v3448x448 (0.3 GiB peak allocated, 0.4 reserved);wd-vit-large-tagger-v3448x448 (0.7 GiB peak allocated, 0.7 reserved);wd-eva02-large-tagger-v3448x448 (0.7 GiB peak allocated, 0.9 reserved) wd-vit-tagger-v3448x448, first call: portable + torch.compile 10 s (cold Inductor cache), TensorRT fp16 19 s (ONNX + engine).wd-convnext-tagger-v3448x448, first call: portable + torch.compile 12 s (cold Inductor cache), TensorRT fp16 40 s (ONNX + engine).wd-vit-large-tagger-v3448x448, first call: portable + torch.compile 14 s (cold Inductor cache), TensorRT fp16 36 s (ONNX + engine).wd-eva02-large-tagger-v3448x448, first call: portable + torch.compile 22 s (cold Inductor cache), TensorRT fp16 40 s (ONNX + engine).wd-vit-tagger-v3original 448x448: .half() on 1 modules, fp16 inputswd-convnext-tagger-v3original 448x448: .half() on 1 modules, fp16 inputswd-vit-large-tagger-v3original 448x448: .half() on 1 modules, fp16 inputswd-eva02-large-tagger-v3original 448x448: .half() on 1 modules, fp16 inputswd-vit-tagger-v3load / first call: original 2.33 s / 0.318 s (448x448), portable 2.25 s / 0.088 s (448x448), kernels 2.47 s / 0.06 s (448x448)wd-convnext-tagger-v3load / first call: original 2.92 s / 0.484 s (448x448), portable 2.34 s / 0.236 s (448x448), kernels 2.5 s / 0.066 s (448x448)wd-vit-large-tagger-v3load / first call: original 4.74 s / 0.439 s (448x448), portable 5.56 s / 0.108 s (448x448), kernels 4.5 s / 0.07 s (448x448)wd-eva02-large-tagger-v3load / first call: original 4.82 s / 0.352 s (448x448), portable 4.58 s / 0.147 s (448x448), kernels 4.22 s / 0.079 s (448x448)- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Taggers have no public benchmark with their tag set, so the original fp32 is the reference: tag F1 = F1 of the tags at probability 0.35 of our output against the tags of the original fp32, micro-averaged over the images; top-1 agreement = share of images with the same most likely tag. The original fp16 row shows the difference of the original itself in half precision. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|---|
wd-vit-tagger-v3 | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 0.08 / 0.36 | |||||
wd-vit-tagger-v3 | COCO val2017 (first 500 images), tag F1 at 0.35 vs the original fp32 / top-1 agreement % | 100.00 / 100.00 | 99.95 / 99.80 | 99.91 / 99.80 | 99.90 / 99.20 | ||
wd-convnext-tagger-v3 | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 0.10 / 0.40 | |||||
wd-convnext-tagger-v3 | COCO val2017 (first 500 images), tag F1 at 0.35 vs the original fp32 / top-1 agreement % | 100.00 / 100.00 | 99.92 / 99.80 | 99.90 / 99.60 | 99.88 / 99.80 | ||
wd-vit-large-tagger-v3 | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 0.06 / 0.34 | |||||
wd-vit-large-tagger-v3 | COCO val2017 (first 500 images), tag F1 at 0.35 vs the original fp32 / top-1 agreement % | 100.00 / 100.00 | 99.93 / 99.80 | 99.87 / 99.40 | 99.88 / 99.80 | ||
wd-eva02-large-tagger-v3 | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 0.08 / 0.36 | |||||
wd-eva02-large-tagger-v3 | COCO val2017 (first 500 images), tag F1 at 0.35 vs the original fp32 / top-1 agreement % | 100.00 / 100.00 | 99.93 / 99.80 | 99.84 / 99.80 | 99.84 / 99.40 |
Measured on portable: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 33b2432c, 2026-11-16; portable32: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 6f0a70e1, 2026-11-17; kernels: NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 33b2432c, 2026-11-16.
Parity
CPU, float32: max |diff| <= 1.5e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.015 and p99 <= 0.052 (absolute error of the output logits).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
wd-vit-tagger-v3 | 0.00717 / 0.02504 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
wd-convnext-tagger-v3 | 0.01015 / 0.0344 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
wd-vit-large-tagger-v3 | 0.00643 / 0.02243 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
wd-eva02-large-tagger-v3 | 0.00947 / 0.03264 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
Limitations
- An image with an alpha channel is not composited on white first, as the reference script does: pass RGB.
- Kernels allocate as much as portable (673 vs 669 MB) but reserve 806 vs 684 MB (graph / kernel workspace blocks); both are below the float32 original (1299 / 1324 MB).
Example output
One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).
Top 5
Input: Chelsea the cat, Stéfan van der Walt (CC0).