akhil5423 commited on
Commit
478f94f
·
verified ·
1 Parent(s): 9b86efc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -54
app.py CHANGED
@@ -67,60 +67,23 @@ def app():
67
 
68
  with gr.Column():
69
  output_image = gr.Image(type="pil", label="Annotated Image")
 
 
 
 
 
 
70
 
71
- gr.Examples(
72
- examples=[
73
- ["dog.jpeg", "yolov10m", 640, 0.25, 0.45],
74
- ["huggingface.jpg", "yolov10m", 640, 0.25, 0.45],
75
- ["zidane.jpg", "yolov10m", 640, 0.25, 0.45],
76
- ],
77
- fn=yolov10_inference,
78
- inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
79
- outputs=[output_image],
80
- cache_examples='lazy',
81
- )
82
-
83
- yolov10_infer.click(
84
- fn=yolov10_inference,
85
- inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
86
- outputs=[output_image],
87
- )
88
-
89
- gradio_app = gr.Blocks()
90
-
91
- with gradio_app:
92
- with gr.Row():
93
- with gr.Column():
94
- gr.HTML(
95
- """
96
- <h1 style='text-align: center'>
97
- YOLOv10: Real-Time End-to-End Object Detection
98
- </h1>
99
- """
100
- )
101
- gr.HTML(
102
- """
103
- <h3 style='text-align: center'>
104
- <a href='https://arxiv.org/abs/2405.14458' target='_blank'>arXiv</a> | <a href='https://github.com/THU-MIG/yolov10' target='_blank'>github</a>
105
- </h3>
106
- """
107
- )
108
- gr.HTML(
109
- """
110
- <h3 style='text-align: center'>
111
- Follow me for more!
112
- </h3>
113
- """
114
- )
115
- gr.HTML(
116
- """
117
- <div style='text-align: center;'>
118
- Twitter | Github | Linkedin | HuggingFace
119
- </div>
120
- """
121
- )
122
-
123
- app()
124
 
125
  if __name__ == "__main__":
126
- gradio_app.launch()
 
67
 
68
  with gr.Column():
69
  output_image = gr.Image(type="pil", label="Annotated Image")
70
+
71
+ yolov10_infer.click(
72
+ fn=yolov10_inference,
73
+ inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
74
+ outputs=[output_image],
75
+ )
76
 
77
+ gr.Examples(
78
+ examples=[
79
+ ["zidane.jpg", "yolov10s", 640, 0.25, 0.45],
80
+ ["dog.jpeg", "yolov10s", 640, 0.25, 0.45],
81
+ ],
82
+ inputs=[image, model_id, image_size, conf_threshold, iou_threshold],
83
+ outputs=[output_image],
84
+ fn=yolov10_inference,
85
+ cache_examples="lazy",
86
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  if __name__ == "__main__":
89
+ app().launch()