From d14436f240912c3095af35f8550cf711c7258942 Mon Sep 17 00:00:00 2001 From: Philipp Allgeuer Date: Mon, 11 Jul 2022 16:42:11 +0200 Subject: [PATCH 1/4] Add some missing parameter documentation --- mmpose/models/detectors/pose_lifter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mmpose/models/detectors/pose_lifter.py b/mmpose/models/detectors/pose_lifter.py index 1fcd4d7133..cec880ca24 100644 --- a/mmpose/models/detectors/pose_lifter.py +++ b/mmpose/models/detectors/pose_lifter.py @@ -323,7 +323,12 @@ def show_result(self, vis_height (int): The image height of the visualization. The width will be N*vis_height depending on the number of visualized items. + num_instances (int): Number of instances to be shown in 3D. If + smaller than 0, all the instances in the result will be shown. + Otherwise, pad or truncate the result to a length of + num_instances. win_name (str): The window name. + show (bool): Whether to directly show the visualization. wait_time (int): Value of waitKey param. Default: 0. out_file (str or None): The filename to write the image. From 96e3916f5556e499445269ea65b2453631a1ba05 Mon Sep 17 00:00:00 2001 From: Philipp Allgeuer Date: Mon, 11 Jul 2022 16:42:38 +0200 Subject: [PATCH 2/4] Expose vis_height / axis_azimuth --- mmpose/apis/inference_3d.py | 4 ++++ mmpose/models/detectors/pose_lifter.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mmpose/apis/inference_3d.py b/mmpose/apis/inference_3d.py index 011997d67a..f40f7f20a5 100644 --- a/mmpose/apis/inference_3d.py +++ b/mmpose/apis/inference_3d.py @@ -364,7 +364,9 @@ def vis_3d_pose_result(model, kpt_score_thr=0.3, radius=8, thickness=2, + vis_height=400, num_instances=-1, + axis_azimuth=70, show=False, out_file=None): """Visualize the 3D pose estimation results. @@ -459,7 +461,9 @@ def vis_3d_pose_result(model, thickness=thickness, pose_kpt_color=pose_kpt_color, pose_link_color=pose_link_color, + vis_height=vis_height, num_instances=num_instances, + axis_azimuth=axis_azimuth, show=show, out_file=out_file) diff --git a/mmpose/models/detectors/pose_lifter.py b/mmpose/models/detectors/pose_lifter.py index cec880ca24..6304e8a248 100644 --- a/mmpose/models/detectors/pose_lifter.py +++ b/mmpose/models/detectors/pose_lifter.py @@ -296,6 +296,7 @@ def show_result(self, thickness=2, vis_height=400, num_instances=-1, + axis_azimuth=70, win_name='', show=False, wait_time=0, @@ -327,6 +328,7 @@ def show_result(self, smaller than 0, all the instances in the result will be shown. Otherwise, pad or truncate the result to a length of num_instances. + axis_azimuth (float): axis azimuth angle for 3D visualizations. win_name (str): The window name. show (bool): Whether to directly show the visualization. wait_time (int): Value of waitKey param. @@ -388,7 +390,9 @@ def show_result(self, pose_kpt_color, pose_link_color, vis_height, - num_instances=num_instances) + num_instances=num_instances, + axis_azimuth=axis_azimuth, + ) if show: mmcv.visualization.imshow(img_vis, win_name, wait_time) From 60826a2db8ef37b3f34d0db374985e750fc1fdc3 Mon Sep 17 00:00:00 2001 From: Philipp Allgeuer Date: Tue, 12 Jul 2022 10:14:26 +0200 Subject: [PATCH 3/4] Fix interhand axis_azimuth --- mmpose/apis/inference_3d.py | 2 +- mmpose/models/detectors/interhand_3d.py | 4 +++- mmpose/models/detectors/pose_lifter.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mmpose/apis/inference_3d.py b/mmpose/apis/inference_3d.py index f40f7f20a5..7f9b47f5b6 100644 --- a/mmpose/apis/inference_3d.py +++ b/mmpose/apis/inference_3d.py @@ -366,7 +366,7 @@ def vis_3d_pose_result(model, thickness=2, vis_height=400, num_instances=-1, - axis_azimuth=70, + axis_azimuth=None, show=False, out_file=None): """Visualize the 3D pose estimation results. diff --git a/mmpose/models/detectors/interhand_3d.py b/mmpose/models/detectors/interhand_3d.py index 5a4d6bde1b..8fdab7c426 100644 --- a/mmpose/models/detectors/interhand_3d.py +++ b/mmpose/models/detectors/interhand_3d.py @@ -116,6 +116,7 @@ def show_result(self, pose_link_color=None, vis_height=400, num_instances=-1, + axis_azimuth=None, win_name='', show=False, wait_time=0, @@ -150,6 +151,7 @@ def show_result(self, smaller than 0, all the instances in the pose_result will be shown. Otherwise, pad or truncate the pose_result to a length of num_instances. + axis_azimuth (float): axis azimuth angle for 3D visualizations. win_name (str): The window name. show (bool): Whether to show the image. Default: False. wait_time (int): Value of waitKey param. @@ -213,7 +215,7 @@ def show_result(self, pose_link_color, vis_height, axis_limit=300, - axis_azimuth=-115, + axis_azimuth=-115 if axis_azimuth is None else axis_azimuth, axis_elev=15, kpt_score_thr=kpt_score_thr, num_instances=num_instances) diff --git a/mmpose/models/detectors/pose_lifter.py b/mmpose/models/detectors/pose_lifter.py index 6304e8a248..63f798637a 100644 --- a/mmpose/models/detectors/pose_lifter.py +++ b/mmpose/models/detectors/pose_lifter.py @@ -296,7 +296,7 @@ def show_result(self, thickness=2, vis_height=400, num_instances=-1, - axis_azimuth=70, + axis_azimuth=None, win_name='', show=False, wait_time=0, @@ -391,7 +391,7 @@ def show_result(self, pose_link_color, vis_height, num_instances=num_instances, - axis_azimuth=axis_azimuth, + axis_azimuth=70 if axis_azimuth is None else axis_azimuth, ) if show: From 77ffbda2d919c64fa2c9277f95cff03e0415c032 Mon Sep 17 00:00:00 2001 From: ly015 Date: Wed, 13 Jul 2022 04:05:21 +0800 Subject: [PATCH 4/4] keep original default behavior --- demo/interhand3d_img_demo.py | 1 + mmpose/apis/inference_3d.py | 2 +- mmpose/models/detectors/interhand_3d.py | 4 ++-- mmpose/models/detectors/pose_lifter.py | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/demo/interhand3d_img_demo.py b/demo/interhand3d_img_demo.py index a6dbeff3b9..5aa03d3bee 100644 --- a/demo/interhand3d_img_demo.py +++ b/demo/interhand3d_img_demo.py @@ -251,6 +251,7 @@ def main(): kpt_score_thr=args.kpt_thr, radius=args.radius, thickness=args.thickness, + axis_azimuth=-115, ) diff --git a/mmpose/apis/inference_3d.py b/mmpose/apis/inference_3d.py index 7f9b47f5b6..f40f7f20a5 100644 --- a/mmpose/apis/inference_3d.py +++ b/mmpose/apis/inference_3d.py @@ -366,7 +366,7 @@ def vis_3d_pose_result(model, thickness=2, vis_height=400, num_instances=-1, - axis_azimuth=None, + axis_azimuth=70, show=False, out_file=None): """Visualize the 3D pose estimation results. diff --git a/mmpose/models/detectors/interhand_3d.py b/mmpose/models/detectors/interhand_3d.py index 8fdab7c426..43dd82f8fb 100644 --- a/mmpose/models/detectors/interhand_3d.py +++ b/mmpose/models/detectors/interhand_3d.py @@ -116,7 +116,7 @@ def show_result(self, pose_link_color=None, vis_height=400, num_instances=-1, - axis_azimuth=None, + axis_azimuth=-115, win_name='', show=False, wait_time=0, @@ -215,7 +215,7 @@ def show_result(self, pose_link_color, vis_height, axis_limit=300, - axis_azimuth=-115 if axis_azimuth is None else axis_azimuth, + axis_azimuth=axis_azimuth, axis_elev=15, kpt_score_thr=kpt_score_thr, num_instances=num_instances) diff --git a/mmpose/models/detectors/pose_lifter.py b/mmpose/models/detectors/pose_lifter.py index 63f798637a..6304e8a248 100644 --- a/mmpose/models/detectors/pose_lifter.py +++ b/mmpose/models/detectors/pose_lifter.py @@ -296,7 +296,7 @@ def show_result(self, thickness=2, vis_height=400, num_instances=-1, - axis_azimuth=None, + axis_azimuth=70, win_name='', show=False, wait_time=0, @@ -391,7 +391,7 @@ def show_result(self, pose_link_color, vis_height, num_instances=num_instances, - axis_azimuth=70 if axis_azimuth is None else axis_azimuth, + axis_azimuth=axis_azimuth, ) if show: