Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,14 +55,22 @@ def predict_video(video):
|
|
| 55 |
|
| 56 |
# Define Gradio interface
|
| 57 |
iface = gr.Interface(
|
| 58 |
-
fn=
|
| 59 |
-
inputs=
|
| 60 |
-
|
| 61 |
-
outputs={"Image": gr.outputs.Image(type="numpy", label="Detected Objects"),
|
| 62 |
-
"Video": gr.outputs.Video(label="Processed Video")},
|
| 63 |
title="YOLOv8 Object Detection",
|
| 64 |
-
description="Upload an image
|
| 65 |
)
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
if __name__ == "__main__":
|
| 68 |
-
|
|
|
|
| 55 |
|
| 56 |
# Define Gradio interface
|
| 57 |
iface = gr.Interface(
|
| 58 |
+
fn=predict_image,
|
| 59 |
+
inputs=gr.Image(type="numpy", label="Upload an Image"),
|
| 60 |
+
outputs=gr.Image(type="numpy", label="Detected Objects"),
|
|
|
|
|
|
|
| 61 |
title="YOLOv8 Object Detection",
|
| 62 |
+
description="Upload an image and get detected objects using YOLOv8"
|
| 63 |
)
|
| 64 |
|
| 65 |
+
iface_video = gr.Interface(
|
| 66 |
+
fn=predict_video,
|
| 67 |
+
inputs=gr.Video(label="Upload a Video"),
|
| 68 |
+
outputs=gr.Video(label="Processed Video"),
|
| 69 |
+
title="YOLOv8 Object Detection",
|
| 70 |
+
description="Upload a video and get detected objects using YOLOv8"
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
demo = gr.TabbedInterface([iface, iface_video], ["Image Detection", "Video Detection"])
|
| 74 |
+
|
| 75 |
if __name__ == "__main__":
|
| 76 |
+
demo.launch()
|