Skip to content

Commit

Permalink
[Enhance] Improve control of 3D visualisation of pose lifter (#1481)
Browse files Browse the repository at this point in the history
* Add some missing parameter documentation

* Expose vis_height / axis_azimuth

* Fix interhand axis_azimuth

* keep original default behavior

Co-authored-by: ly015 <liyining0712@gmail.com>
  • Loading branch information
pallgeuer and ly015 authored Jul 12, 2022
1 parent 3c8e19f commit afb37d4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions demo/interhand3d_img_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def main():
kpt_score_thr=args.kpt_thr,
radius=args.radius,
thickness=args.thickness,
axis_azimuth=-115,
)


Expand Down
4 changes: 4 additions & 0 deletions mmpose/apis/inference_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion mmpose/models/detectors/interhand_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def show_result(self,
pose_link_color=None,
vis_height=400,
num_instances=-1,
axis_azimuth=-115,
win_name='',
show=False,
wait_time=0,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -213,7 +215,7 @@ def show_result(self,
pose_link_color,
vis_height,
axis_limit=300,
axis_azimuth=-115,
axis_azimuth=axis_azimuth,
axis_elev=15,
kpt_score_thr=kpt_score_thr,
num_instances=num_instances)
Expand Down
11 changes: 10 additions & 1 deletion mmpose/models/detectors/pose_lifter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -323,7 +324,13 @@ 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.
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.
Default: 0.
out_file (str or None): The filename to write the image.
Expand Down Expand Up @@ -383,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)
Expand Down

0 comments on commit afb37d4

Please sign in to comment.