MaskFormer post_process_instance_segmentation bug fix convert out side of loop (#25497)

Bug fix - convert out side of loop
This commit is contained in:
amyeroberts 2023-08-14 16:00:57 +01:00 committed by GitHub
parent ee7d6694ed
commit 80f29a25a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -1026,6 +1026,7 @@ class Mask2FormerImageProcessor(BaseImageProcessor):
)
current_segment_id += 1
instance_maps.append(pred_masks[j])
# Return segmentation map in run-length encoding (RLE) format
if return_coco_annotation:
segmentation = convert_segmentation_to_rle(segmentation)

View File

@ -1081,6 +1081,7 @@ class MaskFormerImageProcessor(BaseImageProcessor):
)
current_segment_id += 1
instance_maps.append(pred_masks[j])
# Return segmentation map in run-length encoding (RLE) format
if return_coco_annotation:
segmentation = convert_segmentation_to_rle(segmentation)