diff --git a/src/nrtk_explorer/app/images/stateful_annotations.py b/src/nrtk_explorer/app/images/stateful_annotations.py index 970eb99..69bf7b8 100644 --- a/src/nrtk_explorer/app/images/stateful_annotations.py +++ b/src/nrtk_explorer/app/images/stateful_annotations.py @@ -90,7 +90,7 @@ def __init__( add_to_cache_callback, delete_from_cache_callback ) - @change("current_dataset", "object_detection_model") + @change("current_dataset", "inference_model") def _cache_clear(self, **kwargs): self.annotations_factory.cache_clear() diff --git a/src/nrtk_explorer/app/transforms.py b/src/nrtk_explorer/app/transforms.py index fea42de..0281f93 100644 --- a/src/nrtk_explorer/app/transforms.py +++ b/src/nrtk_explorer/app/transforms.py @@ -106,7 +106,7 @@ def __init__( known_args, _ = self.server.cli.parse_known_args() self.state.inference_models = known_args.models - self.state.object_detection_model = self.state.inference_models[0] + self.state.inference_model = self.state.inference_models[0] self.state.setdefault("image_list_ids", []) self.state.setdefault("dataset_ids", []) self.state.setdefault("user_selected_ids", []) @@ -204,17 +204,15 @@ def delete_meta_state(old_ids, new_ids): self.visible_dataset_ids = [] # set by ImageList via self.on_scroll callback def on_server_ready(self, *args, **kwargs): - self.state.change("object_detection_model")(self.on_object_detection_model_change) - self.on_object_detection_model_change() + self.state.change("inference_model")(self.on_inference_model_change) + self.on_inference_model_change() self.state.change("current_dataset")(self._cancel_update_images) self.state.change("current_dataset")(self.reset_detector) - def on_object_detection_model_change(self, **kwargs): + def on_inference_model_change(self, **kwargs): self.original_detection_annotations.cache_clear() self.transformed_detection_annotations.cache_clear() - self.detector = object_detector.ObjectDetector( - model_name=self.state.object_detection_model - ) + self.detector = object_detector.ObjectDetector(model_name=self.state.inference_model) self._start_update_images() def reset_detector(self, **kwargs): diff --git a/src/nrtk_explorer/app/ui/layout.py b/src/nrtk_explorer/app/ui/layout.py index 3fc3b84..8d6ed48 100644 --- a/src/nrtk_explorer/app/ui/layout.py +++ b/src/nrtk_explorer/app/ui/layout.py @@ -66,8 +66,8 @@ def __init__( html.Span("Model Inference", classes="text-h6") with card.slot_content: quasar.QSelect( - label="Object Detection Model", - v_model=("object_detection_model", "facebook/detr-resnet-50"), + label="Inference Model", + v_model=("inference_model", "facebook/detr-resnet-50"), options=("inference_models", []), filled=True, emit_value=True,