Spaces:
Runtime error
Runtime error
LukaTheCorgi
commited on
Commit
•
ada42bc
1
Parent(s):
9b99b9d
Create app.py
Browse files
app.py
ADDED
@@ -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 |
+
|
7 |
+
def launch(input):
|
8 |
+
out = pipe(input)
|
9 |
+
return out[0]['generated_text']
|
10 |
+
|
11 |
+
iface = gr.Interface(launch,
|
12 |
+
inputs = gr.Image(type='pil'),
|
13 |
+
outputs="text")
|
14 |
+
|
15 |
+
iface.launch()
|