animetimm / resnet50.dbv4-full

huggingface.co
Total runs: 1
24-hour runs: 0
7-day runs: 1
30-day runs: 1
Model's Last Updated: September 18 2025
image-classification

Introduction of resnet50.dbv4-full

Model Details of resnet50.dbv4-full

Anime Tagger resnet50.dbv4-full

Model Details
  • Model Type: Multilabel Image classification / feature backbone
  • Model Stats:
    • Params: 49.1M
    • FLOPs / MACs: 24.2G / 12.0G
    • Image size: train = 384 x 384, test = 384 x 384
  • Dataset: animetimm/danbooru-wdtagger-v4-w640-ws-full
    • Tags Count: 12476
      • General (#0) Tags Count: 9225
      • Character (#4) Tags Count: 3247
      • Rating (#9) Tags Count: 4
Results
# [email protected] (F1/MCC/P/R) [email protected] (F1/MCC/P/R) Macro@Best (F1/P/R)
Validation 0.381 / 0.390 / 0.455 / 0.354 0.571 / 0.572 / 0.619 / 0.531 ---
Test 0.382 / 0.390 / 0.453 / 0.355 0.572 / 0.572 / 0.619 / 0.531 0.421 / 0.459 / 0.417
  • Macro/[email protected] means the metrics on the threshold 0.40.
  • Macro@Best means the mean metrics on the tag-level thresholds on each tags, which should have the best F1 scores.
Thresholds
Category Name Alpha Threshold Micro@Thr (F1/P/R) [email protected] (F1/P/R) Macro@Best (F1/P/R)
0 general 1 0.34 0.560 / 0.568 / 0.553 0.259 / 0.346 / 0.229 0.302 / 0.324 / 0.316
4 character 1 0.53 0.771 / 0.850 / 0.705 0.729 / 0.757 / 0.713 0.761 / 0.844 / 0.703
9 rating 1 0.37 0.771 / 0.707 / 0.847 0.771 / 0.737 / 0.814 0.776 / 0.733 / 0.828
  • Micro@Thr means the metrics on the category-level suggested thresholds, which are listed in the table above.
  • [email protected] means the metrics on the threshold 0.40.
  • Macro@Best means the metrics on the tag-level thresholds on each tags, which should have the best F1 scores.

For tag-level thresholds, you can find them in selected_tags.csv .

How to Use

We provided a sample image for our code samples, you can find it here .

Use TIMM And Torch

Install dghs-imgutils , timm and other necessary requirements with the following command

pip install 'dghs-imgutils>=0.17.0' torch huggingface_hub timm pillow pandas

After that you can load this model with timm library, and use it for train, validation and test, with the following code

import json

import pandas as pd
import torch
from huggingface_hub import hf_hub_download
from imgutils.data import load_image
from imgutils.preprocess import create_torchvision_transforms
from timm import create_model

repo_id = 'animetimm/resnet50.dbv4-full'
model = create_model(f'hf-hub:{repo_id}', pretrained=True)
model.eval()

with open(hf_hub_download(repo_id=repo_id, repo_type='model', filename='preprocess.json'), 'r') as f:
    preprocessor = create_torchvision_transforms(json.load(f)['test'])
# Compose(
#     PadToSize(size=(512, 512), interpolation=bilinear, background_color=white)
#     Resize(size=384, interpolation=bicubic, max_size=None, antialias=True)
#     CenterCrop(size=[384, 384])
#     MaybeToTensor()
#     Normalize(mean=tensor([0.4850, 0.4560, 0.4060]), std=tensor([0.2290, 0.2240, 0.2250]))
# )

image = load_image('https://huggingface.co/animetimm/resnet50.dbv4-full/resolve/main/sample.webp')
input_ = preprocessor(image).unsqueeze(0)
# input_, shape: torch.Size([1, 3, 384, 384]), dtype: torch.float32
with torch.no_grad():
    output = model(input_)
    prediction = torch.sigmoid(output)[0]
# output, shape: torch.Size([1, 12476]), dtype: torch.float32
# prediction, shape: torch.Size([12476]), dtype: torch.float32

df_tags = pd.read_csv(
    hf_hub_download(repo_id=repo_id, repo_type='model', filename='selected_tags.csv'),
    keep_default_na=False
)
tags = df_tags['name']
mask = prediction.numpy() >= df_tags['best_threshold']
print(dict(zip(tags[mask].tolist(), prediction[mask].tolist())))
# {'general': 0.5370448231697083,
#  'sensitive': 0.5612526535987854,
#  '1girl': 0.9936023354530334,
#  'solo': 0.9687943458557129,
#  'looking_at_viewer': 0.8054888248443604,
#  'blush': 0.8791486620903015,
#  'smile': 0.9070301055908203,
#  'short_hair': 0.5844995975494385,
#  'shirt': 0.5785101056098938,
#  'long_sleeves': 0.7823494076728821,
#  'brown_hair': 0.6176166534423828,
#  'holding': 0.48595649003982544,
#  'dress': 0.47572940587997437,
#  'closed_mouth': 0.695495069026947,
#  'purple_eyes': 0.8468029499053955,
#  'upper_body': 0.34116852283477783,
#  'flower': 0.8720736503601074,
#  'braid': 0.9343748092651367,
#  'red_hair': 0.4754144549369812,
#  'hand_up': 0.22087764739990234,
#  'blunt_bangs': 0.4347231388092041,
#  'head_tilt': 0.10953768342733383,
#  'light_smile': 0.14430637657642365,
#  'hand_on_own_face': 0.1815531849861145,
#  'blue_flower': 0.8674858212471008,
#  'backlighting': 0.21217873692512512,
#  'crown_braid': 0.8652267456054688,
#  'sidelighting': 0.03551774471998215}
Use ONNX Model For Inference

Install dghs-imgutils with the following command

pip install 'dghs-imgutils>=0.17.0'

Use multilabel_timm_predict function with the following code

from imgutils.generic import multilabel_timm_predict

general, character, rating = multilabel_timm_predict(
    'https://huggingface.co/animetimm/resnet50.dbv4-full/resolve/main/sample.webp',
    repo_id='animetimm/resnet50.dbv4-full',
    fmt=('general', 'character', 'rating'),
)

print(general)
# {'1girl': 0.9936023354530334,
#  'solo': 0.9687943458557129,
#  'braid': 0.934375524520874,
#  'smile': 0.9070303440093994,
#  'blush': 0.8791487216949463,
#  'flower': 0.8720738291740417,
#  'blue_flower': 0.8674856424331665,
#  'crown_braid': 0.8652300834655762,
#  'purple_eyes': 0.846802830696106,
#  'looking_at_viewer': 0.805489182472229,
#  'long_sleeves': 0.7823495864868164,
#  'closed_mouth': 0.695495069026947,
#  'brown_hair': 0.6176208257675171,
#  'short_hair': 0.5844992399215698,
#  'shirt': 0.5785108208656311,
#  'holding': 0.4859565198421478,
#  'dress': 0.475730299949646,
#  'red_hair': 0.4754115343093872,
#  'blunt_bangs': 0.4347245395183563,
#  'upper_body': 0.34116774797439575,
#  'hand_up': 0.2208779752254486,
#  'backlighting': 0.21217495203018188,
#  'hand_on_own_face': 0.18155241012573242,
#  'light_smile': 0.14430606365203857,
#  'head_tilt': 0.10953804850578308,
#  'sidelighting': 0.03551739454269409}
print(character)
# {}
print(rating)
# {'sensitive': 0.561254620552063, 'general': 0.5370431542396545}

For further information, see documentation of function multilabel_timm_predict .

Runs of animetimm resnet50.dbv4-full on huggingface.co

1
Total runs
0
24-hour runs
0
3-day runs
1
7-day runs
1
30-day runs

More Information About resnet50.dbv4-full huggingface.co Model

More resnet50.dbv4-full license Visit here:

https://choosealicense.com/licenses/gpl-3.0

resnet50.dbv4-full huggingface.co

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

resnet50.dbv4-full huggingface.co Url

https://huggingface.co/animetimm/resnet50.dbv4-full

animetimm resnet50.dbv4-full online free

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

animetimm resnet50.dbv4-full online free url in huggingface.co:

https://huggingface.co/animetimm/resnet50.dbv4-full

resnet50.dbv4-full install

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

resnet50.dbv4-full install url in huggingface.co:

https://huggingface.co/animetimm/resnet50.dbv4-full

Url of resnet50.dbv4-full

resnet50.dbv4-full huggingface.co Url

Provider of resnet50.dbv4-full huggingface.co

animetimm
ORGANIZATIONS

Other API from animetimm