Spaces:
Sleeping
Sleeping
Use file upload and simplify Gradio schema
Browse files
app.py
CHANGED
|
@@ -112,14 +112,14 @@ def draw_person(
|
|
| 112 |
|
| 113 |
|
| 114 |
def build_stickman_video(
|
| 115 |
-
video_path
|
| 116 |
-
conf
|
| 117 |
-
point_conf
|
| 118 |
-
max_frames
|
| 119 |
-
frame_stride
|
| 120 |
-
line_width
|
| 121 |
progress: gr.Progress = gr.Progress(track_tqdm=False),
|
| 122 |
-
)
|
| 123 |
if video_path is None:
|
| 124 |
raise gr.Error("Please upload a video first.")
|
| 125 |
|
|
@@ -238,7 +238,11 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", neutral_hue="slate"), ti
|
|
| 238 |
|
| 239 |
with gr.Row():
|
| 240 |
with gr.Column(scale=1):
|
| 241 |
-
video_input = gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
conf_input = gr.Slider(0.05, 0.90, value=0.30, step=0.05, label="YOLO detection confidence")
|
| 243 |
point_conf_input = gr.Slider(0.05, 0.90, value=0.25, step=0.05, label="Keypoint drawing confidence")
|
| 244 |
max_frames_input = gr.Slider(
|
|
|
|
| 112 |
|
| 113 |
|
| 114 |
def build_stickman_video(
|
| 115 |
+
video_path,
|
| 116 |
+
conf,
|
| 117 |
+
point_conf,
|
| 118 |
+
max_frames,
|
| 119 |
+
frame_stride,
|
| 120 |
+
line_width,
|
| 121 |
progress: gr.Progress = gr.Progress(track_tqdm=False),
|
| 122 |
+
):
|
| 123 |
if video_path is None:
|
| 124 |
raise gr.Error("Please upload a video first.")
|
| 125 |
|
|
|
|
| 238 |
|
| 239 |
with gr.Row():
|
| 240 |
with gr.Column(scale=1):
|
| 241 |
+
video_input = gr.File(
|
| 242 |
+
label="Upload video",
|
| 243 |
+
file_types=[".mp4", ".mov", ".avi", ".mkv", ".webm"],
|
| 244 |
+
type="filepath",
|
| 245 |
+
)
|
| 246 |
conf_input = gr.Slider(0.05, 0.90, value=0.30, step=0.05, label="YOLO detection confidence")
|
| 247 |
point_conf_input = gr.Slider(0.05, 0.90, value=0.25, step=0.05, label="Keypoint drawing confidence")
|
| 248 |
max_frames_input = gr.Slider(
|