From e4627f0989c4c7fecae0c5c83d7b711d40524f28 Mon Sep 17 00:00:00 2001 From: Anwai Archit <52396323+anwai98@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:42:31 +0100 Subject: [PATCH] Add example script for automatic segmentation (#781) --- micro_sam/automatic_segmentation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/micro_sam/automatic_segmentation.py b/micro_sam/automatic_segmentation.py index 4341b442..71219c58 100644 --- a/micro_sam/automatic_segmentation.py +++ b/micro_sam/automatic_segmentation.py @@ -55,11 +55,9 @@ def get_predictor_and_segmenter( decoder = get_decoder(image_encoder=predictor.model.image_encoder, decoder_state=decoder_state, device=device) segmenter = get_amg( - predictor=predictor, - is_tiled=is_tiled, - decoder=decoder, - **kwargs + predictor=predictor, is_tiled=is_tiled, decoder=decoder, **kwargs ) + return predictor, segmenter @@ -232,6 +230,7 @@ def _convert_argval(value): model_type=args.model_type, checkpoint=args.checkpoint, device=args.device, + amg=args.amg, is_tiled=args.tile_shape is not None, )