Skip to content

Commit

Permalink
Merge pull request #121 from Saareem/devel
Browse files Browse the repository at this point in the history
Fix the number of output channels for super-resolution models and disable output format options
  • Loading branch information
przemyslaw-aszkowski authored Nov 29, 2023
2 parents 5ae668d + 23c1107 commit 0ee1cdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/deepness/deepness_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ee1cdb

Please sign in to comment.