long blogs

进一步有进一步惊喜


  • Home
  • Archive
  • Tags
  •  

© 2025 long

Theme Typography by Makito

Proudly published with Hexo

labelIm的bug修复

Posted at 2025-08-11 python 

概述

在新的python版本中,编译labelImg会崩溃。

解决方案

在libs/canvas.py文件中,修改如下代码。

1
2
3
4
5
6
7
8

- if Qt.RightButton & ev.buttons():
+ if Qt.RightButton == ev.buttons():

# Polygon/Vertex moving.
- if Qt.LeftButton & ev.buttons():
+ if Qt.LeftButton == ev.buttons():

在labelImg.py文件中,修改成如下代码。

1
2
3
4
5
6
7

- self.dock_features = QDockWidget.DockWidgetClosable | QDockWidget.DockWidgetFloatable
- self.dock.setFeatures(self.dock.features() ^ self.dock_features)
+ self.dock_features = int(QDockWidget.DockWidgetClosable | QDockWidget.DockWidgetFloatable)
+ cfeatures = int(self.dock.features())
+ self.dock.setFeatures(QDockWidget.DockWidgetFeatures(cfeatures ^ self.dock_features))

Share 

 Previous post: 允许一切发生 Next post: yolov5自己训练数据使用指南 

© 2025 long

Theme Typography by Makito

Proudly published with Hexo