Spaces:
Running
Running
YSMlearnsCode
commited on
Commit
·
f1b198c
1
Parent(s):
23465c6
made ui hot reload
Browse files- app.py +3 -11
- src/app/__init__.py +0 -0
- src/app/interface.py +14 -0
app.py
CHANGED
|
@@ -1,17 +1,9 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
def main():
|
| 4 |
-
with gr.Blocks() as demo:
|
| 5 |
-
gr.Markdown("# 🗑️ Mülltrenner9000 🤖")
|
| 6 |
-
gr.Markdown("🗑️ This app classifies and segments trash for proper recycling. 🤖")
|
| 7 |
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
input_image = gr.Image(type="numpy", label="Upload Image")
|
| 11 |
-
output_image = gr.Image(type="numpy", label="Segmented Output")
|
| 12 |
-
# input_image.change(fn=predict, inputs=input_image, outputs=output_image)
|
| 13 |
demo.launch()
|
| 14 |
|
| 15 |
-
|
| 16 |
if __name__ == "__main__":
|
| 17 |
main()
|
|
|
|
| 1 |
+
from src.app.interface import main_interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
demo = main_interface()
|
| 4 |
|
| 5 |
+
def main():
|
|
|
|
|
|
|
|
|
|
| 6 |
demo.launch()
|
| 7 |
|
|
|
|
| 8 |
if __name__ == "__main__":
|
| 9 |
main()
|
src/app/__init__.py
ADDED
|
File without changes
|
src/app/interface.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def main_interface():
|
| 5 |
+
with gr.Blocks(title = "🗑️ Mülltrenner9000 🤖") as demo:
|
| 6 |
+
gr.Markdown("# 🗑️ Mülltrenner9000 🤖")
|
| 7 |
+
gr.Markdown("🗑️ This app classifies and segments trash for proper recycling according to german mülltrennung rules. 🤖")
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
with gr.Row():
|
| 11 |
+
input_image = gr.Image(type="numpy", label="Upload Image")
|
| 12 |
+
output_image = gr.Image(type="numpy", label="Segmented Output")
|
| 13 |
+
# input_image.change(fn=predict, inputs=input_image, outputs=output_image)
|
| 14 |
+
return demo
|