SmilingWolf
commited on
Commit
•
ae469aa
1
Parent(s):
3eded29
Add model files
Browse files- README.md +40 -3
- config.json +40 -0
- gitattributes +35 -0
- model.msgpack +3 -0
- model.onnx +3 -0
- model.safetensors +3 -0
- selected_tags.csv +0 -0
- sw_jax_cv_config.json +15 -0
README.md
CHANGED
@@ -1,3 +1,40 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
library_name: timm
|
4 |
+
---
|
5 |
+
# WD ViT-Large Tagger v3
|
6 |
+
|
7 |
+
Supports ratings, characters and general tags.
|
8 |
+
|
9 |
+
Trained using https://github.com/SmilingWolf/JAX-CV.
|
10 |
+
TPUs used for training kindly provided by the [TRC program](https://sites.research.google/trc/about/).
|
11 |
+
|
12 |
+
## Dataset
|
13 |
+
Last image id: 7220105
|
14 |
+
Trained on Danbooru images with IDs modulo 0000-0899.
|
15 |
+
Validated on images with IDs modulo 0950-0999.
|
16 |
+
Images with less than 10 general tags were filtered out.
|
17 |
+
Tags with less than 600 images were filtered out.
|
18 |
+
|
19 |
+
## Validation results
|
20 |
+
`v1.0: P=R: threshold = 0.2606, F1 = 0.4674`
|
21 |
+
|
22 |
+
## What's new
|
23 |
+
Model v1.0/Dataset v3:
|
24 |
+
More training images, more and up-to-date tags (up to 2024-02-28).
|
25 |
+
Now `timm` compatible! Load it up and give it a spin using the canonical one-liner!
|
26 |
+
ONNX model is compatible with code developed for the v2 series of models.
|
27 |
+
The batch dimension of the ONNX model is not fixed to 1 anymore. Now you can go crazy with batch inference.
|
28 |
+
Switched to Macro-F1 to measure model performance since it gives me a better gauge of overall training progress.
|
29 |
+
|
30 |
+
# Runtime deps
|
31 |
+
ONNX model requires `onnxruntime >= 1.17.0`
|
32 |
+
|
33 |
+
# Inference code examples
|
34 |
+
For timm: https://github.com/neggles/wdv3-timm
|
35 |
+
For ONNX: https://huggingface.co/spaces/SmilingWolf/wd-tagger
|
36 |
+
For JAX: https://github.com/SmilingWolf/wdv3-jax
|
37 |
+
|
38 |
+
## Final words
|
39 |
+
Subject to change and updates.
|
40 |
+
Downstream users are encouraged to use tagged releases rather than relying on the head of the repo.
|
config.json
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architecture": "vit_large_patch16_224",
|
3 |
+
"num_classes": 10861,
|
4 |
+
"num_features": 1024,
|
5 |
+
"global_pool": "avg",
|
6 |
+
"model_args": {
|
7 |
+
"img_size": 448,
|
8 |
+
"class_token": false,
|
9 |
+
"global_pool": "avg",
|
10 |
+
"fc_norm": false,
|
11 |
+
"act_layer": "gelu_tanh",
|
12 |
+
"patch_size": 14
|
13 |
+
},
|
14 |
+
"pretrained_cfg": {
|
15 |
+
"custom_load": false,
|
16 |
+
"input_size": [
|
17 |
+
3,
|
18 |
+
448,
|
19 |
+
448
|
20 |
+
],
|
21 |
+
"fixed_input_size": false,
|
22 |
+
"interpolation": "bicubic",
|
23 |
+
"crop_pct": 1.0,
|
24 |
+
"crop_mode": "center",
|
25 |
+
"mean": [
|
26 |
+
0.5,
|
27 |
+
0.5,
|
28 |
+
0.5
|
29 |
+
],
|
30 |
+
"std": [
|
31 |
+
0.5,
|
32 |
+
0.5,
|
33 |
+
0.5
|
34 |
+
],
|
35 |
+
"num_classes": 10861,
|
36 |
+
"pool_size": null,
|
37 |
+
"first_conv": null,
|
38 |
+
"classifier": null
|
39 |
+
}
|
40 |
+
}
|
gitattributes
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:74851bf4f613c41102d0ac6b87e915eb192504287bc01fb916977e05f6209c76
|
3 |
+
size 1260393134
|
model.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e4c8001b000a6c98f2db10794f7c406daa79873d071d6ca924330fa053fa1845
|
3 |
+
size 1260645673
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fbfaf059bc61a0af74cea0e590c5533d01956f50adf293436783a241d7964bbb
|
3 |
+
size 1260410716
|
selected_tags.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
sw_jax_cv_config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"image_size": 448,
|
3 |
+
"model_name": "vit_large",
|
4 |
+
"model_args": {
|
5 |
+
"patch_size": 14,
|
6 |
+
"num_classes": 10861,
|
7 |
+
"num_layers": 24,
|
8 |
+
"embed_dim": 1024,
|
9 |
+
"mlp_dim": 4096,
|
10 |
+
"num_heads": 16,
|
11 |
+
"drop_path_rate": 0.1,
|
12 |
+
"norm_layer": "reparam_layernorm",
|
13 |
+
"layer_norm_eps": 1e-05
|
14 |
+
}
|
15 |
+
}
|