Downloads · 30 days
166
28% of all-time downloads
Mitchins/image-medium-classifier-efficientnetv2-s-v1
image-medium-classifier-efficientnetv2-s-v1 is a image classification model from Mitchins. Use it when you need a label for an image. It is set up for timm. The card lists the license as openrail.
Higher-capacity classifier with improved generalization for anime, photo, and 3D detection.
Downloads · 30 days
166
28% of all-time downloads
All-time downloads
603
Public
Parameters
20.3M
81.4 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors81.4 MB · 100%
From the Hugging Face model README
Higher-capacity classifier with improved generalization for anime, photo, and 3D detection.
| Class | Precision | Recall | F1-Score |
|---|---|---|---|
| anime | 1.00 | 0.97 | 0.98 |
| real | 0.98 | 0.99 | 0.98 |
| rendered | 0.93 | 0.90 | 0.91 |
| macro avg | 0.97 | 0.95 | 0.96 |
| Metric | B0 | V2-S | Winner |
|---|---|---|---|
| Final Accuracy | 97.44% | 97.55% | V2-S +0.11% |
| Best Accuracy | 97.99% | 97.99% | Tied |
| Params | 5.3M | 21.5M | B0 (lighter) |
| Speed | 1 min/epoch | 3 min/epoch | B0 (faster) |
| Convergence | Epoch 4 | Epoch 13 | B0 (faster) |
Verdict: V2-S learns training data better with marginally improved generalization. Use B0 for speed, V2-S for accuracy.
from PIL import Image
import torch
from torchvision import transforms
import timm
from safetensors.torch import load_file
# Load model
model = timm.create_model('tf_efficientnetv2_s', num_classes=3, pretrained=False)
state_dict = load_file('model.safetensors')
model.load_state_dict(state_dict)
model.eval()
# Prepare image
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]),
])
image = Image.open('image.jpg').convert('RGB')
x = transform(image).unsqueeze(0)
# Predict
with torch.no_grad():
logits = model(x)
probs = torch.softmax(logits, dim=1)
pred_class = probs.argmax(dim=1).item()
labels = ['anime', 'real', 'rendered']
print(f"{labels[pred_class]}: {probs[0, pred_class]:.2%}")
OpenRAIL - Free for research and educational purposes