Instructions to use henriquequeirozcunha/microvit-s2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use henriquequeirozcunha/microvit-s2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="henriquequeirozcunha/microvit-s2", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModelForImageClassification model = AutoModelForImageClassification.from_pretrained("henriquequeirozcunha/microvit-s2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
metadata
license: apache-2.0
tags:
- image-classification
- vision-transformer
- microvit
library_name: transformers
MicroViT-S2
ImageNet-1K pretrained MicroViT-S2 (10.0M params, 74.6% Top-1 accuracy).
Architecture: SHViT (Single-Head Vision Transformer) backbone. Source paper: https://arxiv.org/abs/2502.05800 Official repo: https://github.com/novendrastywn/MicroViT
Usage
from transformers import AutoModelForImageClassification, AutoImageProcessor
# Load ImageNet pretrained (1000 classes)
model = AutoModelForImageClassification.from_pretrained(
"henriquequeirozcunha/microvit-s2",
trust_remote_code=True,
)
# Fine-tune for binary classification
model = AutoModelForImageClassification.from_pretrained(
"henriquequeirozcunha/microvit-s2",
num_labels=2,
ignore_mismatched_sizes=True,
trust_remote_code=True,
)
Preprocessing: 224×224, ImageNet normalization (mean=[0.485,0.456,0.406], std=[0.229,0.224,0.225]).