mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-30 01:32:23 +06:00
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:
parent
ee7d6694ed
commit
80f29a25a7
@ -1026,9 +1026,10 @@ class Mask2FormerImageProcessor(BaseImageProcessor):
|
|||||||
)
|
)
|
||||||
current_segment_id += 1
|
current_segment_id += 1
|
||||||
instance_maps.append(pred_masks[j])
|
instance_maps.append(pred_masks[j])
|
||||||
# Return segmentation map in run-length encoding (RLE) format
|
|
||||||
if return_coco_annotation:
|
# Return segmentation map in run-length encoding (RLE) format
|
||||||
segmentation = convert_segmentation_to_rle(segmentation)
|
if return_coco_annotation:
|
||||||
|
segmentation = convert_segmentation_to_rle(segmentation)
|
||||||
|
|
||||||
# Return a concatenated tensor of binary instance maps
|
# Return a concatenated tensor of binary instance maps
|
||||||
if return_binary_maps and len(instance_maps) != 0:
|
if return_binary_maps and len(instance_maps) != 0:
|
||||||
|
@ -1081,9 +1081,10 @@ class MaskFormerImageProcessor(BaseImageProcessor):
|
|||||||
)
|
)
|
||||||
current_segment_id += 1
|
current_segment_id += 1
|
||||||
instance_maps.append(pred_masks[j])
|
instance_maps.append(pred_masks[j])
|
||||||
# Return segmentation map in run-length encoding (RLE) format
|
|
||||||
if return_coco_annotation:
|
# Return segmentation map in run-length encoding (RLE) format
|
||||||
segmentation = convert_segmentation_to_rle(segmentation)
|
if return_coco_annotation:
|
||||||
|
segmentation = convert_segmentation_to_rle(segmentation)
|
||||||
|
|
||||||
# Return a concatenated tensor of binary instance maps
|
# Return a concatenated tensor of binary instance maps
|
||||||
if return_binary_maps and len(instance_maps) != 0:
|
if return_binary_maps and len(instance_maps) != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user