khaledeng15 commited on
Commit
dcd311f
·
1 Parent(s): 426e5e4

add streamlit

Browse files
Files changed (1) hide show
  1. pages/blip-image-captioning.py +11 -5
pages/blip-image-captioning.py CHANGED
@@ -1,4 +1,7 @@
1
- import gradio as gr
 
 
 
2
  from transformers import pipeline
3
 
4
  pipe = pipeline("image-to-text",
@@ -9,8 +12,11 @@ def launch(input):
9
  out = pipe(input)
10
  return out[0]['generated_text']
11
 
12
- iface = gr.Interface(launch,
13
- inputs=gr.Image(type='pil'),
14
- outputs="text")
 
 
 
15
 
16
- iface.launch()
 
1
+ # import gradio as gr
2
+ import streamlit as st
3
+ from io import StringIO
4
+
5
  from transformers import pipeline
6
 
7
  pipe = pipeline("image-to-text",
 
12
  out = pipe(input)
13
  return out[0]['generated_text']
14
 
15
+ uploaded_file = st.file_uploader("Choose a file")
16
+
17
+
18
+ # iface = gr.Interface(launch,
19
+ # inputs=gr.Image(type='pil'),
20
+ # outputs="text")
21
 
22
+ # iface.launch()