xtcocotools库通常用来评估coco数据集,它的作用和pycocotools作用等价,常用在人体姿态估计(关键点检测)中。
我们在使用xtcocotools库评估指标的时候,在进行到eval.evaluate()时可能会报以下错误:
OverflowError Python int too large to convert to C long
错误原因:xtcocotools的版本问题
如果直接使用pip install xtcocotools安装该库的话会默认安装最新版本1.12的,在评估指标时就会报上述错。
解决办法一:降低版本
使用下面指令将版本降低到1.11.5
pip install xtcocotools==1.11.5
解决办法二:使用pycocotools库代替
只需要将框起来的代码注释互换即可
完成以上操作即可正常执行test.py 正常输出: