Mask_RCNN/model.py at master · matterport/Mask_RCNN · GitHub
masks = tf. image. crop_and_resize (tf. cast (roi_masks, tf. float32), boxes, box_ids, config. MASK_SHAPE) # Remove the extra dimension from masks. masks = tf. squeeze (masks, axis = 3) # Threshold mask pixels at 0.5 to have GT masks be 0 or 1 to use with # binary cross entropy loss. masks = tf. round (masks) # Append negative ROIs and pad bbox ...