animetimm/e621-wdtagger-v1-w640-ws-full
Updated • 7
How to use xdcx/eva02_large_E621_FULL_V1 with timm:
import timm
model = timm.create_model("hf_hub:xdcx/eva02_large_E621_FULL_V1", pretrained=True)eva02_large_patch14_448.mim_m38m_ft_in22k_in1kanimetimm/e621-wdtagger-v1-w640-ws-full| # | Macro@0.40 (F1/MCC/P/R) | Micro@0.40 (F1/MCC/P/R) | Macro@Best (F1/P/R) |
|---|---|---|---|
| Validation | 0.678 / 0.685 / 0.546 / 0.935 | 0.472 / 0.531 / 0.322 / 0.884 | 0.427 / 0.440 / 0.449 |
| Test | 0.677 / 0.685 / 0.545 / 0.935 | 0.472 / 0.531 / 0.322 / 0.884 | 0.425 / 0.436 / 0.450 |
Full-split evaluation completed on validation/test (185k+ samples each).
| Category | Name | Alpha | Threshold | Micro@Thr (F1/P/R) | Macro@0.40 (F1/P/R) | Macro@Best (F1/P/R) |
|---|---|---|---|---|---|---|
| 0 | general | 1 | 0.60 | 0.631 / 0.684 / 0.585 | 0.263 / 0.177 / 0.568 | 0.352 / 0.358 / 0.386 |
| 4 | character | 1 | 0.65 | 0.895 / 0.941 / 0.853 | 0.715 / 0.598 / 0.922 | 0.872 / 0.906 / 0.847 |
| 5 | species | 1 | 0.60 | 0.836 / 0.848 / 0.824 | 0.544 / 0.421 / 0.825 | 0.712 / 0.761 / 0.682 |
| 9 | rating | 1 | 0.65 | 0.912 / 0.918 / 0.906 | 0.813 / 0.700 / 0.989 | 0.884 / 0.869 / 0.903 |
Micro@Thr uses category-level thresholds from thresholds.json.Macro/Micro@0.40 uses fixed threshold 0.40.Macro@Best uses tag-level best-threshold search on evaluation splits.0.48.selected_tags.csv currently stores category-level thresholds as initial best_threshold; it will be replaced by real tag-level thresholds after full evaluation.Release folder: eva02_large_E621_FULL_V1
eva02_large_E621_FULL_V1/model.onnxeva02_large_E621_FULL_V1/model.onnx.dataeva02_large_E621_FULL_V1/model.safetensorseva02_large_E621_FULL_V1/preprocess.jsoneva02_large_E621_FULL_V1/selected_tags.csveva02_large_E621_FULL_V1/tags.jsoneva02_large_E621_FULL_V1/thresholds.jsoneva02_large_E621_FULL_V1/config.jsonThis repo provides WD14-compatible files at the root. Put these files in the same folder:
model.onnxmodel.onnx.dataselected_tags.csvtags.json (optional helper metadata)thresholds.json (optional helper thresholds)Download with CLI:
hf download nzs234/eva02_large_E621_FULL_V1 model.onnx model.onnx.data selected_tags.csv tags.json thresholds.json --repo-type model --local-dir ./eva02_large_E621_FULL_V1
import json
import numpy as np
import onnxruntime as ort
from PIL import Image
from huggingface_hub import hf_hub_download
repo = "nzs234/eva02_large_E621_FULL_V1"
onnx_path = hf_hub_download(repo_id=repo, filename="model.onnx")
_ = hf_hub_download(repo_id=repo, filename="model.onnx.data")
tags_path = hf_hub_download(repo_id=repo, filename="tags.json")
thr_path = hf_hub_download(repo_id=repo, filename="thresholds.json")
sess = ort.InferenceSession(onnx_path, providers=["CUDAExecutionProvider", "CPUExecutionProvider"])
input_name = sess.get_inputs()[0].name
with open(tags_path, "r", encoding="utf-8") as f:
tags = json.load(f)
# You can preprocess with the same logic described in preprocess.json
img = Image.open("your_image.jpg").convert("RGB").resize((448, 448))
x = np.asarray(img).astype(np.float32) / 255.0
x = np.transpose(x, (2, 0, 1))[None, ...]
pred = sess.run(None, {input_name: x})[0][0]
print("num_tags:", pred.shape[0])
model.safetensors is also provided for PyTorch-side workflows and conversion pipelines.
If you use stable-diffusion-webui-wd14-tagger, put files under a model folder, for example:
stable-diffusion-webui/extensions/stable-diffusion-webui-wd14-tagger/models/eva02_large_E621_FULL_V1/
model.onnx
model.onnx.data
selected_tags.csv
tags.json
thresholds.json
Then select eva02_large_E621_FULL_V1 in the extension model dropdown.
Notes:
selected_tags.csv is required by most WD14-style UIs.tags.json and thresholds.json are optional for plain WD14 UI, but useful for custom tools.model.onnx and model.onnx.data in the same folder.animetimm/swinv2_base_window8_256.e621v1-fullPlease follow upstream dataset and base-model licenses. Repo license is currently set to MIT.