Parthebhan commited on
Commit
b72a262
·
verified ·
1 Parent(s): cc749dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -21
app.py CHANGED
@@ -35,26 +35,17 @@ def yolov9_inference(img_path):
35
 
36
  return output_image
37
 
38
-
39
  def app():
40
- with gr.Blocks():
41
- with gr.Row():
42
- with gr.Column():
43
- img_path = gr.Image(type="file", label="Upload Image")
44
- inference_button = gr.Button(label="Run Inference")
45
- with gr.Column():
46
- output_image = gr.Image(label="Output Image")
47
-
48
- inference_button.click(
49
- fn=yolov9_inference,
50
- inputs=[img_path],
51
- outputs=[output_image],
52
- )
53
-
54
-
55
- gradio_app = gr.Interface(
56
- app,
57
- title="YOLOv9 Inference",
58
- description="Perform object detection using the YOLOv9 model.",
59
- )
60
  gradio_app.launch(debug=True)
 
 
35
 
36
  return output_image
37
 
 
38
  def app():
39
+ return gr.Interface(
40
+ yolov9_inference,
41
+ inputs=gr.inputs.Image(type="pil", label="Upload Image"),
42
+ outputs="image",
43
+ title="YOLOv9 Inference",
44
+ description="Perform object detection using the YOLOv9 model.",
45
+ theme="compact"
46
+ )
47
+
48
+
49
+ gradio_app = app()
 
 
 
 
 
 
 
 
 
50
  gradio_app.launch(debug=True)
51
+