diff --git a/labelImg.py b/labelImg.py index bfe46f53..beaf91d6 100755 --- a/labelImg.py +++ b/labelImg.py @@ -1092,16 +1092,15 @@ class MainWindow(QMainWindow, WindowMixin): def saveFile(self, _value=False): if self.defaultSaveDir is not None and len(ustr(self.defaultSaveDir)): - # print('handle the image:' + self.filePath) if self.filePath: imgFileName = os.path.basename(self.filePath) - savedFileName = os.path.splitext(imgFileName)[0] + LabelFile.suffix + savedFileName = os.path.splitext(imgFileName)[0] + XML_EXT savedPath = os.path.join(ustr(self.defaultSaveDir), savedFileName) self._saveFile(savedPath) else: imgFileDir = os.path.dirname(self.filePath) imgFileName = os.path.basename(self.filePath) - savedFileName = os.path.splitext(imgFileName)[0] + LabelFile.suffix + savedFileName = os.path.splitext(imgFileName)[0] + XML_EXT savedPath = os.path.join(imgFileDir, savedFileName) self._saveFile(savedPath if self.labelFile else self.saveFileDialog()) diff --git a/libs/pascal_voc_io.py b/libs/pascal_voc_io.py index 9119381f..eefb3459 100644 --- a/libs/pascal_voc_io.py +++ b/libs/pascal_voc_io.py @@ -158,6 +158,8 @@ class PascalVocReader: bndbox = object_iter.find("bndbox") label = object_iter.find('name').text # Add chris - difficult = bool(int(object_iter.find('difficult').text)) + difficult = False + if object_iter.find('difficult') is not None: + difficult = bool(int(object_iter.find('difficult').text)) self.addShape(label, bndbox, difficult) return True diff --git a/setup.cfg b/setup.cfg index 8a15c78f..abf7d038 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.3.1 +current_version = 1.3.2 commit = True tag = True diff --git a/setup.py b/setup.py index 97bbddc5..7cc89e35 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ test_requirements = [ setup( name='labelImg', - version='1.3.1', + version='1.3.2', description="LabelImg is a graphical image annotation tool and label object bounding boxes in images", long_description=readme + '\n\n' + history, author="TzuTa Lin",