Spaces:
Sleeping
Sleeping
kasper-boy
commited on
Commit
•
b11a9e8
1
Parent(s):
e62d449
Update app.py
Browse files
app.py
CHANGED
@@ -54,15 +54,16 @@ def object_detection(image, confidence_threshold):
|
|
54 |
return result_image, detected_objects_text
|
55 |
|
56 |
# Define the Gradio interface
|
57 |
-
confidence_slider = gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.5, label="Confidence Threshold")
|
58 |
-
image_input = gr.inputs.Image(type="pil", label="Upload an Image")
|
59 |
-
output_image = gr.outputs.Image(type="pil", label="Detected Objects")
|
60 |
-
output_textbox = gr.outputs.Textbox(label="Detected Objects List")
|
61 |
-
|
62 |
demo = gr.Interface(
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
title="Object Detection with DETR (ResNet-101)",
|
67 |
description="Upload an image and adjust the confidence threshold to view detected objects."
|
68 |
)
|
|
|
54 |
return result_image, detected_objects_text
|
55 |
|
56 |
# Define the Gradio interface
|
|
|
|
|
|
|
|
|
|
|
57 |
demo = gr.Interface(
|
58 |
+
object_detection,
|
59 |
+
[
|
60 |
+
gr.inputs.Image(type="pil", label="Upload an Image"),
|
61 |
+
gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.5, label="Confidence Threshold")
|
62 |
+
],
|
63 |
+
[
|
64 |
+
gr.outputs.Image(type="pil", label="Detected Objects"),
|
65 |
+
gr.outputs.Textbox(label="Detected Objects List")
|
66 |
+
],
|
67 |
title="Object Detection with DETR (ResNet-101)",
|
68 |
description="Upload an image and adjust the confidence threshold to view detected objects."
|
69 |
)
|