当前位置:网站首页>labelme-5.0.1版本编辑多边形闪退
labelme-5.0.1版本编辑多边形闪退
2022-08-10 20:55:00 【不爱打代码的程序员】
def _get_rgb_by_label(self, label):
if self._config["shape_color"] == "auto":
items = self.uniqLabelList.findItemsByLabel(label)
if items:
item = items[0]
else:
return (0, 255, 0)
label_id = self.uniqLabelList.indexFromItem(item).row() + 1
label_id += self._config["shift_auto_shape_color"]
return LABEL_COLORMAP[label_id % len(LABEL_COLORMAP)]
elif (
self._config["shape_color"] == "manual"
and self._config["label_colors"]
and label in self._config["label_colors"]
):
return self._config["label_colors"][label]
elif self._config["default_shape_color"]:
return self._config["default_shape_color"]
return (0, 255, 0)
debug发现找标签时超出索引,解决方案:找不到item就直接返回(0, 255, 0),将该方法改为以上的代码就行
边栏推荐
- npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead.
- APP application related instructions in Auto.js
- The use of TortoiseSVN little turtle
- 2021 GKCTF X DASCTF应急挑战杯
- ctfshow-osint
- JS中的filter、map、reduce
- CGO 初步认知和基本数据类型转换
- ArcGIS自动随机生成采样点的方法
- UPDATE:修改数据语法使用例——《mysql 从入门到内卷再到入土》
- 国内Gravatar头像的完美替代方案Cravatar
猜你喜欢
随机推荐
ArcMap创建镶嵌数据集、导入栅格图像并修改像元数值显示范围
地理探测器Geodetector软件的下载、应用与结果解读
图数据库(Neo4j)入门
QSslSocket has not been declared
【一致性hash】负载均衡器分发请求
GAN CFOP
图扑智慧电力可视化大屏,赋能虚拟电厂精准减碳
睡前故事|用Bitmap与AST做一个配置化时长系统
[Golang]如何优雅管理系统中的几十个UDF(API)
化学制品制造业数智化供应链管理系统:建立端到端供应链采购一体化平台
面向未来的 IT 基础设施管理架构——融合云(Unified IaaS)
社区分享|货拉拉通过JumpServer纳管大规模云上资产
第14届全国大学生信息安全竞赛-创新实践能力赛
《mysql 从入门到内卷再到入土》——Mysql基础 学习笔记目录
The use of TortoiseSVN little turtle
B. Same Parity Summands
HGAME 2022 Week2 writeup by pankas
Oracle 的开窗函数使用详解(二)
B. Codeforces Subsequences
2021 CybricsCTF