当前位置:网站首页>Labelme-5.0.1 version edit polygon crash
Labelme-5.0.1 version edit polygon crash
2022-08-10 21:26:00 【Programmers who don't like to code】
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)
debugIt was found that the index was exceeded when looking for tags,解决方案:找不到item就直接返回(0, 255, 0),Just change the method to the above code
边栏推荐
猜你喜欢
随机推荐
【一致性hash】负载均衡器分发请求
着力提升制造业核心竞争力,仪器仪表产业迎高质量发展
这些mysql基础命令、基础知识还记得吗?(面试,学习,复习都可以)一万三千字总结
睡前故事|用Bitmap与AST做一个配置化时长系统
管理员必须知道的RADIUS认证服务器的部署成本
2021DozerCTF
【实用软件】【VSCode】使用技巧大全(持续更新)
Kubernetes Notes / Getting Started / Production Environment / Installing Kubernetes with Deployment Tools / Starting a Cluster with kubeadm / Creating a Cluster with kubeadm
机器学习笔记:t-SNE
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
CGO 初步认知和基本数据类型转换
UPDATE:修改数据语法使用例——《mysql 从入门到内卷再到入土》
wget编译升级故障解决
paddle 35 paddledetection保存训练过程中的log信息
国内Gravatar头像的完美替代方案Cravatar
D. Game With Array
PROCEDURE :存储过程结构——《mysql 从入门到内卷再到入土》
图数据库(Neo4j)入门
如何提高代码的可读性 学习笔记
Detailed explanation and use of each module of ansible