Koom759 commited on
Commit
2cee926
·
verified ·
1 Parent(s): b708f85

Use file upload and simplify Gradio schema

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -112,14 +112,14 @@ def draw_person(
112
 
113
 
114
  def build_stickman_video(
115
- video_path: str | dict,
116
- conf: float,
117
- point_conf: float,
118
- max_frames: int,
119
- frame_stride: int,
120
- line_width: int,
121
  progress: gr.Progress = gr.Progress(track_tqdm=False),
122
- ) -> tuple[str, str, str]:
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.Video(label="Upload video", sources=["upload"])
 
 
 
 
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(