priyag/imageprocessing
0
1import streamlit as st2from transformers import pipeline3from PIL import Image #to load image from image module from pillow package4pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")5st.title("Hot Dog? Or Not?")6 7file_name = st.file_uploader("Upload a hot dog image")8if file_name is not None:9 col1,col2 = st.columns(2)10 image = Image.open(file_name)11 col1.image(image, use_column_width=True)12 predictions = pipeline(image)13 14 col2.header("Probabilities")15 for p in predictions:16 col2.subheader(f"{ p['label'] }: { round(p['score'] * 100, 1)}%")