NataLobster commited on
Commit
ab8282d
1 Parent(s): fefd486

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline("image-to-text",
5
+ model="Salesforce/blip-image-captioning-base")
6
+ def launch(input):
7
+ out = pipe(input)
8
+ return out[0]['generated_text']
9
+
10
+
11
+ iface = gr.Interface(launch,
12
+ inputs=gr.Image(type='pil'),
13
+ outputs="text")
14
+
15
+ iface.launch()