AlphaPose
AlphaPose copied to clipboard
Issue about the 'scripts/demo_inference.py'
I have installed the alphapose according to the 'docs/INSTALL.md'.
Env: cuda10.2 python3.6 torch1.1.0
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:
Can you explain the reason?
Look forward to your reply.
I also encounter the issue when running the colab demo.
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
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.
Thank you for your comments. I also use the previous version to avoid this issue.
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 thanks for your answer! I try the method you provided, and it work perfectly. (additionally, the line should be added below line 416)
@greatbaozi001 the line should be added below line 416 In which function? I did not find!
@NahidEbrahimian In the utils/vis.py.
@greatbaozi001 thanks for your answer. it work perfectly.
Thanks! We have merged it!