我的环境:
python:3.8.18
numpy:1.24.4
问题一:
用git文档的方法下载失败:
pip install git+git://github.com/waspinator/coco.git@2.1.0
解决:
用这行 pip install git+https://github.com/waspinator/pycococreator.git
问题二:使用pycococreatortools.binary_mask_to_polygon的时候报错
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
解决:
在这个函数定义内加上一行 contours=sorted(contours,key=lambda x: len(x),reverse=True)[0:1]
所有这些问题都在git的issue里有
https://github.com/waspinator/pycococreator/issues?page=1&q=is%3Aissue+is%3Aopen