删除多边形时出错,如下
[INFO ] __init__:get_config:71 - Loading config file from: /home/fl/.labelmerc
Traceback (most recent call last):
File "/home/fl/anaconda3/envs/labelme/lib/python2.7/site-packages/labelme/app.py", line 1866, in deleteSelectedShape
self.remLabels(self.canvas.deleteSelected())
File "/home/fl/anaconda3/envs/labelme/lib/python2.7/site-packages/labelme/app.py", line 1146, in remLabels
self.labelList.removeItem(item)
File "/home/fl/anaconda3/envs/labelme/lib/python2.7/site-packages/labelme/widgets/label_list_widget.py", line 171, in removeItem
self.model().removeRows(index.row(), 1)
File "/home/fl/anaconda3/envs/labelme/lib/python2.7/site-packages/labelme/widgets/label_list_widget.py", line 102, in removeRows
ret = super().removeRows(*args, **kwargs)
TypeError: super() takes at least 1 argument (0 given)
Aborted (core dumped)
是python用法问题,参见https://blog.csdn.net/u010812071/article/details/76038833
所以编辑
/home/fl/anaconda3/envs/labelme/lib/python2.7/site-packages/labelme/widgets/label_list_widget.py
改为如下即可
def removeRows(self, *args, **kwargs):
ret = super(StandardItemModel, self).removeRows(*args, **kwargs)
self.itemDropped.emit()
return ret