xmrt commited on
Commit
0e5fb59
1 Parent(s): 284aa22

3d visualization

Browse files
Files changed (1) hide show
  1. main.py +11 -12
main.py CHANGED
@@ -8,8 +8,6 @@ import cv2
8
 
9
  print("[INFO]: Imported modules!")
10
 
11
-
12
-
13
  # inferencer = MMPoseInferencer('hand') # 'hand', 'human , device='cuda'
14
  # inferencer = MMPoseInferencer('human')
15
 
@@ -33,7 +31,9 @@ def poses(photo):
33
  vis_out_dir =".",
34
  return_vis=True,
35
  thickness=2)
36
-
 
 
37
  # # Prepare to save video
38
  # output_file = os.path.join("output.mp4")
39
 
@@ -57,7 +57,7 @@ def poses(photo):
57
 
58
  # out_writer.release()
59
  # cv2.destroyAllWindows() # Closing window
60
- #output_file = glob.glob("*.mp4")
61
 
62
  return photo #output_file
63
 
@@ -76,15 +76,14 @@ def poses(photo):
76
 
77
  def run():
78
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
79
-
80
  webcam = gr.Interface(
81
- fn=poses,
82
- inputs= gr.Video(source="webcam"),
83
- outputs = gr.PlayableVideo(format='mp4', interactive=True),
84
- title = 'Pose estimation',
85
- description = 'Pose estimation on video',
86
- allow_flagging=False
87
- )
88
 
89
  file = gr.Interface(
90
  poses,
 
8
 
9
  print("[INFO]: Imported modules!")
10
 
 
 
11
  # inferencer = MMPoseInferencer('hand') # 'hand', 'human , device='cuda'
12
  # inferencer = MMPoseInferencer('human')
13
 
 
31
  vis_out_dir =".",
32
  return_vis=True,
33
  thickness=2)
34
+
35
+ for result in result_generator:
36
+ print("[INFO] Result: ", result)
37
  # # Prepare to save video
38
  # output_file = os.path.join("output.mp4")
39
 
 
57
 
58
  # out_writer.release()
59
  # cv2.destroyAllWindows() # Closing window
60
+ output_file = glob.glob("*.mp4")
61
 
62
  return photo #output_file
63
 
 
76
 
77
  def run():
78
  #https://github.com/open-mmlab/mmpose/blob/main/docs/en/user_guides/inference.md
 
79
  webcam = gr.Interface(
80
+ fn=poses,
81
+ inputs= gr.Video(source="webcam"),
82
+ outputs = gr.PlayableVideo(format='mp4', interactive=True),
83
+ title = 'Pose estimation',
84
+ description = 'Pose estimation on video',
85
+ allow_flagging=False
86
+ )
87
 
88
  file = gr.Interface(
89
  poses,