3d change ND 2D NEW MODEL
Browse files- main_noweb.py +9 -7
main_noweb.py
CHANGED
@@ -33,8 +33,9 @@ os.system("nvidia-smi")
|
|
33 |
print("[INFO]: Imported modules!")
|
34 |
human = MMPoseInferencer("simcc_mobilenetv2_wo-deconv-8xb64-210e_coco-256x192") # simcc_mobilenetv2_wo-deconv-8xb64-210e_coco-256x192 dekr_hrnet-w32_8xb10-140e_coco-512x512
|
35 |
hand = MMPoseInferencer("hand")
|
36 |
-
human3d = MMPoseInferencer("pose-lift_simplebaseline3d_8xb64-200e_h36m"
|
37 |
-
|
|
|
38 |
print("[INFO]: Downloaded models!")
|
39 |
|
40 |
def check_fps(video):
|
@@ -44,7 +45,7 @@ def check_fps(video):
|
|
44 |
return nframes, fps
|
45 |
|
46 |
|
47 |
-
def get_frames(video, fps=15, height=512):
|
48 |
# extract the file name and extension
|
49 |
split_tup = os.path.splitext(video)
|
50 |
|
@@ -60,12 +61,12 @@ def get_frames(video, fps=15, height=512):
|
|
60 |
#check fps
|
61 |
if clip.fps > 15:
|
62 |
print("vide rate is over 15, resetting to 15")
|
63 |
-
clip_resized = moviepy.clip.resize(height=height)
|
64 |
-
|
65 |
else:
|
66 |
print("video rate is OK")
|
67 |
-
clip_resized = clip.resize(height=height)
|
68 |
-
clip_resized.write_videofile(video, fps=clip.fps)
|
69 |
|
70 |
print("video resized to 512 height")
|
71 |
|
@@ -120,6 +121,7 @@ def pose3d(video, kpt_threshold):
|
|
120 |
|
121 |
def pose2d(video, kpt_threshold):
|
122 |
video = check_extension(video)
|
|
|
123 |
|
124 |
# Define new unique folder
|
125 |
add_dir = str(uuid.uuid4())
|
|
|
33 |
print("[INFO]: Imported modules!")
|
34 |
human = MMPoseInferencer("simcc_mobilenetv2_wo-deconv-8xb64-210e_coco-256x192") # simcc_mobilenetv2_wo-deconv-8xb64-210e_coco-256x192 dekr_hrnet-w32_8xb10-140e_coco-512x512
|
35 |
hand = MMPoseInferencer("hand")
|
36 |
+
human3d = MMPoseInferencer("https://github.com/open-mmlab/mmpose/blob/main/configs/body_3d_keypoint/pose_lift/h36m/pose-lift_simplebaseline3d_8xb64-200e_h36m.py",
|
37 |
+
"https://download.openmmlab.com/mmpose/body3d/simple_baseline/simple3Dbaseline_h36m-f0ad73a4_20210419.pth") # pose3d="human3d"
|
38 |
+
#https://github.com/open-mmlab/mmpose/tree/main/configs/hand_2d_keypoint/topdown_regression
|
39 |
print("[INFO]: Downloaded models!")
|
40 |
|
41 |
def check_fps(video):
|
|
|
45 |
return nframes, fps
|
46 |
|
47 |
|
48 |
+
def get_frames(video, fps=15, height=512, width=512):
|
49 |
# extract the file name and extension
|
50 |
split_tup = os.path.splitext(video)
|
51 |
|
|
|
61 |
#check fps
|
62 |
if clip.fps > 15:
|
63 |
print("vide rate is over 15, resetting to 15")
|
64 |
+
#clip_resized = moviepy.clip.resize(height=height)
|
65 |
+
clip.write_videofile(video, fps=fps)
|
66 |
else:
|
67 |
print("video rate is OK")
|
68 |
+
#clip_resized = clip.resize(height=height)
|
69 |
+
#clip_resized.write_videofile(video, fps=clip.fps)
|
70 |
|
71 |
print("video resized to 512 height")
|
72 |
|
|
|
121 |
|
122 |
def pose2d(video, kpt_threshold):
|
123 |
video = check_extension(video)
|
124 |
+
get_frames(video)
|
125 |
|
126 |
# Define new unique folder
|
127 |
add_dir = str(uuid.uuid4())
|