AlphaPose icon indicating copy to clipboard operation
AlphaPose copied to clipboard

Issue about the 'scripts/demo_inference.py'

Open workingcoder opened this issue 3 years ago • 10 comments

I have installed the alphapose according to the 'docs/INSTALL.md'.

Env: cuda10.2 python3.6 torch1.1.0

image

However, I encountered a bug when I run the 'demo_inference.py'

python scripts/demo_inference.py --cfg configs/coco/resnet/256x192_res50_lr1e-3_1x-simple.yaml --checkpoint pretrained_models/simple_res50_256x192.pth --indir examples/demo/ --save_img

I get the log with error:

image

Can you explain the reason?

Look forward to your reply.

workingcoder avatar Jan 24 '22 14:01 workingcoder

I also encounter the issue when running the colab demo.

image

workingcoder avatar Jan 24 '22 23:01 workingcoder

It is worth noting that I had no problem running this colab demo a few days ago, so I suspect that the latest update caused this problem and made the repository unusable.

This is an urgent issue. Hope you can fix it as soon as possible.

workingcoder avatar Jan 24 '22 23:01 workingcoder

@workingcoder

I also had this same issue (and was going to create a new issue until I saw yours). The only workaround I have currently is to revert to the repo before the latest set of changes. This indeed proves that it was the latest sets of commits to the repo.

You can do this easily enough using:

!git reset --hard bcfbc997526bcac464d116356ac2efea9483ff68

If your need for using AlphaPose is urgent, you'll be able to still use the model as it was before by running that above. Nevertheless, would be great to have this resolved, since it does break a critical aspect of the AlphaPose project. I can't work out precisely what has broken it, since there were a huge number of changes in the commits made.

BenjaminFraser avatar Jan 26 '22 11:01 BenjaminFraser

Thank you for your comments. I also use the previous version to avoid this issue.

workingcoder avatar Jan 26 '22 22:01 workingcoder

add one line vis_thres.append(vis_thres[-1]), to make the len(vis_thres)==len(kp_scores)

for human in im_res['result']:
        part_line = {}
        kp_preds = human['keypoints']
        kp_scores = human['kp_score']
        if kp_num == 17:
            kp_preds = torch.cat((kp_preds, torch.unsqueeze((kp_preds[5, :] + kp_preds[6, :]) / 2, 0)))
            kp_scores = torch.cat((kp_scores, torch.unsqueeze((kp_scores[5, :] + kp_scores[6, :]) / 2, 0)))
            vis_thres.append(vis_thres[-1])  # add this line

yzbx avatar Jan 27 '22 02:01 yzbx

@yzbx thanks for your answer! I try the method you provided, and it work perfectly. (additionally, the line should be added below line 416)

greatbaozi001 avatar Jan 27 '22 03:01 greatbaozi001

@greatbaozi001 the line should be added below line 416 In which function? I did not find!

NahidEbrahimian avatar Feb 12 '22 08:02 NahidEbrahimian

@NahidEbrahimian In the utils/vis.py.

greatbaozi001 avatar Feb 16 '22 03:02 greatbaozi001

@greatbaozi001 thanks for your answer. it work perfectly.

NahidEbrahimian avatar Feb 16 '22 05:02 NahidEbrahimian

Thanks! We have merged it!

HaoyiZhu avatar Feb 16 '22 14:02 HaoyiZhu