Spaces:
Runtime error
Runtime error
Commit
•
f8578e5
1
Parent(s):
e83e38e
Update app.py
Browse files
app.py
CHANGED
@@ -35,15 +35,22 @@ img#style-image {
|
|
35 |
max-height: 600px;
|
36 |
}
|
37 |
'''
|
38 |
-
|
39 |
-
demo = gr.Blocks(css=css)
|
40 |
-
with demo:
|
41 |
-
gr.Markdown('''<h1 id="title">Image Captioning 🖼️</h1>''')
|
42 |
-
with gr.Column():
|
43 |
-
input = gr.inputs.Image(label="Upload your Image", type = 'pil', optional=True)
|
44 |
-
output = gr.outputs.Textbox(type="auto",label="Captions")
|
45 |
-
examples = examples
|
46 |
-
btn = gr.Button("Generate Caption")
|
47 |
-
btn.click(fn=predict, inputs=input, outputs=output)
|
48 |
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
max-height: 600px;
|
36 |
}
|
37 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
+
input = gr.inputs.Image(label="Upload your Image", type = 'pil', optional=True)
|
40 |
+
output = gr.outputs.Textbox(type="auto",label="Captions")
|
41 |
+
examples = [f"example{i}.jpg" for i in range(1,7)]
|
42 |
+
|
43 |
+
description= "Image captioning application made using transformers"
|
44 |
+
title = "Image Captioning 🖼️"
|
45 |
+
|
46 |
+
interface = gr.Interface(
|
47 |
+
fn=predict,
|
48 |
+
inputs = input,
|
49 |
+
theme="grass",
|
50 |
+
outputs=output,
|
51 |
+
examples = examples,
|
52 |
+
title=title,
|
53 |
+
description=description,
|
54 |
+
article = article,
|
55 |
+
)
|
56 |
+
interface.launch(debug=True)
|