From c96258e674bd22590864f72ef6ac98fb867f6115 Mon Sep 17 00:00:00 2001 From: "Kim, Vinnam" Date: Mon, 15 Apr 2024 10:43:14 +0900 Subject: [PATCH] Fix Signed-off-by: Kim, Vinnam --- src/otx/core/model/detection.py | 2 +- src/otx/core/model/instance_segmentation.py | 2 +- tests/unit/core/model/test_detection.py | 11 ----------- tests/unit/core/model/test_inst_segmentation.py | 11 ----------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/otx/core/model/detection.py b/src/otx/core/model/detection.py index 83efb5641ba..8f4a609931c 100644 --- a/src/otx/core/model/detection.py +++ b/src/otx/core/model/detection.py @@ -183,7 +183,7 @@ def __init__( torch_compile=torch_compile, ) - from otx.algo.hooks.recording_forward_hook import get_feature_vector + from otx.algo.explain.explain_algo import get_feature_vector self.model.feature_vector_fn = get_feature_vector self.model.explain_fn = self.get_explain_fn() diff --git a/src/otx/core/model/instance_segmentation.py b/src/otx/core/model/instance_segmentation.py index 7b812c63507..cc6936a8719 100644 --- a/src/otx/core/model/instance_segmentation.py +++ b/src/otx/core/model/instance_segmentation.py @@ -224,7 +224,7 @@ def __init__( torch_compile=torch_compile, ) - from otx.algo.hooks.recording_forward_hook import get_feature_vector + from otx.algo.explain.explain_algo import get_feature_vector self.model.feature_vector_fn = get_feature_vector self.model.explain_fn = self.get_explain_fn() diff --git a/tests/unit/core/model/test_detection.py b/tests/unit/core/model/test_detection.py index 6c1afb2b3ab..806caf72d02 100644 --- a/tests/unit/core/model/test_detection.py +++ b/tests/unit/core/model/test_detection.py @@ -127,14 +127,3 @@ def test_reset_restore_model_forward(self, otx_model): otx_model._restore_model_forward() assert otx_model.original_model_forward is None assert str(otx_model.model.forward) == str(initial_model_forward) - - def test_export_parameters(self, otx_model): - otx_model.image_size = (1, 64, 64, 3) - otx_model.explain_mode = False - parameters = otx_model._export_parameters - assert isinstance(parameters, dict) - assert "output_names" in parameters - - otx_model.explain_mode = True - parameters = otx_model._export_parameters - assert parameters["output_names"] == ["feature_vector", "saliency_map"] diff --git a/tests/unit/core/model/test_inst_segmentation.py b/tests/unit/core/model/test_inst_segmentation.py index fefd8717c86..8091654d767 100644 --- a/tests/unit/core/model/test_inst_segmentation.py +++ b/tests/unit/core/model/test_inst_segmentation.py @@ -63,14 +63,3 @@ def test_reset_restore_model_forward(self, otx_model): otx_model._restore_model_forward() assert otx_model.original_model_forward is None assert str(otx_model.model.forward) == str(initial_model_forward) - - def test_export_parameters(self, otx_model): - otx_model.image_size = (1, 64, 64, 3) - otx_model.explain_mode = False - parameters = otx_model._export_parameters - assert isinstance(parameters, dict) - assert "output_names" in parameters - - otx_model.explain_mode = True - parameters = otx_model._export_parameters - assert parameters["output_names"] == ["feature_vector", "saliency_map"]