Skip to content

Commit

Permalink
adapt to new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jwyang committed Nov 9, 2023
1 parent e31296b commit 71d14b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions demo_som.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 71d14b8

Please sign in to comment.