3d visualization
Browse files
main.py
CHANGED
@@ -7,7 +7,20 @@ import gradio as gr
|
|
7 |
import numpy as np
|
8 |
import cv2
|
9 |
|
10 |
-
inferencer = MMPoseInferencer('hand', device='cuda'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
print("[INFO]: Downloaded models!")
|
12 |
|
13 |
|
@@ -17,6 +30,7 @@ def poses(photo):
|
|
17 |
return_vis=True,
|
18 |
thickness=2)
|
19 |
|
|
|
20 |
|
21 |
# Prepare to save video
|
22 |
output_file = os.path.join("output.mp4")
|
@@ -31,8 +45,6 @@ def poses(photo):
|
|
31 |
|
32 |
for result in result_generator:
|
33 |
frame = result["visualization"]
|
34 |
-
print(frame)
|
35 |
-
print(type(frame))
|
36 |
out_writer.write(cv2.cvtColor(frame[0], cv2.COLOR_BGR2RGB))
|
37 |
|
38 |
print(os.listdir())
|
|
|
7 |
import numpy as np
|
8 |
import cv2
|
9 |
|
10 |
+
# inferencer = MMPoseInferencer('hand') # 'hand', 'human , device='cuda'
|
11 |
+
# inferencer = MMPoseInferencer('human')
|
12 |
+
|
13 |
+
inferencer = MMPoseInferencer(pose3d='human3d')
|
14 |
+
# https://github.com/open-mmlab/mmpose/tree/dev-1.x/configs/body_3d_keypoint/pose_lift
|
15 |
+
# motionbert_ft_h36m-d80af323_20230531.pth
|
16 |
+
# simple3Dbaseline_h36m-f0ad73a4_20210419.pth
|
17 |
+
# videopose_h36m_243frames_fullconv_supervised_cpn_ft-88f5abbb_20210527.pth
|
18 |
+
# videopose_h36m_81frames_fullconv_supervised-1f2d1104_20210527.pth
|
19 |
+
# videopose_h36m_27frames_fullconv_supervised-fe8fbba9_20210527.pth
|
20 |
+
# videopose_h36m_1frame_fullconv_supervised_cpn_ft-5c3afaed_20210527.pth
|
21 |
+
|
22 |
+
# https://github.com/open-mmlab/mmpose/blob/main/mmpose/apis/inferencers/pose3d_inferencer.py
|
23 |
+
|
24 |
print("[INFO]: Downloaded models!")
|
25 |
|
26 |
|
|
|
30 |
return_vis=True,
|
31 |
thickness=2)
|
32 |
|
33 |
+
|
34 |
|
35 |
# Prepare to save video
|
36 |
output_file = os.path.join("output.mp4")
|
|
|
45 |
|
46 |
for result in result_generator:
|
47 |
frame = result["visualization"]
|
|
|
|
|
48 |
out_writer.write(cv2.cvtColor(frame[0], cv2.COLOR_BGR2RGB))
|
49 |
|
50 |
print(os.listdir())
|