From 3db3044e237a2c9cf3b2e865462cc979775d334f Mon Sep 17 00:00:00 2001 From: Eemeli Pettersson Date: Wed, 29 Nov 2023 11:01:48 +0200 Subject: [PATCH 1/2] Fix amount of output bands for superresolution --- .../processing/map_processor/map_processor_superresolution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deepness/processing/map_processor/map_processor_superresolution.py b/src/deepness/processing/map_processor/map_processor_superresolution.py index 0ce4f02..3dbde49 100644 --- a/src/deepness/processing/map_processor/map_processor_superresolution.py +++ b/src/deepness/processing/map_processor/map_processor_superresolution.py @@ -38,7 +38,7 @@ def get_result_imgs(self): return self._result_imgs def _run(self) -> MapProcessingResult: - number_of_output_channels = len(self._get_indexes_of_model_output_channels_to_create()) + number_of_output_channels = self.model.get_number_of_output_channels() final_shape_px = (int(self.img_size_y_pixels*self.superresolution_parameters.scale_factor), int(self.img_size_x_pixels*self.superresolution_parameters.scale_factor), number_of_output_channels) # NOTE: consider whether we can use float16/uint16 as datatype From 23c11076e7b30384032c80292d8a26ea367767f8 Mon Sep 17 00:00:00 2001 From: Eemeli Pettersson Date: Wed, 29 Nov 2023 11:05:11 +0200 Subject: [PATCH 2/2] Disable output format options for superresolution --- src/deepness/deepness_dockwidget.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/deepness/deepness_dockwidget.py b/src/deepness/deepness_dockwidget.py index b6bb4b7..430853f 100644 --- a/src/deepness/deepness_dockwidget.py +++ b/src/deepness/deepness_dockwidget.py @@ -229,6 +229,8 @@ def _model_type_changed(self): self.mGroupBox_detectionParameters.setEnabled(detection_enabled) self.mGroupBox_regressionParameters.setEnabled(regression_enabled) self.mGroupBox_superresolutionParameters.setEnabled(superresolution_enabled) + # Disable output format options for super-resolution models. + self.mGroupBox_6.setEnabled(not superresolution_enabled) def _detector_type_changed(self): detector_type = DetectorType(self.comboBox_detectorType.currentText()) @@ -364,6 +366,8 @@ def _load_model_and_display_info(self, abort_if_no_file_path: bool = False): output_0_shape = self._model.get_output_shape() scale_factor = output_0_shape[-1] / input_size_px self.doubleSpinBox_superresolutionScaleFactor.setValue(int(scale_factor)) + # Disable output format options for super-resolution models + self.mGroupBox_6.setEnabled(False) except Exception as e: if IS_DEBUG: raise e