Downloads · 30 days
0
Alamgirapi/dog-breed-convnext-classifier
dog-breed-convnext-classifier is a image classification model from Alamgirapi. Use it when you need a label for an image. It is set up for timm. The card lists the license as mit.
This model is a fine-tuned ConvNeXt-Base model for classifying dog breeds among 7 different classes.
Downloads · 30 days
0
Access
Public
Updated Aug 19, 2025
Repo size
350 MB
Likes
0
Public
Click a slice to open those files.
.pth350 MB · 100%
From the Hugging Face model README
This model is a fine-tuned ConvNeXt-Base model for classifying dog breeds among 7 different classes.
The model can classify the following dog breeds:
import torch
import timm
from torchvision import transforms
from PIL import Image
# Load model
model = timm.create_model('convnext_base', pretrained=False)
model.head = torch.nn.Sequential(
torch.nn.AdaptiveAvgPool2d(1),
torch.nn.Flatten(),
torch.nn.Linear(model.head.in_features, 7)
)
# Load weights
model.load_state_dict(torch.load('model.pth', map_location='cpu'))
model.eval()
# Preprocessing
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
# Inference
image = Image.open('dog_image.jpg')
input_tensor = transform(image).unsqueeze(0)
with torch.no_grad():
outputs = model(input_tensor)
probabilities = torch.nn.functional.softmax(outputs[0], dim=0)
If you use this model, please cite:
@misc{dog-breed-convnext-2024,
title={Dog Breed Classification with ConvNeXt},
author={Alamgirapi},
year={2024},
howpublished={\url{https://huggingface.co/Alamgirapi/dog-breed-convnext-classifier}}
}