Spaces:
Running
Running
Update
Browse files
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: 📉
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
suggested_hardware: t4-small
|
|
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.36.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
suggested_hardware: t4-small
|
app.py
CHANGED
|
@@ -25,7 +25,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 25 |
)
|
| 26 |
with gr.Row():
|
| 27 |
detect_button = gr.Button("Detect")
|
| 28 |
-
detection_results = gr.
|
| 29 |
with gr.Column():
|
| 30 |
with gr.Row():
|
| 31 |
detection_visualization = gr.Image(label="Detection Result", type="numpy")
|
|
@@ -40,7 +40,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 40 |
paths = sorted(pathlib.Path("images").rglob("*.jpg"))
|
| 41 |
gr.Examples(examples=[[path.as_posix()] for path in paths], inputs=input_image)
|
| 42 |
|
| 43 |
-
detector_name.change(fn=model.set_model_name, inputs=
|
| 44 |
detect_button.click(
|
| 45 |
fn=model.detect_and_visualize,
|
| 46 |
inputs=[
|
|
@@ -59,6 +59,8 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 59 |
detection_results,
|
| 60 |
visualization_score_threshold,
|
| 61 |
],
|
| 62 |
-
outputs=
|
| 63 |
)
|
| 64 |
-
|
|
|
|
|
|
|
|
|
| 25 |
)
|
| 26 |
with gr.Row():
|
| 27 |
detect_button = gr.Button("Detect")
|
| 28 |
+
detection_results = gr.State()
|
| 29 |
with gr.Column():
|
| 30 |
with gr.Row():
|
| 31 |
detection_visualization = gr.Image(label="Detection Result", type="numpy")
|
|
|
|
| 40 |
paths = sorted(pathlib.Path("images").rglob("*.jpg"))
|
| 41 |
gr.Examples(examples=[[path.as_posix()] for path in paths], inputs=input_image)
|
| 42 |
|
| 43 |
+
detector_name.change(fn=model.set_model_name, inputs=detector_name)
|
| 44 |
detect_button.click(
|
| 45 |
fn=model.detect_and_visualize,
|
| 46 |
inputs=[
|
|
|
|
| 59 |
detection_results,
|
| 60 |
visualization_score_threshold,
|
| 61 |
],
|
| 62 |
+
outputs=detection_visualization,
|
| 63 |
)
|
| 64 |
+
|
| 65 |
+
if __name__ == "__main__":
|
| 66 |
+
demo.queue(max_size=10).launch()
|