Skip to content

Commit e313674

Browse files
authored
Merge pull request #3457 from akorobeinikov/ak/mask_rcnn_fix
[master] Cast mask type as FP32
2 parents fe5b4a7 + 6790d87 commit e313674

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demos/common/python/openvino/model_zoo/model_api/models/instance_segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _segm_postprocess(self, box, raw_cls_mask, im_h, im_w):
141141
x0, y0 = np.clip(extended_box[:2], a_min=0, a_max=[im_w, im_h])
142142
x1, y1 = np.clip(extended_box[2:] + 1, a_min=0, a_max=[im_w, im_h])
143143

144-
raw_cls_mask = cv2.resize(raw_cls_mask, (w, h)) > 0.5
144+
raw_cls_mask = cv2.resize(raw_cls_mask.astype(np.float32), (w, h)) > 0.5
145145
mask = raw_cls_mask.astype(np.uint8)
146146
# Put an object mask in an image mask.
147147
im_mask = np.zeros((im_h, im_w), dtype=np.uint8)

0 commit comments

Comments
 (0)