from transformers import pipeline import streamlit as st from PIL import Image st.header('Image To Text') model = pipeline("image-to-text", model="Salesforce/blip-image-captioning-large") x = st.file_uploader("Upload Images", type=["png","jpg","jpeg"]) if x is not None: st.image(Image.open(x), width=250) i = Image.open(x) st.write(model(i))