Freestyle / app.py
Cheselle's picture
Update app.py
bf24417 verified
raw
history blame contribute delete
371 Bytes
import streamlit as st
from transformers import pipeline
from PIL import Image
pipeline = pipeline(task="image-to-text", model="Salesforce/blip-image-captioning-large")
file_name = st.file_uploader("")
if file_name is not None:
col1, col2 = st.columns(2)
image = Image.open(file_name)
col1.image(image, use_column_width=True)
st.write(pipeline(image))