运行模型问题
作者您好,我在运行您的模型时,输出mesh等功能正常,但是输出center_conf时会报错,请问这是否和图片格式有关?我可以怎样调整去解决?
具体报错如下:
(base) wangyang@wangyangdeMacBook-Pro ~ % romp --mode=image --calc_smpl --render_mesh --input=/Users/wangyang/Downloads/3323.JPG --save_path=/Users/wangyang/Downloads/893.JPG --show_items=center_conf
Using ROMP v1
/Users/wangyang/opt/anaconda3/lib/python3.8/site-packages/romp/post_parser.py:34: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
topk_ys = (topk_inds.long() // w).float()
/Users/wangyang/opt/anaconda3/lib/python3.8/site-packages/romp/post_parser.py:39: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
topk_clses = index.long() // K
/Users/wangyang/opt/anaconda3/lib/python3.8/site-packages/romp/post_parser.py:144: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
parsed_results['centers_pred'] = torch.stack([flat_inds%64, flat_inds//64],1) * 512 // 64
Traceback (most recent call last):
File "/Users/wangyang/opt/anaconda3/bin/romp", line 8, in
IndexError: list index out of range
Oh, please at least include the image,mesh in the show_items .
The code is to draw the center confidence on the rendered mesh image. Without image,mesh in show_items, it has no where to draw on.
Please set --show_items=image,mesh, center_conf
按照您的方法设置后:
(base) wangyang@wangyangdeMacBook-Pro ~ % romp --mode=image --calc_smpl --render_mesh --input=/Users/wangyang/Downloads/3323.jpg --save_path=/Users/wangyang/Downloads/83.jpg --show_items=image,mesh,center_conf
但是会报错:
File "/Users/wangyang/opt/anaconda3/lib/python3.8/site-packages/vis_human/main.py", line 101, in rendering_romp_bev_results
cv2.putText(result_image[1], '{:.3f}'.format(outputs['top_score'][ind]), tuple(kp.astype(int)), cv2.FONT_HERSHEY_COMPLEX,1,(255,0,255),1)
KeyError: 'top_score'
请问您这个怎么解决,麻烦您了!
感谢bug report,这是因为在bev和romp里对同一个东西的命名不同,bev里叫top_score,romp里叫centers_conf。
所以如果想直接跑,不修正这个bug的话,需要用bev来跑结果。就是把romp换成bev,其他命令都一样。
要是还是想用romp,就是更新一下romp。我刚推了一版统一了这个名称的版本到GitHub,要用新的, 先在ROMP里git pull更新一下,当然您也可以照着这个commit手动修改一下 然后到simple-romp里重新安装一下
cd ROMP/simple-romp
python setup.py install