Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -255,20 +255,27 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 255 |
"πΎ Download Result",
|
| 256 |
interactive=False
|
| 257 |
)
|
| 258 |
-
|
| 259 |
with gr.Accordion("π Examples", open=False):
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 263 |
]
|
| 264 |
-
|
| 265 |
-
examples=
|
| 266 |
-
inputs=[
|
| 267 |
-
outputs=[
|
| 268 |
-
fn=
|
| 269 |
cache_examples=True
|
| 270 |
)
|
| 271 |
|
|
|
|
| 272 |
with gr.Tab("π Extract by Box", id="tab_bb"):
|
| 273 |
with gr.Row(equal_height=True):
|
| 274 |
with gr.Column(scale=1, min_width=400):
|
|
@@ -300,8 +307,14 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 300 |
|
| 301 |
with gr.Accordion("π Examples", open=False):
|
| 302 |
examples_bb = [
|
| 303 |
-
|
| 304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
]
|
| 306 |
ex_bb = gr.Examples(
|
| 307 |
examples=examples_bb,
|
|
@@ -311,6 +324,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
|
| 311 |
cache_examples=True
|
| 312 |
)
|
| 313 |
|
|
|
|
| 314 |
# Event handlers
|
| 315 |
btn.add(oimg)
|
| 316 |
for inp in [iimg, prompt]:
|
|
|
|
| 255 |
"πΎ Download Result",
|
| 256 |
interactive=False
|
| 257 |
)
|
| 258 |
+
# Bounding Box νμ Examples λΆλΆ μμ
|
| 259 |
with gr.Accordion("π Examples", open=False):
|
| 260 |
+
examples_bb = [
|
| 261 |
+
{
|
| 262 |
+
"image": "examples/text.jpg",
|
| 263 |
+
"boxes": [{"xmin": 51, "ymin": 511, "xmax": 639, "ymax": 1255}]
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"image": "examples/black-lamp.jpg",
|
| 267 |
+
"boxes": [{"xmin": 88, "ymin": 148, "xmax": 700, "ymax": 1414}]
|
| 268 |
+
}
|
| 269 |
]
|
| 270 |
+
ex_bb = gr.Examples(
|
| 271 |
+
examples=examples_bb,
|
| 272 |
+
inputs=[annotator],
|
| 273 |
+
outputs=[oimg_bb, dlbt_bb],
|
| 274 |
+
fn=process_bbox,
|
| 275 |
cache_examples=True
|
| 276 |
)
|
| 277 |
|
| 278 |
+
|
| 279 |
with gr.Tab("π Extract by Box", id="tab_bb"):
|
| 280 |
with gr.Row(equal_height=True):
|
| 281 |
with gr.Column(scale=1, min_width=400):
|
|
|
|
| 307 |
|
| 308 |
with gr.Accordion("π Examples", open=False):
|
| 309 |
examples_bb = [
|
| 310 |
+
{
|
| 311 |
+
"image": "examples/text.jpg",
|
| 312 |
+
"boxes": [{"xmin": 51, "ymin": 511, "xmax": 639, "ymax": 1255}]
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"image": "examples/black-lamp.jpg",
|
| 316 |
+
"boxes": [{"xmin": 88, "ymin": 148, "xmax": 700, "ymax": 1414}]
|
| 317 |
+
}
|
| 318 |
]
|
| 319 |
ex_bb = gr.Examples(
|
| 320 |
examples=examples_bb,
|
|
|
|
| 324 |
cache_examples=True
|
| 325 |
)
|
| 326 |
|
| 327 |
+
|
| 328 |
# Event handlers
|
| 329 |
btn.add(oimg)
|
| 330 |
for inp in [iimg, prompt]:
|