Model Details

This model uses the Vision Transformer (ViT) architecture for classifying traffic signs from the German Traffic Sign Recognition Benchmark (GTSRB). It provides a robust solution for image classification tasks, specifically aimed at recognizing traffic signs across 43 different classes.

Model Description

How to Get Started with the Model

To use the model, follow these steps:

  1. Install the required dependencies:
    pip install transformers torch
    
  2. Load the model and processor:
    from transformers import ViTForImageClassification, ViTImageProcessor
    import torch
    from PIL import Image
    
    processor = ViTImageProcessor.from_pretrained("kelvinandreas/vit-traffic-sign-GTSRB")
    model = ViTForImageClassification.from_pretrained("kelvinandreas/vit-traffic-sign-GTSRB")
    
    # Load and process image
    image = Image.open("path_to_image.jpg")
    inputs = processor(images=image, return_tensors="pt")
    
    # Make prediction
    outputs = model(**inputs)
    logits = outputs.logits
    predicted_class_idx = torch.argmax(logits, dim=-1)
    print(predicted_class_idx)
    

Results

The model performance on the GTSRB dataset is as follows:

  • Accuracy: 0.9846
  • Precision: 0.9853
  • Recall: 0.9846
  • F1 Score: 0.9846
Downloads last month
47
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

Model tree for kelvinandreas/vit-traffic-sign-GTSRB

Finetuned
(2070)
this model

Space using kelvinandreas/vit-traffic-sign-GTSRB 1