Spaces:
Runtime error
Runtime error
add app
Browse files
app.py
CHANGED
|
@@ -12,9 +12,9 @@ import io
|
|
| 12 |
LOGDIR = "log"
|
| 13 |
logger = build_logger("otter", LOGDIR)
|
| 14 |
|
| 15 |
-
no_change_btn = gr.Button.update()
|
| 16 |
-
enable_btn = gr.Button.update(interactive=True)
|
| 17 |
-
disable_btn = gr.Button.update(interactive=False)
|
| 18 |
|
| 19 |
|
| 20 |
def decode_image(encoded_image: str) -> Image:
|
|
@@ -125,36 +125,36 @@ if __name__ == "__main__":
|
|
| 125 |
with gr.Tab("Ask a Question"):
|
| 126 |
with gr.Row(equal_height=True):
|
| 127 |
with gr.Column(scale=2):
|
| 128 |
-
image_input = gr.Image(label="Upload a High-Res Image", type="pil")
|
| 129 |
with gr.Column(scale=1):
|
| 130 |
-
vqa_output = gr.Textbox(label="Output")
|
| 131 |
text_input = gr.Textbox(label="Ask a Question")
|
| 132 |
|
| 133 |
vqa_btn = gr.Button("Send It")
|
| 134 |
|
| 135 |
gr.Examples(
|
| 136 |
[
|
| 137 |
-
[
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
],
|
| 141 |
-
[
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
],
|
| 145 |
-
[
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
],
|
| 149 |
-
# ["./assets/./IMG_00012.png", "How many apples are there? Count them row by row."],
|
| 150 |
-
[
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
],
|
| 154 |
-
[
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
],
|
| 158 |
],
|
| 159 |
inputs=[image_input, text_input],
|
| 160 |
outputs=[vqa_output],
|
|
|
|
| 12 |
LOGDIR = "log"
|
| 13 |
logger = build_logger("otter", LOGDIR)
|
| 14 |
|
| 15 |
+
# no_change_btn = gr.Button.update()
|
| 16 |
+
# enable_btn = gr.Button.update(interactive=True)
|
| 17 |
+
# disable_btn = gr.Button.update(interactive=False)
|
| 18 |
|
| 19 |
|
| 20 |
def decode_image(encoded_image: str) -> Image:
|
|
|
|
| 125 |
with gr.Tab("Ask a Question"):
|
| 126 |
with gr.Row(equal_height=True):
|
| 127 |
with gr.Column(scale=2):
|
| 128 |
+
image_input = gr.Image(label="Upload a High-Res Image", type="pil")
|
| 129 |
with gr.Column(scale=1):
|
| 130 |
+
vqa_output = gr.Textbox(label="Output")
|
| 131 |
text_input = gr.Textbox(label="Ask a Question")
|
| 132 |
|
| 133 |
vqa_btn = gr.Button("Send It")
|
| 134 |
|
| 135 |
gr.Examples(
|
| 136 |
[
|
| 137 |
+
# [
|
| 138 |
+
# "./assets/IMG_00095.png",
|
| 139 |
+
# "How many camels are inside this image?",
|
| 140 |
+
# ],
|
| 141 |
+
# [
|
| 142 |
+
# "./assets/IMG_00095.png",
|
| 143 |
+
# "How many people are inside this image?",
|
| 144 |
+
# ],
|
| 145 |
+
# [
|
| 146 |
+
# "./assets/IMG_00012.png",
|
| 147 |
+
# "How many apples are there?",
|
| 148 |
+
# ],
|
| 149 |
+
# # ["./assets/./IMG_00012.png", "How many apples are there? Count them row by row."],
|
| 150 |
+
# [
|
| 151 |
+
# "./assets/IMG_00080.png",
|
| 152 |
+
# "What is this and where is it from?",
|
| 153 |
+
# ],
|
| 154 |
+
# [
|
| 155 |
+
# "./assets/IMG_00094.png",
|
| 156 |
+
# "What's important on this website?",
|
| 157 |
+
# ],
|
| 158 |
],
|
| 159 |
inputs=[image_input, text_input],
|
| 160 |
outputs=[vqa_output],
|