facebookresearch / sapiens

High-resolution models for human tasks.
https://about.meta.com/realitylabs/codecavatars/sapiens/
Other
4.53k stars 258 forks source link

Possible Issue with `bboxes_batch` Initialization in `lite/demo/vis_pose.py` #170

Closed FrankWuuu closed 6 days ago

FrankWuuu commented 6 days ago

Hi,

I've been working with the lite version of the pose estimation demo, specifically the file lite/demo/vis_pose.py. I noticed a potential issue with the initialization of bboxes_batch in lines 394 to 398. The current code is as follows:

for i, bboxes in enumerate(bboxes_batch):
    if len(bboxes) == 0:
        bboxes_batch[i] = np.array(
            [[0, 0, orig_img_shape[1], orig_img_shape[0]]]
        )

It seems like the last element of the array should use orig_img_shape[2] instead of orig_img_shape[0]. Therefore, the corrected version might look like this:

for i, bboxes in enumerate(bboxes_batch):
    if len(bboxes) == 0:
        bboxes_batch[i] = np.array(
            [[0, 0, orig_img_shape[1], orig_img_shape[2]]]
        )

This change aligns with the typical (height, width) order, cuz orig_img_shape follows the format (B, H, W, C).

Could you please verify whether this adjustment is necessary? Thank you for your attention to this detail!

Best regards, Frank Wu

rawalkhirodkar commented 6 days ago

@FrankWuuu thank you for spotting this. When the detection failed, this would result in incorrect bbox size. Your PR is merged.