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

相关推荐
半兽先生12 小时前
大模型技术开发与应用——5.大模型Agent开发(CrewAI)
大数据·人工智能·python·机器学习·ai
眼泪划过的星空12 小时前
快速了解LangGraph:构建智能Agent工作流的核心框架
人工智能·python·langchain
IsSh9nj6q13 小时前
Python全栈应用搭建神器magic-dash .新版本介绍
开发语言·python·dash
Cachel wood13 小时前
hands-on-modern-rl:动手学强化学习策略梯度reinforce
开发语言·python
蓝斯49714 小时前
一碰即传,重构跨设备文件分享体验
开发语言·python·重构
寒水馨14 小时前
macOS下载、安装uv-0.12.0(附安装包uv-aarch64-apple-darwin.tar.gz)
python·macos·rust·项目管理·包管理器·astral·pip替代
码云骑士15 小时前
85-Prompt是一门工程-结构化分层-System-vs-User-Prompt
python·prompt
qq_225891746615 小时前
基于Python的中药药材数据可视化分析系统
python·机器学习·数据分析·django
卷无止境15 小时前
LangExtract:让LLM从杂乱文本中"抠"出结构化数据的开源工具
后端·python