Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion micro_sam/sam_annotator/_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,16 @@ def create_prompt_menu(points_layer, labels, menu_name="prompt", label_name="lab
label_widget = Container(widgets=[label_menu])

def update_label_menu(event):
new_label = str(points_layer.current_properties[label_name][0])
current_properties = points_layer.current_properties
if label_name not in current_properties:
return
try:
values = current_properties[label_name]
if len(values) == 0:
return
new_label = str(values[0])
except Exception:
return
if new_label != label_menu.value:
label_menu.value = new_label

Expand Down