Spaces:
Runtime error
Runtime error
Download src/modules/gradio_app/__init__.py from pnstack/template-python: direct link, hf CLI and curl.
- Browser
- Download file 998 Bytes
-
https://huggingface.co/spaces/pnstack/template-python/resolve/4af01e74f58ae9b413d2ee00382d6772bb076e3d/src/modules/gradio_app/__init__.py
- Command line
-
hf download hf://spaces/pnstack/template-python@4af01e74f58ae9b413d2ee00382d6772bb076e3d/src/modules/gradio_app/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/pnstack/template-python/resolve/4af01e74f58ae9b413d2ee00382d6772bb076e3d/src/modules/gradio_app/__init__.py
998 Bytes
| import gradio as gr | |
| def greet(name): | |
| return f"Hello {name}!" | |
| def detection(image, conf_threshold): | |
| # Placeholder for YOLOv10 detection logic | |
| # This function should process the image and return the modified image | |
| # For now, we will just return the original image | |
| return image | |
| with gr.Blocks() as block: | |
| gr.Markdown("# 🚀 Gradio Hello World") | |
| gr.HTML( | |
| """ | |
| <h1 style='text-align: center'> | |
| YOLOv10 Webcam Stream (Powered by WebRTC ⚡️) | |
| </h1> | |
| """ | |
| ) | |
| with gr.Row(): | |
| name_input = gr.Textbox(label="Your Name", placeholder="Enter your name...") | |
| output = gr.Textbox(label="Greeting") | |
| greet_btn = gr.Button("Greet") | |
| greet_btn.click(fn=greet, inputs=name_input, outputs=output) | |
| gr.Examples( | |
| examples=["Alice", "Bob", "Charlie"], | |
| inputs=name_input | |
| ) | |
| block.launch(server_port=7860, server_name="0.0.0.0") | |
| print("Gradio app is running on http://localhost:7860") |