Use fp32 model for whole-body poses.

This commit is contained in:
Daniel
2024-12-19 11:12:13 +01:00
parent 1bb7dd966e
commit 19bb1a6372
2 changed files with 6 additions and 3 deletions

View File

@ -190,9 +190,11 @@ eval_joints = [
"ankle_left", "ankle_left",
"ankle_right", "ankle_right",
] ]
if dataset_use in ["human36m", "panoptic"]: if dataset_use == "human36m":
eval_joints[eval_joints.index("head")] = "nose" eval_joints[eval_joints.index("head")] = "nose"
if dataset_use.endswith("_wb"): if dataset_use == "panoptic":
eval_joints[eval_joints.index("head")] = "nose"
if dataset_use == "human36m_wb":
if any((test_triangulate.whole_body.values())): if any((test_triangulate.whole_body.values())):
eval_joints = list(joint_names_2d) eval_joints = list(joint_names_2d)
else: else:

View File

@ -482,9 +482,10 @@ def load_model(min_bbox_score=0.3, min_bbox_area=0.1 * 0.1, batch_poses=False):
def load_wb_model(min_bbox_score=0.3, min_bbox_area=0.1 * 0.1, batch_poses=False): def load_wb_model(min_bbox_score=0.3, min_bbox_area=0.1 * 0.1, batch_poses=False):
print("Loading 2D-WB model ...") print("Loading 2D-WB model ...")
# The FP16 pose model is much worse than the FP32 for whole-body keypoints
model = TopDown( model = TopDown(
"/RapidPoseTriangulation/extras/mmdeploy/exports/rtmdet-nano_1x320x320x3_fp16_extra-steps.onnx", "/RapidPoseTriangulation/extras/mmdeploy/exports/rtmdet-nano_1x320x320x3_fp16_extra-steps.onnx",
f"/RapidPoseTriangulation/extras/mmdeploy/exports/rtmpose-l_wb_{'B' if batch_poses else '1'}x384x288x3_fp16_extra-steps.onnx", f"/RapidPoseTriangulation/extras/mmdeploy/exports/rtmpose-l_wb_{'B' if batch_poses else '1'}x384x288x3_extra-steps.onnx",
box_conf_threshold=min_bbox_score, box_conf_threshold=min_bbox_score,
box_min_area=min_bbox_area, box_min_area=min_bbox_area,
warmup=30, warmup=30,