Spaces:
Sleeping
Sleeping
Update app.py (#3)
Browse files- Update app.py (8f524011e53411b51320f4fe4c498f3d985253e7)
Co-authored-by: de Graaff <[email protected]>
app.py
CHANGED
@@ -1,11 +1,40 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
3 |
|
4 |
-
def
|
5 |
-
return "
|
6 |
|
|
|
|
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
if __name__ == "__main__":
|
11 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Dummy-functies voor nu (we breiden die later uit)
|
4 |
+
def toon_opstelling(opstelling):
|
5 |
+
return f"Gekozen opstelling: {opstelling}"
|
6 |
|
7 |
+
def toon_tactiek(upload):
|
8 |
+
return f"Tactiekbestand ontvangen: {upload.name if upload else 'Geen bestand'}"
|
9 |
|
10 |
+
def verwerk_video(video):
|
11 |
+
return f"Video ontvangen: {video.name if video else 'Geen video'}"
|
12 |
|
13 |
+
# Interface layout
|
14 |
+
opstellingen = ["4-3-3", "3-5-2", "5-4-1", "4-2-3-1", "4-4-2"]
|
15 |
+
|
16 |
+
with gr.Blocks() as voetbalapp:
|
17 |
+
gr.Markdown("""# ⚽ Voetbal Tactiek App
|
18 |
+
Kies je opstelling, upload tactiek of analyseer spelsituaties!""")
|
19 |
+
|
20 |
+
with gr.Tab("Opstellingen"):
|
21 |
+
gr.Markdown("## Kies een opstelling")
|
22 |
+
keuze = gr.Dropdown(opstellingen, label="Opstelling kiezen")
|
23 |
+
output_opstelling = gr.Textbox(label="Resultaat")
|
24 |
+
knop_opstelling = gr.Button("Toon opstelling")
|
25 |
+
knop_opstelling.click(fn=toon_opstelling, inputs=keuze, outputs=output_opstelling)
|
26 |
+
|
27 |
+
with gr.Tab("Tactiek"):
|
28 |
+
gr.Markdown("## Upload een tactiekplaatje of PDF")
|
29 |
+
tactiek_file = gr.File(file_types=[".png", ".jpg", ".pdf"])
|
30 |
+
tactiek_output = gr.Textbox()
|
31 |
+
gr.Button("Verwerk tactiek").click(fn=toon_tactiek, inputs=tactiek_file, outputs=tactiek_output)
|
32 |
+
|
33 |
+
with gr.Tab("Spelsituaties"):
|
34 |
+
gr.Markdown("## Upload een video van een spelsituatie")
|
35 |
+
video_upload = gr.File(file_types=[".mp4", ".mov"])
|
36 |
+
video_output = gr.Textbox()
|
37 |
+
gr.Button("Verwerk video").click(fn=verwerk_video, inputs=video_upload, outputs=video_output)
|
38 |
+
|
39 |
+
voetbalapp.launch()
|
40 |
|
|
|
|