From 19bb1a6372477f313adc03403cbbfbcade7d6b9d Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 19 Dec 2024 11:12:13 +0100 Subject: [PATCH] Use fp32 model for whole-body poses. --- scripts/test_skelda_dataset.py | 6 ++++-- scripts/utils_2d_pose_ort.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/test_skelda_dataset.py b/scripts/test_skelda_dataset.py index a5bb04e..6714f09 100644 --- a/scripts/test_skelda_dataset.py +++ b/scripts/test_skelda_dataset.py @@ -190,9 +190,11 @@ eval_joints = [ "ankle_left", "ankle_right", ] -if dataset_use in ["human36m", "panoptic"]: +if dataset_use == "human36m": 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())): eval_joints = list(joint_names_2d) else: diff --git a/scripts/utils_2d_pose_ort.py b/scripts/utils_2d_pose_ort.py index 944d5a4..5331f19 100644 --- a/scripts/utils_2d_pose_ort.py +++ b/scripts/utils_2d_pose_ort.py @@ -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): print("Loading 2D-WB model ...") + # The FP16 pose model is much worse than the FP32 for whole-body keypoints model = TopDown( "/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_min_area=min_bbox_area, warmup=30,