Skip to content

Commit 9ad5e30

Browse files
Move automatic segmentation mode (#898)
1 parent 09aa8ad commit 9ad5e30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

micro_sam/automatic_segmentation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ def automatic_instance_segmentation(
115115
image_data = util.load_image_data(input_path, key)
116116

117117
ndim = image_data.ndim if ndim is None else ndim
118+
119+
# We perform additional post-processing for AMG-only.
120+
# Otherwise, we ignore additional post-processing for AIS.
121+
if isinstance(segmenter, InstanceSegmentationWithDecoder):
122+
generate_kwargs["output_mode"] = None
118123

119124
if ndim == 2:
120125
if (image_data.ndim != 2) and (image_data.ndim != 3 and image_data.shape[-1] != 3):
@@ -308,11 +313,6 @@ def _convert_argval(value):
308313
**amg_kwargs,
309314
)
310315

311-
# We perform additional post-processing for AMG-only.
312-
# Otherwise, we ignore additional post-processing for AIS.
313-
if isinstance(segmenter, InstanceSegmentationWithDecoder):
314-
generate_kwargs["output_mode"] = None
315-
316316
automatic_instance_segmentation(
317317
predictor=predictor,
318318
segmenter=segmenter,

0 commit comments

Comments
 (0)