Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -61,11 +61,23 @@ def process_video(video_path, output_option):
|
|
61 |
video_input = gr.Video()
|
62 |
output_option_input = gr.Radio(choices=["Count", "Video", "Both"], label="Select output type")
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
video_interface = gr.Interface(
|
65 |
fn=process_video,
|
66 |
inputs=[video_input, output_option_input],
|
67 |
outputs=[gr.Textbox(label="Object Count"), "video"], # Update outputs to support multiple types
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
69 |
)
|
70 |
|
71 |
# Deploy the interface with share enabled
|
|
|
61 |
video_input = gr.Video()
|
62 |
output_option_input = gr.Radio(choices=["Count", "Video", "Both"], label="Select output type")
|
63 |
|
64 |
+
# Define examples for the interface
|
65 |
+
examples = [
|
66 |
+
[os.path.abspath("example_video1.mp4"), "Count"],
|
67 |
+
[os.path.abspath("example_video2.mp4"), "Video"],
|
68 |
+
[os.path.abspath("example_video3.mp4"), "Both"]
|
69 |
+
]
|
70 |
+
|
71 |
video_interface = gr.Interface(
|
72 |
fn=process_video,
|
73 |
inputs=[video_input, output_option_input],
|
74 |
outputs=[gr.Textbox(label="Object Count"), "video"], # Update outputs to support multiple types
|
75 |
+
title="YOLO Video Tracking Application",
|
76 |
+
description="A simple application to track objects in a video using YOLO model. Upload your own video, or click one of the examples to load them.",
|
77 |
+
article="""<div>
|
78 |
+
<p style="text-align: center">Upload a video file and select the type of output you want: object count, processed video, or both. Then, hit submit to process the video.</p>
|
79 |
+
</div>""",
|
80 |
+
examples=examples
|
81 |
)
|
82 |
|
83 |
# Deploy the interface with share enabled
|