Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from utils import get_captions
|
3 |
+
|
4 |
+
# Create a Gradio interface
|
5 |
+
iface = gr.Interface(
|
6 |
+
fn=get_captions, # Function to be called on user input
|
7 |
+
inputs=gr.Image(
|
8 |
+
width=416, height=416,
|
9 |
+
type="pil", image_mode='RGB', label="Upload Image"
|
10 |
+
),
|
11 |
+
outputs=gr.Textbox(
|
12 |
+
label="Response from AI Model: ",
|
13 |
+
),
|
14 |
+
examples = ['examples/HorseRide.jpg','examples/Car.jpg']
|
15 |
+
)
|
16 |
+
|
17 |
+
# Launch the Gradio app
|
18 |
+
iface.launch()
|