xmrt commited on
Commit
fe45079
1 Parent(s): dc17745

new return

Browse files
Files changed (1) hide show
  1. main.py +6 -5
main.py CHANGED
@@ -20,7 +20,7 @@ import cv2
20
 
21
  print("[INFO]: Imported modules!")
22
  human = MMPoseInferencer("human")
23
- hand = MMPoseInferencer("hand")
24
  human3d = MMPoseInferencer(pose3d="human3d")
25
  track_model = YOLO('yolov8n.pt') # Load an official Detect model
26
 
@@ -103,21 +103,22 @@ def infer(video, check):
103
 
104
  if i == "Detect and track":
105
  #continue
106
- out_file = show_tracking(video, vis_out_dir, inferencer)
107
 
108
  else:
109
  out_file = poses(inferencer, video, vis_out_dir)
110
-
111
- print(out_file)
112
  out_files.extend(out_file)
113
  print(out_files)
114
 
115
- return "track.mp4", out_files[0], out_files[1], out_files[2] # out_files[3]
116
 
117
  def run():
118
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
119
  check_web = gr.CheckboxGroup(choices = ["Detect and track", "Estimate human 2d poses", "Estimate human 2d hand poses", "Estimate human 3d poses"], label="Methods", type="value", info="Select the model(s) you want")
120
  check_file = gr.CheckboxGroup(choices = ["Detect and track", "Estimate human 2d poses", "Estimate human 2d hand poses", "Estimate human 3d poses"], label="Methods", type="value", info="Select the model(s) you want")
 
 
121
 
122
  webcam = gr.Interface(
123
  fn=infer,
 
20
 
21
  print("[INFO]: Imported modules!")
22
  human = MMPoseInferencer("human")
23
+ hand = MMPoseInferencer("hand", kpt_thr=0.15) #kpt_thr (float) – The threshold to visualize the keypoints. Defaults to 0.3
24
  human3d = MMPoseInferencer(pose3d="human3d")
25
  track_model = YOLO('yolov8n.pt') # Load an official Detect model
26
 
 
103
 
104
  if i == "Detect and track":
105
  #continue
106
+ [out_file] = show_tracking(video, vis_out_dir, inferencer)
107
 
108
  else:
109
  out_file = poses(inferencer, video, vis_out_dir)
110
+
 
111
  out_files.extend(out_file)
112
  print(out_files)
113
 
114
+ return "track.mp4", out_files[1], out_files[2], out_files[3] # out_files[3]
115
 
116
  def run():
117
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
118
  check_web = gr.CheckboxGroup(choices = ["Detect and track", "Estimate human 2d poses", "Estimate human 2d hand poses", "Estimate human 3d poses"], label="Methods", type="value", info="Select the model(s) you want")
119
  check_file = gr.CheckboxGroup(choices = ["Detect and track", "Estimate human 2d poses", "Estimate human 2d hand poses", "Estimate human 3d poses"], label="Methods", type="value", info="Select the model(s) you want")
120
+
121
+ # Insert slider with kpt_thr
122
 
123
  webcam = gr.Interface(
124
  fn=infer,