Skip to content

Commit 0f1e5e5

Browse files
committed
feat: add Gradio app with greeting functionality and YOLOv10 placeholder
1 parent 4390951 commit 0f1e5e5

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/modules/gradio_app/__init__.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import gradio as gr
2+
3+
def greet(name):
4+
return f"Hello {name}!"
5+
6+
def detection(image, conf_threshold):
7+
# Placeholder for YOLOv10 detection logic
8+
# This function should process the image and return the modified image
9+
# For now, we will just return the original image
10+
return image
11+
12+
with gr.Blocks() as block:
13+
gr.Markdown("# 🚀 Gradio Hello World")
14+
15+
gr.HTML(
16+
"""
17+
<h1 style='text-align: center'>
18+
YOLOv10 Webcam Stream (Powered by WebRTC ⚡️)
19+
</h1>
20+
"""
21+
)
22+
23+
with gr.Row():
24+
name_input = gr.Textbox(label="Your Name", placeholder="Enter your name...")
25+
output = gr.Textbox(label="Greeting")
26+
27+
28+
greet_btn = gr.Button("Greet")
29+
greet_btn.click(fn=greet, inputs=name_input, outputs=output)
30+
31+
gr.Examples(
32+
examples=["Alice", "Bob", "Charlie"],
33+
inputs=name_input
34+
)
35+
36+
37+
block.launch(server_port=7860, server_name="0.0.0.0")
38+
39+
print("Gradio app is running on http://localhost:7860")

0 commit comments

Comments
 (0)