File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -2517,12 +2517,16 @@ def export_semantic_segmentation(
25172517 When start_index is 0, all pixels are assumed to have annotations
25182518 because they become the same color as the background(Optional).
25192519 """
2520- if len (classes ) == 0 :
2520+
2521+ # Copy classes to target_classes
2522+ # so that it is not added as a default argument.
2523+ target_classes = classes .copy ()
2524+ if len (target_classes ) == 0 :
25212525 for task in tasks :
25222526 for annotation in task ["annotations" ]:
2523- classes .append (annotation ["value" ])
2524- classes = list (set (classes ))
2525- classes .sort ()
2527+ target_classes .append (annotation ["value" ])
2528+ target_classes = list (set (target_classes ))
2529+ target_classes .sort ()
25262530
25272531 tasks = converters .to_pixel_coordinates (tasks )
25282532 for task in tasks :
@@ -2531,7 +2535,7 @@ def export_semantic_segmentation(
25312535 output_dir = output_dir ,
25322536 pallete = pallete ,
25332537 is_instance_segmentation = False ,
2534- classes = classes ,
2538+ classes = target_classes ,
25352539 start_index = start_index ,
25362540 )
25372541
You can’t perform that action at this time.
0 commit comments