Skip to content

Commit 5167a77

Browse files
authored
AC: fix deprocessing in crop_padded_mask case (#3197)
1 parent b50730d commit 5167a77

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/crop_segmentation_mask.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ def process_image_with_metadata(self, annotation, prediction, image_metadata=Non
161161
"Postprocessing step `crop_padded_prediction` cannot work without metadata with `padding` field")
162162

163163
top, left, bottom, right = image_metadata.get('padding', (0, 0, 0, 0))
164+
if self.deprocessing_mode:
165+
image_metadata['padding_disabled'] = True
164166
for pred in prediction:
165167
mask = pred.mask
166168
if mask.ndim == 2:

tools/accuracy_checker/openvino/tools/accuracy_checker/postprocessor/resize_segmentation_mask.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ def process_image_with_metadata(self, annotation, prediction, image_metadata=Non
170170

171171
@staticmethod
172172
def _deprocess_prediction_with_padding(prediction, image_metadata):
173+
if image_metadata.get('padding_disabled', False):
174+
return
173175
top, left, bottom, right = image_metadata['padding']
174176
for pred in prediction:
175177
mask = pred.mask

0 commit comments

Comments
 (0)