Spaces:
Runtime error
Runtime error
feat: add Gradio app with greeting functionality and YOLOv10 placeholder
Browse files
src/modules/gradio_app/__init__.py
ADDED
|
@@ -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")
|