Spaces:
Runtime error
Runtime error
Zengyf-CVer
commited on
Commit
β’
3801039
1
Parent(s):
7811598
app update
Browse files
README.md
CHANGED
@@ -4,9 +4,9 @@ emoji: π
|
|
4 |
colorFrom: purple
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.0.
|
8 |
app_file: app.py
|
9 |
-
pinned:
|
10 |
license: gpl-3.0
|
11 |
---
|
12 |
|
|
|
4 |
colorFrom: purple
|
5 |
colorTo: yellow
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.0.2
|
8 |
app_file: app.py
|
9 |
+
pinned: true
|
10 |
license: gpl-3.0
|
11 |
---
|
12 |
|
app.py
CHANGED
@@ -317,16 +317,15 @@ def main(args):
|
|
317 |
model_cls_name_cp = model_cls_name.copy() # class name
|
318 |
|
319 |
# ------------------- Input Components -------------------
|
320 |
-
inputs_img = gr.
|
321 |
-
inputs_device = gr.
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
inputs_opt = gr.inputs.CheckboxGroup(choices=["label", "pdf", "json"],
|
330 |
default=["label", "pdf"],
|
331 |
type="value",
|
332 |
label="operate")
|
@@ -345,12 +344,12 @@ def main(args):
|
|
345 |
]
|
346 |
|
347 |
# Output parameters
|
348 |
-
outputs_img = gr.
|
349 |
-
outputs_json = gr.
|
350 |
-
outputs_pdf = gr.
|
351 |
-
outputs_df = gr.
|
352 |
-
outputs_objSize = gr.
|
353 |
-
outputs_clsSize = gr.
|
354 |
|
355 |
outputs = [outputs_img, outputs_objSize, outputs_clsSize, outputs_json, outputs_pdf, outputs_df]
|
356 |
|
@@ -412,8 +411,8 @@ def main(args):
|
|
412 |
description=description,
|
413 |
article="",
|
414 |
# examples=examples,
|
415 |
-
theme="seafoam",
|
416 |
-
flagging_dir="run", # output directory
|
417 |
).launch(
|
418 |
inbrowser=True, # Automatically open default browser
|
419 |
show_tips=True, # Automatically display the latest features of gradio
|
|
|
317 |
model_cls_name_cp = model_cls_name.copy() # class name
|
318 |
|
319 |
# ------------------- Input Components -------------------
|
320 |
+
inputs_img = gr.Image(image_mode="RGB", source=source, tool=img_tool, type="pil", label="original image")
|
321 |
+
inputs_device = gr.Radio(choices=["cuda:0", "cpu"], default=device, label="device")
|
322 |
+
inputs_model = gr.Dropdown(choices=model_names, default=model_name, type="value", label="model")
|
323 |
+
inputs_size = gr.Radio(choices=[320, 640, 1280], default=inference_size, label="inference size")
|
324 |
+
input_conf = gr.Slider(0, 1, step=slider_step, default=nms_conf, label="confidence threshold")
|
325 |
+
inputs_iou = gr.Slider(0, 1, step=slider_step, default=nms_iou, label="IoU threshold")
|
326 |
+
inputs_maxnum = gr.Textbox(lines=1, placeholder="Maximum number of detections", default=max_detnum, label="Maximum number of detections")
|
327 |
+
inputs_clsName = gr.CheckboxGroup(choices=model_cls_name, default=model_cls_name, type="index", label="category")
|
328 |
+
inputs_opt = gr.CheckboxGroup(choices=["label", "pdf", "json"],
|
|
|
329 |
default=["label", "pdf"],
|
330 |
type="value",
|
331 |
label="operate")
|
|
|
344 |
]
|
345 |
|
346 |
# Output parameters
|
347 |
+
outputs_img = gr.Image(type="pil", label="Detection image")
|
348 |
+
outputs_json = gr.JSON(label="Detection information")
|
349 |
+
outputs_pdf = gr.File(label="Download test report")
|
350 |
+
outputs_df = gr.Dataframe(max_rows=5, overflow_row_behaviour="paginate", type="pandas", label="List of detection information")
|
351 |
+
outputs_objSize = gr.Label(label="Object size ratio statistics")
|
352 |
+
outputs_clsSize = gr.Label(label="Category detection proportion statistics")
|
353 |
|
354 |
outputs = [outputs_img, outputs_objSize, outputs_clsSize, outputs_json, outputs_pdf, outputs_df]
|
355 |
|
|
|
411 |
description=description,
|
412 |
article="",
|
413 |
# examples=examples,
|
414 |
+
# theme="seafoam",
|
415 |
+
# flagging_dir="run", # output directory
|
416 |
).launch(
|
417 |
inbrowser=True, # Automatically open default browser
|
418 |
show_tips=True, # Automatically display the latest features of gradio
|