diff --git a/client/controller/instance_annotator_controller.py b/client/controller/instance_annotator_controller.py index 646b6e3..0f23e3c 100644 --- a/client/controller/instance_annotator_controller.py +++ b/client/controller/instance_annotator_controller.py @@ -159,6 +159,7 @@ def open_image(self, image_id): print(self.model.active._list) self.model.tool.set_current_image_id(image_id) + self.model.tool.set_current_layer_name(None) def save_image(self, image_canvas): """ diff --git a/client/screens/paint_window.py b/client/screens/paint_window.py index dec213f..b64fa2f 100644 --- a/client/screens/paint_window.py +++ b/client/screens/paint_window.py @@ -280,9 +280,9 @@ def set_color(self, color, name=None): name = self._layer_manager.get_selected() if name is None: return - layer_data = self._layer_manager.get(name) try: + layer_data = self._layer_manager.get(name) mat = layer_data[STACK_KEY] if np.any(color): mat[np.all(mat != (0, 0, 0), axis=-1)] = color diff --git a/database/create_database.sql b/database/create_database.sql index b6ad86c..c71e4d2 100644 --- a/database/create_database.sql +++ b/database/create_database.sql @@ -1,6 +1,22 @@ -CREATE DATABASE IF NOT EXISTS `fadb` +CREATE DATABASE IF NOT EXISTS `fadb`; USE `fadb`; +-- +-- Table structure for table `project` +-- + +DROP TABLE IF EXISTS `project`; +CREATE TABLE `project` ( + `project_id` int NOT NULL AUTO_INCREMENT, + `project_name` varchar(80) NOT NULL, + `last_uploaded` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `unlabeled_count` int NOT NULL DEFAULT '0', + `labeled_count` int NOT NULL DEFAULT '0', + PRIMARY KEY (`project_id`), + UNIQUE KEY `project_id_UNIQUE` (`project_id`), + UNIQUE KEY `project_name_UNIQUE` (`project_name`) +) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + -- -- Table structure for table `image` -- @@ -41,18 +57,3 @@ CREATE TABLE `instance_seg_meta` ( CONSTRAINT `image_fid` FOREIGN KEY (`image_id`) REFERENCES `image` (`image_id`) ) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; --- --- Table structure for table `project` --- - -DROP TABLE IF EXISTS `project`; -CREATE TABLE `project` ( - `project_id` int NOT NULL AUTO_INCREMENT, - `project_name` varchar(80) NOT NULL, - `last_uploaded` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `unlabeled_count` int NOT NULL DEFAULT '0', - `labeled_count` int NOT NULL DEFAULT '0', - PRIMARY KEY (`project_id`), - UNIQUE KEY `project_id_UNIQUE` (`project_id`), - UNIQUE KEY `project_name_UNIQUE` (`project_name`) -) ENGINE=InnoDB AUTO_INCREMENT=119 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; \ No newline at end of file