解决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

相关推荐
PyHaVolask7 分钟前
Python 爬虫进阶:直接请求 JSON 接口与开发者工具使用
爬虫·python·请求头·反爬·json接口·chrome开发者工具
larance9 分钟前
安装dify的几个问题
python
2301_7735536212 分钟前
CSS如何对用户访问过的链接进行降级颜色处理_使用-visited伪类改变颜色
jvm·数据库·python
2301_8152795219 分钟前
Golang怎么理解Go的sync.Pool底层_Golang如何理解Pool的本地缓存和GC清理机制【详解】
jvm·数据库·python
2301_7641505619 分钟前
MySQL迁移过程如何避免数据不一致_利用强一致性备份方案
jvm·数据库·python
m0_7164300723 分钟前
Redis如何处理预热失效引起的开局雪崩
jvm·数据库·python
m0_3776182325 分钟前
c++文件锁使用方法 c++如何实现多进程文件同步
jvm·数据库·python
gmaajt30 分钟前
mysql多字段搜索如何设计组合索引_mysql索引查询加速
jvm·数据库·python
2301_7775993731 分钟前
MySQL如何快速排查慢查询安全隐患_分析slow_query_log进行优化
jvm·数据库·python
m0_7478545233 分钟前
如何检测受保护链接(如 Twitter)的可访问性
jvm·数据库·python