bearpaw / pytorch-pose

A PyTorch toolkit for 2D Human Pose Estimation.
GNU General Public License v3.0
1.11k stars 253 forks source link

some question on preprocessing mpii #73

Closed nitba closed 5 years ago

nitba commented 5 years ago

Hi @bearpaw , Thank you so much for your great job, I have one question when this condition occur in dataset? what kind of situations it cares about https://github.com/bearpaw/pytorch-pose/blob/0f8ace7d425cfc6872a19c5ed70c8580fcdfeb08/pose/utils/transforms.py#L140

Thanks,

bearpaw commented 5 years ago
        if new_size < 2:
            return torch.zeros(res[0], res[1], img.shape[2]) \
                        if len(img.shape) > 2 else torch.zeros(res[0], res[1])

If the cropped region is less than 2 pixel, then it's just a one-pixel region. In this case, we just return a "blank" image with predefined resolution (e.g. 256x256).

Usually, this will never happen unless there are errors in groundtruth annotations.