Skip to content

Commit 6436b11

Browse files
committed
add condition to MaskRCNN.postprocess
1 parent 0ba6bee commit 6436b11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

model_api/python/openvino/model_api/models/instance_segmentation.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def postprocess(self, outputs, meta):
202202
for box, confidence, cls, str_label, raw_mask in zip(
203203
boxes, scores, labels, str_labels, masks
204204
):
205-
if confidence <= self.confidence_threshold and not has_feature_vector_name:
205+
x1, y1, x2, y2 = box
206+
if (x2 - x1) * (y2 - y1) < 1 or (
207+
confidence <= self.confidence_threshold and not has_feature_vector_name
208+
):
206209
continue
207210
raw_cls_mask = raw_mask[cls, ...] if self.is_segmentoly else raw_mask
208211
if self.postprocess_semantic_masks or has_feature_vector_name:

0 commit comments

Comments
 (0)