当前位置:网站首页>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),将该方法改为以上的代码就行
边栏推荐
猜你喜欢
随机推荐
wget编译升级故障解决
关于 NFT 版权保护的争议
D. Game With Array
优化是一种习惯●出发点是'站在靠近临界'的地方
扩展中国剩余定理
用示波器揭示以太网传输机制
2022.8.9 模拟赛
函数:函数删除操作语法&使用例——《mysql 从入门到内卷再到入土》
查询:复杂查询的语法和使用例——《mysql 从入门到内卷再到入土》
一次由groovy引起的fullGC问题排查
Detailed explanation and use of each module of ansible
突破次元壁垒,让身边的玩偶手办在屏幕上动起来!
睡前故事|用Bitmap与AST做一个配置化时长系统
DDL:视图——《mysql 从入门到内卷再到入土》
ctfshow-osint
详叙c中的分支与循环
Object.assign用法 以及 与$.extend的区别
C语言详解系列——关于调试那些事
Kubernetes Notes / Getting Started / Production Environment / Installing Kubernetes with Deployment Tools / Starting a Cluster with kubeadm / Creating a Cluster with kubeadm
leetcode:45. 跳跃游戏II