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,9 +1026,10 @@ 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)
# Return segmentation map in run-length encoding (RLE) format
if return_coco_annotation:
segmentation = convert_segmentation_to_rle(segmentation)
# Return a concatenated tensor of binary instance maps
if return_binary_maps and len(instance_maps) != 0:

View File

@ -1081,9 +1081,10 @@ 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)
# Return segmentation map in run-length encoding (RLE) format
if return_coco_annotation:
segmentation = convert_segmentation_to_rle(segmentation)
# Return a concatenated tensor of binary instance maps
if return_binary_maps and len(instance_maps) != 0: