aYuan0/stanford-dog-vit

Model

0

stars

6

commits

2

linked in READMEs

Jun 13, 2026

updated

fine-grained
image-classification
pytorch
stanford-dogs
vit

README

🐕 Stanford Dogs ViT 犬种分类器

基于 Vision Transformer (ViT) 在 Stanford Dogs 数据集上微调的细粒度犬种分类模型

Python PyTorch License


📦 模型下载

模型文件类别数用途说明
ViT-full120.pt120🚀 推理部署完整模型,覆盖全部犬种
ViT-top100.pt100📊 评估测试在 Stanford / Atharva 数据集上评估
ViT-top80.pt80🔧 精细调参用于超参数调优实验

🚀 快速开始

使用 ViT-full120.pt 推理

import torch
from torchvision import transforms
from PIL import Image

# 1. 加载模型
model = torch.load("ViT-full120.pt")
model.eval()

# 2. 图像预处理
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]
    ),
])

# 3. 推理
image = Image.open("dog.jpg").convert("RGB")
input_tensor = transform(image).unsqueeze(0)

with torch.no_grad():
    output = model(input_tensor)
    predicted_class = output.argmax(dim=1).item()
    print(f"预测类别: {predicted_class}")

📚 数据集

Stanford Dogs

  • 🌐 官方主页
  • 🏷️ 120 个犬种
  • 🖼️ 约 20,580 张图片
  • ✅ 主要训练数据集

Atharva Dog Breeds

  • 🌐 GitHub 仓库
  • 📊 用于模型评估
  • 🔬 跨数据集泛化测试

⚙️ 训练细节

配置项
基础模型ViT (Vision Transformer)
任务类型细粒度图像分类
深度学习框架PyTorch
输入尺寸224 × 224

Contributors

aYuan0

6 commits

aYuan0/stanford-dog-vit

Model

0

stars

6

commits

2

linked in READMEs

Jun 13, 2026

updated

fine-grained
image-classification
pytorch
stanford-dogs
vit

README

🐕 Stanford Dogs ViT 犬种分类器

基于 Vision Transformer (ViT) 在 Stanford Dogs 数据集上微调的细粒度犬种分类模型

Python PyTorch License


📦 模型下载

模型文件类别数用途说明
ViT-full120.pt120🚀 推理部署完整模型,覆盖全部犬种
ViT-top100.pt100📊 评估测试在 Stanford / Atharva 数据集上评估
ViT-top80.pt80🔧 精细调参用于超参数调优实验

🚀 快速开始

使用 ViT-full120.pt 推理

import torch
from torchvision import transforms
from PIL import Image

# 1. 加载模型
model = torch.load("ViT-full120.pt")
model.eval()

# 2. 图像预处理
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]
    ),
])

# 3. 推理
image = Image.open("dog.jpg").convert("RGB")
input_tensor = transform(image).unsqueeze(0)

with torch.no_grad():
    output = model(input_tensor)
    predicted_class = output.argmax(dim=1).item()
    print(f"预测类别: {predicted_class}")

📚 数据集

Stanford Dogs

  • 🌐 官方主页
  • 🏷️ 120 个犬种
  • 🖼️ 约 20,580 张图片
  • ✅ 主要训练数据集

Atharva Dog Breeds

  • 🌐 GitHub 仓库
  • 📊 用于模型评估
  • 🔬 跨数据集泛化测试

⚙️ 训练细节

配置项
基础模型ViT (Vision Transformer)
任务类型细粒度图像分类
深度学习框架PyTorch
输入尺寸224 × 224

Contributors

aYuan0

6 commits