image_to_text / app.py
roshithindia's picture
Update app.py
f513e2f
raw
history blame contribute delete
355 Bytes
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))