Cheselle commited on
Commit
4632494
·
verified ·
1 Parent(s): 0f12659

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+ from PIL import Image
4
+
5
+ pipeline = pipeline("image-to-text")
6
+
7
+ file_name = st.file_uploader("Upload")
8
+
9
+ if file_name is not None:
10
+ col1, col2 = st.columns(2)
11
+
12
+ image = Image.open(file_name)
13
+ col1.image(image, use_column_width = True)
14
+ description = pipeline(image)
15
+
16
+ col2.header("Description")
17
+ description
18
+
19
+