From 08db03a36de0b5eb590ce08a76e5f7d6b27a8010 Mon Sep 17 00:00:00 2001 From: tzutalin Date: Sat, 12 Sep 2020 10:59:57 -0700 Subject: [PATCH] rename functions --- labelImg.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/labelImg.py b/labelImg.py index cf82f1ef..657163e1 100755 --- a/labelImg.py +++ b/labelImg.py @@ -209,7 +209,7 @@ class MainWindow(QMainWindow, WindowMixin): opendir = action(getStr('openDir'), self.openDirDialog, 'Ctrl+u', 'open', getStr('openDir')) - + copyPrevBounding = action(getStr('copyPrevBounding'), self.copyPreviousBoundingBoxes, 'Ctrl+v', 'paste', getStr('copyPrevBounding')) @@ -1063,8 +1063,8 @@ class MainWindow(QMainWindow, WindowMixin): self.adjustScale(initial=True) self.paintCanvas() self.addRecentFile(self.filePath) - self.toggleActions(True) - self.showXmlBoundingBoxes(filePath) + self.toggleActions(True) + self.showBoundingBoxFromAnnotationFile(filePath) self.setWindowTitle(__appname__ + ' ' + filePath) @@ -1077,7 +1077,7 @@ class MainWindow(QMainWindow, WindowMixin): return True return False - def showXmlBoundingBoxes(self, filePath): + def showBoundingBoxFromAnnotationFile(self, filePath): if self.defaultSaveDir is not None: basename = os.path.basename( os.path.splitext(filePath)[0]) @@ -1500,11 +1500,11 @@ class MainWindow(QMainWindow, WindowMixin): def copyPreviousBoundingBoxes(self): currIndex = self.mImgList.index(self.filePath) - prevFilePath = self.mImgList[currIndex - 1] - - self.showXmlBoundingBoxes(prevFilePath) - self.saveFile() - + if currIndex - 1 >= 0: + prevFilePath = self.mImgList[currIndex - 1] + self.showBoundingBoxFromAnnotationFile(prevFilePath) + self.saveFile() + def togglePaintLabelsOption(self): for shape in self.canvas.shapes: shape.paintLabel = self.displayLabelOption.isChecked()