ProfAKJ commited on
Commit
3cbbe9b
·
verified ·
1 Parent(s): 1daa4a3

Create app.py

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