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

相关推荐
卷无止境3 小时前
用 SimPy 做离散事件仿真:时钟不走步,事件自己排队
后端·python
撸码猿4 小时前
数据采集场景的语序点选验证码:90.2% 整词准确率的本地 OCR 实践
python·ocr
用户0332126663674 小时前
使用 Python 在 Excel 中创建折线图和条形图
python·excel
木子欢儿5 小时前
Ubuntu 26.04 LTS 安装Python 3.12
linux·运维·服务器·python·ubuntu
Wellijohn5 小时前
Python 异步并发:我把 5 个坑踩完了,你照着抄模板就行
python
AI创界者6 小时前
Python 进阶实战(六十二章):分布式定时任务、异步工作流与幂等补偿机制实战
人工智能·python·aigc
炸薯条!7 小时前
Python面向对象基础:类与对象、实例方法、魔法方法和属性详解
java·开发语言·python
tryCbest8 小时前
Python 爬虫从入门到实战(二):进阶篇——反爬对抗、并发与动态页面
开发语言·爬虫·python
VIP_CQCRE8 小时前
GPT Image 2.6 动态表情交付别只发预览:GIF 文件校验、哈希清单与下载排错
图像处理·人工智能·python·gif
2601_967987378 小时前
使用 NumPy 和 Python 实现梯度下降
python·机器学习·线性回归·numpy·梯度下降