Unverified Commit b810694e authored by srihari-humbarwadi's avatar srihari-humbarwadi
Browse files

resize instance masks with bilinear method

parent 7303c9f3
......@@ -334,7 +334,9 @@ class Parser(maskrcnn_input.Parser):
panoptic_instance_mask = panoptic_instance_mask[:, :, 0]
labels['groundtruths'].update({
'gt_panoptic_category_mask': panoptic_category_mask,
'gt_panoptic_instance_mask': panoptic_instance_mask})
'gt_panoptic_category_mask':
tf.cast(panoptic_category_mask, dtype=tf.int32),
'gt_panoptic_instance_mask':
tf.cast(panoptic_instance_mask, dtype=tf.int32)})
return image, labels
......@@ -91,7 +91,8 @@ class PanopticSegmentationGenerator(tf.keras.layers.Layer):
resized_mask = tf.image.resize(
mask,
size=(box_height, box_width),
method='nearest')
method='bilinear')
resized_mask = tf.cast(resized_mask, dtype=mask.dtype)
# paste resized mask on a blank mask that matches image shape
pasted_mask = tf.raw_ops.TensorStridedSliceUpdate(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment