Medivision ViT Model

Fine-tuned Vision Transformer for medical image classification.

Model Details

  • Architecture: ViT
  • Framework: PyTorch
  • Input size: 224x224 (example)

Usage

from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch

model_name = "amezghani5/vit"

processor = AutoImageProcessor.from_pretrained(model_name)
model = AutoModelForImageClassification.from_pretrained(
    "amezghani5/vit",
    cache_dir="./models"
)

image = Image.open("test.png")
inputs = processor(images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

predicted_class = outputs.logits.argmax(-1)
print(predicted_class)
Downloads last month
8
Safetensors
Model size
85.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Space using amezghani5/vit 1