From 71d14b8a940fe54ac586f5f652501b1157594985 Mon Sep 17 00:00:00 2001 From: jwyang Date: Thu, 9 Nov 2023 00:31:45 +0000 Subject: [PATCH] adapt to new interface --- demo_som.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demo_som.py b/demo_som.py index bbeb3af7..78984b67 100644 --- a/demo_som.py +++ b/demo_som.py @@ -103,21 +103,21 @@ def inference(image, slider, mode, alpha, label_mode, anno_mode, *args, **kwargs if model_name == 'semantic-sam': model = model_semsam - output = inference_semsam_m2m_auto(model, image['image'], level, text, text_part, text_thresh, text_size, hole_scale, island_scale, semantic, label_mode=label_mode, alpha=alpha, anno_mode=anno_mode, *args, **kwargs) + output, mask = inference_semsam_m2m_auto(model, image['image'], level, text, text_part, text_thresh, text_size, hole_scale, island_scale, semantic, label_mode=label_mode, alpha=alpha, anno_mode=anno_mode, *args, **kwargs) elif model_name == 'sam': model = model_sam if mode == "Automatic": - output = inference_sam_m2m_auto(model, image['image'], text_size, label_mode, alpha, anno_mode) + output, mask = inference_sam_m2m_auto(model, image['image'], text_size, label_mode, alpha, anno_mode) elif mode == "Interactive": - output = inference_sam_m2m_interactive(model, image['image'], spatial_masks, text_size, label_mode, alpha, anno_mode) + output, mask = inference_sam_m2m_interactive(model, image['image'], spatial_masks, text_size, label_mode, alpha, anno_mode) elif model_name == 'seem': model = model_seem if mode == "Automatic": - output = inference_seem_pano(model, image['image'], text_size, label_mode, alpha, anno_mode) + output, mask = inference_seem_pano(model, image['image'], text_size, label_mode, alpha, anno_mode) elif mode == "Interactive": - output = inference_seem_interactive(model, image['image'], spatial_masks, text_size, label_mode, alpha, anno_mode) + output, mask = inference_seem_interactive(model, image['image'], spatial_masks, text_size, label_mode, alpha, anno_mode) return output