kasper-boy commited on
Commit
8c5514e
1 Parent(s): 8bff2fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -16
app.py CHANGED
@@ -54,27 +54,14 @@ def object_detection(image, confidence_threshold):
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(label="Upload an Image"),
61
- # gr.outputs.Image(label="Detected Objects"),
62
- # gr.outputs.Textbox(label="Detected Objects List"),
63
- # gr.inputs.Slider(minimum=0.0, maximum=1.0, default=0.5, label="Confidence Threshold")
64
- # ],
65
- # title="Object Detection with DETR (ResNet-101)",
66
- # description="Upload an image and adjust the confidence threshold to view detected objects."
67
- # )
68
-
69
  demo = gr.Interface(
70
  fn=object_detection,
71
- inputs=[gr.Image(label="Upload an Image"),gr.Slider(minimum=0.0, maximum=1.0, default=0.5, label="Confidence Threshold")],
72
- outputs=[gr.Image(label="Detected Objects"),gr.Textbox(label="Detected Objects List")],
73
  title="Object Detection with DETR (ResNet-101)",
74
- description="Upload an image and get object detection results using the DETR model with a ResNet-101 backbone.",
75
  )
76
 
77
-
78
  # Launch the Gradio interface
79
  if __name__ == "__main__":
80
  demo.launch()
 
54
  return result_image, detected_objects_text
55
 
56
  # Define the Gradio interface
 
 
 
 
 
 
 
 
 
 
 
 
57
  demo = gr.Interface(
58
  fn=object_detection,
59
+ inputs=[gr.Image(label="Upload an Image"), gr.Slider(minimum=0.0, maximum=1.0, label="Confidence Threshold", default=0.5)],
60
+ outputs=[gr.Image(label="Detected Objects"), gr.Textbox(label="Detected Objects List")],
61
  title="Object Detection with DETR (ResNet-101)",
62
+ description="Upload an image and get object detection results using the DETR model with a ResNet-101 backbone."
63
  )
64
 
 
65
  # Launch the Gradio interface
66
  if __name__ == "__main__":
67
  demo.launch()