Instructions to use shaanzeeeee/vit_base_patch16_pc_parts_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- fastai
How to use shaanzeeeee/vit_base_patch16_pc_parts_classifier with fastai:
from huggingface_hub import from_pretrained_fastai learn = from_pretrained_fastai("shaanzeeeee/vit_base_patch16_pc_parts_classifier") - timm
How to use shaanzeeeee/vit_base_patch16_pc_parts_classifier with timm:
import timm model = timm.create_model("hf_hub:shaanzeeeee/vit_base_patch16_pc_parts_classifier", pretrained=True) - Notebooks
- Google Colab
- Kaggle
vit_base_patch16_pc_parts_classifier
Vision Transformer image classifier for 11 PC component and cable-management classes.
Model Details
- Architecture: ViT-Base Patch16 224 (
vit_base_patch16_224) - Framework: FastAI + timm + PyTorch
- Input size: 224x224 RGB
- Classes: 11
- Epochs: 15
- Batch size: 16
- Test accuracy: 0.7389
- Training date: 2026-04-17
Labels
- AIO_Liquid_Cooler
- Air_Cooler
- Bad_Cable_Management
- CPU
- Good_Cable_Management
- Graphics_Card
- M2_NVMe_Drive
- Motherboard
- PC_Case
- Power_Supply
- RAM_Stick
Files
best_model_export.pkl: FastAI export for direct inference.best_model_state_dict.pth: PyTorch state dict.best_model_metadata.json: Training and class metadata.
Inference (FastAI)
from fastai.learner import load_learner
from pathlib import Path
learn = load_learner("best_model_export.pkl")
pred_class, pred_idx, probs = learn.predict(Path("sample.jpg"))
print(pred_class)
print({learn.dls.vocab[i]: float(probs[i]) for i in range(len(probs))})
Live Demo
A live inference demo is available on Hugging Face Spaces: