基于 Vision Transformer (ViT) 在 Stanford Dogs 数据集上微调的细粒度犬种分类模型
Modellquelle
Quellenauszug
基于 Vision Transformer (ViT) 在 Stanford Dogs 数据集上微调的细粒度犬种分类模型
Quellen
1 QuelleVerifiziert 17. Sept.
Modellartefakte
3 ArtefakteViT-top80.pt
Quellenauszüge
2 Auszügept · 1,13 GB · SHA-256 9641025a0dcc…8fcf · Hugging Face
--- language: zh tags: - image-classification - vit - stanford-dogs - fine-grained - pytorch license: apache-2.0 datasets: - stanford-dogs --- <div align="center"> # 🐕 Stanford Dogs ViT 犬种分类器 基于 **Vision Transformer (ViT)** 在 Stanford Dogs 数据集上微调的细粒度犬种分类模型 [](https://python.org) [](https://pytorch.org) [](LICENSE) </div> --- ## 📦 模型下载 | 模型文件 | 类别数 | 用途 | 说明 | |:---------|:-------|:-----|:-----| | `ViT-full120.pt` | 120 | 🚀 推理部署 | 完整模型,覆盖全部犬种 | | `ViT-top100.pt` | 100 | 📊 评估测试 | 在 Stanford / Atharva 数据集上评估 | | `ViT-top80.pt` | 80 | 🔧 精细调参 | 用于超参数调优实验 | --- ## 🚀 快速开始 ### 使用 ViT-full120.pt 推理 ```python 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}") ``` --- ## 📚 数据集 <table> <tr> <td width="50%"> ### Stanford Dogs - 🌐 [官方主页](http://vision.stanford.edu/aditya86/ImageNetDogs/) - 🏷️ 120 个犬种 - 🖼️ 约 20,580 张图片 - ✅ 主要训练数据集 </td> <td width="50%"> ### Atharva Dog Breeds - 🌐 [GitHub 仓库](https://github.com/atharvataras/dog-breeds-dataset) - 📊 用于模型评估 - 🔬 跨数据集泛化测试 </td> </tr> </table> --- ## ⚙️ 训练细节 | 配置项 | 值 | |:-------|:---| | 基础模型 | ViT (Vision Transformer) | | 任务类型 | 细粒度图像分类 | | 深度学习框架 | PyTorch | | 输入尺寸 | 224 × 224 |
Source context: 0 downloads · 0 likes · Pipeline image-classification · Repo aYuan0/stanford-dog-vit