解决pycococreatortools安装问题

我的环境:

python:3.8.18

numpy:1.24.4

问题一:

用git文档的方法下载失败:

pip install git+git://github.com/waspinator/[email protected]

解决pycococreatortools安装问题_第1张图片 解决:

用这行 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]

解决pycococreatortools安装问题_第2张图片

所有这些问题都在git的issue里有

https://github.com/waspinator/pycococreator/issues?page=1&q=is%3Aissue+is%3Aopen

你可能感兴趣的:(python)