Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -76,3 +76,20 @@ interface = gr.Interface(
|
|
| 76 |
)
|
| 77 |
|
| 78 |
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
)
|
| 77 |
|
| 78 |
interface.launch()
|
| 79 |
+
|
| 80 |
+
# Créer l'application avec Gradio Blocks
|
| 81 |
+
with gr.Blocks(title="YOLOv8 - Détection d'objets sur Image et Vidéo") as app:
|
| 82 |
+
gr.Markdown("## 🧠 Détection d'objets avec YOLOv8 (Image & Vidéo)")
|
| 83 |
+
gr.Markdown("Choisissez une option ci-dessous pour détecter les objets dans une image ou une vidéo.")
|
| 84 |
+
|
| 85 |
+
with gr.Tab("📷 Détection sur Image"):
|
| 86 |
+
img_input = gr.Image(type="numpy", label="Image à analyser")
|
| 87 |
+
img_output = gr.Image(type="numpy", label="Image annotée")
|
| 88 |
+
img_button = gr.Button("Lancer la détection")
|
| 89 |
+
img_button.click(fn=detect_objects_image, inputs=img_input, outputs=img_output)
|
| 90 |
+
|
| 91 |
+
with gr.Tab("🎥 Détection sur Vidéo"):
|
| 92 |
+
vid_input = gr.Video(label="Vidéo à analyser")
|
| 93 |
+
vid_output = gr.Video(label="Vidéo annotée")
|
| 94 |
+
vid_button = gr.Button("Lancer la détection")
|
| 95 |
+
vid_button.click(fn=detect_objects_video, inputs=vid_input, outputs=vid_output)
|