解决pycococreatortools安装问题

我的环境:

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

相关推荐
li99yo2 小时前
3DGS的复现
图像处理·pytorch·经验分享·python·3d·conda·pip
Dontla6 小时前
用pip install -e .开发Python包时,Python项目目录结构(项目结构)(可编辑安装editable install)
python·pip
Thomas.Sir6 小时前
第三章:Python3 之 字符串
开发语言·python·字符串·string
威联通网络存储7 小时前
告别掉帧与素材损毁:威联通 QuTS hero 如何重塑影视后期协同工作流
前端·网络·人工智能·python
Dxy12393102167 小时前
Python 根据列表中某字段排序:从基础到进阶
开发语言·windows·python
splage7 小时前
Java进阶——IO 流
java·开发语言·python
cliffordl7 小时前
设计模式(python)
python·设计模式
always_TT8 小时前
从Python_Java转学C语言需要注意什么?
java·c语言·python
2301_793804698 小时前
定时任务专家:Python Schedule库使用指南
jvm·数据库·python