@@ -1629,7 +1629,12 @@ def add_label(self, shape):
16291629 text = f"{ shape .label } ({ shape .group_id } )"
16301630 label_list_item = LabelListWidgetItem (text , shape )
16311631 self .label_list .add_iem (label_list_item )
1632- if not self .unique_label_list .find_items_by_label (shape .label ):
1632+ # Don't add special autolabeling labels to the unique_label_list
1633+ if shape .label not in [
1634+ AutoLabelingMode .OBJECT ,
1635+ AutoLabelingMode .ADD ,
1636+ AutoLabelingMode .REMOVE ,
1637+ ] and not self .unique_label_list .find_items_by_label (shape .label ):
16331638 item = self .unique_label_list .create_item_from_label (shape .label )
16341639 self .unique_label_list .addItem (item )
16351640 rgb = self ._get_rgb_by_label (shape .label )
@@ -1674,6 +1679,19 @@ def _update_shape_color(self, shape):
16741679
16751680 def _get_rgb_by_label (self , label ):
16761681 if self ._config ["shape_color" ] == "auto" :
1682+ # For special autolabeling labels, use fixed colors
1683+ if label in [
1684+ AutoLabelingMode .OBJECT ,
1685+ AutoLabelingMode .ADD ,
1686+ AutoLabelingMode .REMOVE ,
1687+ ]:
1688+ if label == AutoLabelingMode .OBJECT :
1689+ return (0 , 255 , 255 ) # Cyan color for object
1690+ elif label == AutoLabelingMode .ADD :
1691+ return (0 , 255 , 0 ) # Green color for add
1692+ elif label == AutoLabelingMode .REMOVE :
1693+ return (255 , 0 , 0 ) # Red color for remove
1694+
16771695 if not self .unique_label_list .find_items_by_label (label ):
16781696 item = self .unique_label_list .create_item_from_label (label )
16791697 self .unique_label_list .addItem (item )
0 commit comments