import streamlit as st from PIL import Image import torch from torchvision import transforms from transformers import AutoImageProcessor import pandas as pd # Load the Traffic_Signs_Classification model pipeline classifier = pipeline("TrafficSigns-classification", model='Rae1230/Traffic_Signs_Classification', return_all_scores=True) # Streamlit application title st.title("Speech the Traffic Signs") uploaded_file = st.file_uploader("Choose a PNG image...", type="png", accept_multiple_files=False) if uploaded_file is not None: image = Image.open(uploaded_file) st.image(image, caption='Uploaded Image.', use_column_width=True) processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224") inputs = processor(image.convert('RGB'), return_tensors="pt") result=classifier(inputs) st.write(result)