animetimm / resnet152.dbv4-full

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

Introduction of resnet152.dbv4-full

Model Details of resnet152.dbv4-full

Anime Tagger resnet152.dbv4-full

Model Details
  • Model Type: Multilabel Image classification / feature backbone
  • Model Stats:
    • Params: 83.7M
    • FLOPs / MACs: 67.9G / 33.9G
    • 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.446 / 0.455 / 0.526 / 0.412 0.624 / 0.623 / 0.657 / 0.593 ---
Test 0.448 / 0.456 / 0.526 / 0.413 0.624 / 0.624 / 0.657 / 0.594 0.486 / 0.513 / 0.488
  • 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.35 0.612 / 0.617 / 0.608 0.319 / 0.410 / 0.283 0.364 / 0.379 / 0.381
4 character 1 0.48 0.846 / 0.903 / 0.795 0.813 / 0.855 / 0.781 0.835 / 0.895 / 0.791
9 rating 1 0.38 0.796 / 0.744 / 0.856 0.803 / 0.778 / 0.836 0.806 / 0.778 / 0.839
  • 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/resnet152.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/resnet152.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.5816617608070374,
#  'sensitive': 0.4577067196369171,
#  '1girl': 0.9958261251449585,
#  'solo': 0.9633037447929382,
#  'looking_at_viewer': 0.8500308990478516,
#  'blush': 0.8500121831893921,
#  'smile': 0.9115327596664429,
#  'short_hair': 0.7201621532440186,
#  'shirt': 0.6373851299285889,
#  'long_sleeves': 0.8233276605606079,
#  'holding': 0.718224823474884,
#  'dress': 0.5167701840400696,
#  'closed_mouth': 0.5078815221786499,
#  'purple_eyes': 0.6588500142097473,
#  'upper_body': 0.30264830589294434,
#  'flower': 0.9456981420516968,
#  'braid': 0.9781820774078369,
#  'outdoors': 0.3688752353191376,
#  'red_hair': 0.7415601015090942,
#  'blunt_bangs': 0.4880999028682709,
#  'apron': 0.6254206299781799,
#  'plant': 0.33948495984077454,
#  'blue_flower': 0.9264647364616394,
#  'backlighting': 0.14451347291469574,
#  'crown_braid': 0.8123992681503296,
#  'potted_plant': 0.2292894870042801,
#  'flower_pot': 0.29513847827911377,
#  'wiping_tears': 0.46064630150794983}
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/resnet152.dbv4-full/resolve/main/sample.webp',
    repo_id='animetimm/resnet152.dbv4-full',
    fmt=('general', 'character', 'rating'),
)

print(general)
# {'1girl': 0.9958261251449585,
#  'braid': 0.9781820774078369,
#  'solo': 0.9633036851882935,
#  'flower': 0.9456979632377625,
#  'blue_flower': 0.926464855670929,
#  'smile': 0.9115328788757324,
#  'looking_at_viewer': 0.8500310778617859,
#  'blush': 0.8500126600265503,
#  'long_sleeves': 0.8233274221420288,
#  'crown_braid': 0.8123989105224609,
#  'red_hair': 0.7415597438812256,
#  'short_hair': 0.7201613783836365,
#  'holding': 0.7182247638702393,
#  'purple_eyes': 0.6588503122329712,
#  'shirt': 0.6373854279518127,
#  'apron': 0.6254194974899292,
#  'dress': 0.516771137714386,
#  'closed_mouth': 0.5078825354576111,
#  'blunt_bangs': 0.4881010055541992,
#  'wiping_tears': 0.46064335107803345,
#  'outdoors': 0.36887407302856445,
#  'plant': 0.3394850194454193,
#  'upper_body': 0.3026488721370697,
#  'flower_pot': 0.29513871669769287,
#  'potted_plant': 0.22929036617279053,
#  'backlighting': 0.14451327919960022}
print(character)
# {}
print(rating)
# {'general': 0.5816621780395508, 'sensitive': 0.45770588517189026}

For further information, see documentation of function multilabel_timm_predict .

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

98
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
84
30-day runs

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

More resnet152.dbv4-full license Visit here:

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

resnet152.dbv4-full huggingface.co

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

resnet152.dbv4-full huggingface.co Url

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

animetimm resnet152.dbv4-full online free

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

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

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

resnet152.dbv4-full install

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

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

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

Url of resnet152.dbv4-full

resnet152.dbv4-full huggingface.co Url

Provider of resnet152.dbv4-full huggingface.co

animetimm
ORGANIZATIONS

Other API from animetimm