Skip to content

Commit f3be90a

Browse files
Simplify model type selection logic
1 parent 008860f commit f3be90a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

synaptic_reconstruction/tools/segmentation_widget.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,12 @@ def on_predict(self):
9898
voxel_size["y"] = self.voxel_size_param.value()
9999
if voxel_size:
100100
if model_type == "custom":
101-
show_info(f"INFO: Scaling image not avaialable for custom model.")
101+
show_info("INFO: The image is not rescaled for a custom model.")
102102
else:
103103
# calculate scale so voxel_size is the same as in training
104104
scale = compute_scale_from_voxel_size(voxel_size, model_type)
105105
show_info(f"INFO: Rescaled the image by {scale} to optimize for the selected model.")
106106

107-
if model_type == "custom":
108-
# choose appropriate segmentation
109-
model_type = self.model_target_selector.currentText()
110-
111107
segmentation = run_segmentation(
112108
image, model=model, model_type=model_type, tiling=self.tiling, scale=scale
113109
)
@@ -160,13 +156,6 @@ def _create_settings_widget(self):
160156
placeholder="path/to/checkpoint.pt",
161157
)
162158
setting_values.layout().addLayout(layout)
163-
164-
self.model_target_selector, layout = self._add_choice_param(
165-
name="Model Target", value="vesicles", options=[
166-
"vesicles", "mitochondria", "active_zone", "compartments", "inner_ear_structures"
167-
]
168-
)
169-
setting_values.layout().addLayout(layout)
170159

171160
settings = self._make_collapsible(widget=setting_values, title="Advanced Settings")
172161
return settings

0 commit comments

Comments
 (0)