Downloads · 30 days
8
29% of all-time downloads
kunhsiang/NYCU_ML_2025_ImageClassification_ConvNeXtV2_Large
NYCU_ML_2025_ImageClassification_ConvNeXtV2_Large is a image classification model from kunhsiang. Use it when you need a label for an image. The card lists the license as mit.
This is a convnextv2large.fcmaeftin22kin1k (2023 - 原始選項/慢, timm) model fine-tuned for Simpsons character classification.
Downloads · 30 days
8
29% of all-time downloads
All-time downloads
28
Public
Repo size
786 MB
Likes
0
Public
Click a slice to open those files.
.pth786 MB · 100%
From the Hugging Face model README
This is a convnextv2_large.fcmae_ft_in22k_in1k (2023 - 原始選項/慢, timm) model fine-tuned for Simpsons character classification.
| Parameter | Value |
|---|---|
| Image Resolution | 256 |
| Batch Size | 80 |
| Learning Rate | 0.0001 |
| Optimizer | AdamW |
| Weight Decay | 0.01 |
| Scheduler | CosineAnnealingLR |
| Label Smoothing | 0.1 |
| Epochs | 15 |
| CutMix | False |
| HEM-TA | False |
abraham_grampa_simpson, agnes_skinner, apu_nahasapeemapetilon, barney_gumble, bart_simpson, brandine_spuckler, carl_carlson, charles_montgomery_burns, chief_wiggum, cletus_spuckler, comic_book_guy, disco_stu, dolph_starbeam, duff_man, edna_krabappel, fat_tony, gary_chalmers, gil, groundskeeper_willie, homer_simpson...
import torch
import timm
from PIL import Image
from torchvision import transforms
# Load model
model = timm.create_model('convnextv2_large.fcmae_ft_in22k_in1k',
pretrained=False,
num_classes=50)
model.load_state_dict(torch.load('pytorch_model.pth', map_location='cpu'))
model.eval()
# Preprocess
transform = transforms.Compose([
transforms.Resize(294),
transforms.CenterCrop(256),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
# Predict
img = Image.open('your_image.jpg').convert('RGB')
input_tensor = transform(img).unsqueeze(0)
with torch.no_grad():
output = model(input_tensor)
pred = output.argmax(dim=1).item()
MIT License