xmrt commited on
Commit
d486c50
1 Parent(s): 92df7f4

markdown slider and max threads

Browse files
Files changed (1) hide show
  1. main_noweb.py +5 -4
main_noweb.py CHANGED
@@ -50,7 +50,7 @@ def check_fps(video):
50
  def get_frames(video, fps=50, height=512, width=512):
51
 
52
  clip = moviepy.VideoFileClip(video)
53
-
54
  if clip.duration > 10:
55
  raise gr.Error("Please provide or record a video shorter than 10 seconds...")
56
 
@@ -124,7 +124,7 @@ def pose3d(video, kpt_threshold):
124
 
125
 
126
  def pose2d(video, kpt_threshold):
127
- video = check_extension(video)
128
  get_frames(video)
129
 
130
  # Define new unique folder
@@ -189,8 +189,8 @@ def UI():
189
  with gr.Row():
190
  video_input = gr.Video(source="upload", type="filepath", height=512, width=512)
191
  # Insert slider with kpt_thr
192
- with gr.Column("Drag the keypoint threshold to filter out lower probability keypoints:"):
193
- gr.Markdown()
194
  file_kpthr = gr.Slider(0, 1, value=0.3, label='Keypoint threshold')
195
  with gr.Row():
196
  submit_pose_file = gr.Button("Make 2d pose estimation")
@@ -210,6 +210,7 @@ def UI():
210
  \n If you choose to run the code, start by installing the packages json and numpy. The complete overview of the keypoint indices can be seen in the tab 'General information'. """)
211
  gr.Code(
212
  value="""
 
213
  # Importing packages needed
214
  import json
215
  import numpy as np
 
50
  def get_frames(video, fps=50, height=512, width=512):
51
 
52
  clip = moviepy.VideoFileClip(video)
53
+ print(clip.duration)
54
  if clip.duration > 10:
55
  raise gr.Error("Please provide or record a video shorter than 10 seconds...")
56
 
 
124
 
125
 
126
  def pose2d(video, kpt_threshold):
127
+ #video = check_extension(video)
128
  get_frames(video)
129
 
130
  # Define new unique folder
 
189
  with gr.Row():
190
  video_input = gr.Video(source="upload", type="filepath", height=512, width=512)
191
  # Insert slider with kpt_thr
192
+ with gr.Column():
193
+ gr.Markdown("Drag the keypoint threshold to filter out lower probability keypoints:")
194
  file_kpthr = gr.Slider(0, 1, value=0.3, label='Keypoint threshold')
195
  with gr.Row():
196
  submit_pose_file = gr.Button("Make 2d pose estimation")
 
210
  \n If you choose to run the code, start by installing the packages json and numpy. The complete overview of the keypoint indices can be seen in the tab 'General information'. """)
211
  gr.Code(
212
  value="""
213
+
214
  # Importing packages needed
215
  import json
216
  import numpy as np