mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

[Bug] Image width and Image heights have inconsistent definitions in transform functions

Open mkabra opened this issue 1 year ago • 0 comments

Prerequisite

  • [X] I have searched Issues and Discussions but cannot get the expected help.
  • [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmpose).

Environment

In the data processing pipeline for bottom-up pose estimation, the conventions used for results['input_size'] are inconsistent in the common_transforms.py flip function (https://github.com/open-mmlab/mmpose/blob/5a3be9451bdfdad2053a90dc1199e3ff1ea1a409/mmpose/datasets/transforms/common_transforms.py#L209) and bottom up random affine function (https://github.com/open-mmlab/mmpose/blob/5a3be9451bdfdad2053a90dc1199e3ff1ea1a409/mmpose/datasets/transforms/bottomup_transforms.py#L337, https://github.com/open-mmlab/mmpose/blob/5a3be9451bdfdad2053a90dc1199e3ff1ea1a409/mmpose/datasets/transforms/bottomup_transforms.py#L408). This bug doesn't show for most common bottom-up cases because the height and widths usually are the same. But when height and width are different, the flip function keypoint outputs are incorrect.

The fix is to change Line 209 in common_transforms.py to w, h = results.get('input_size', results['img_shape']). Unless it clashes with definitions used in top-down transforms

Reproduces the problem - code sample

Not relevant. (Maybe running dekr on crowdpose with 640x512 image size?)

Reproduces the problem - command or script

Not relevant

Reproduces the problem - error message

Not relevant. The program runs fine but the trained model is not proper.

Additional information

Not applicable

mkabra avatar Apr 15 '24 09:04 mkabra