hossainlab commited on
Commit
9c34e01
·
verified ·
1 Parent(s): fc80f29

Update app.py

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