diff --git a/sam_ann/widgets/mainwindow.py b/sam_ann/widgets/mainwindow.py index 5f52ad0..ee628b7 100644 --- a/sam_ann/widgets/mainwindow.py +++ b/sam_ann/widgets/mainwindow.py @@ -44,7 +44,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.current_index = None self.current_file_index: int = None - self.current_label = '__background__' + self.current_cat = '__background__' self.current_group = 1 self.config_file = CONFIG_FILE if os.path.exists(CONFIG_FILE) else DEFAULT_CONFIG_FILE @@ -351,7 +351,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def show_image(self, index:int): self.reset_action() - self.current_label = None self.load_finished = False self.saved = True if not -1 < index < len(self.files_list): @@ -368,8 +367,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.actionFinish.setEnabled(True) self.actionCancel.setEnabled(True) self.actionVisible.setEnabled(True) + self.load_finished = True return try: + self.current_label = None + self.scene.cancel_draw() self.polygons.clear()