How to resize image along with their mask?

I have original images of the size 1935x1481. I am using labelme to annotate the images. I am creating polygons on the original image. Is there a way to resize the image along with their mask? I am planning to use TFOD mask-rcnn and I know it will resize the image but what happens to the mask?

Topic image-segmentation object-detection tensorflow deep-learning dataset

Category Data Science


In this tutorial they use the following to resize the image and mask.

Is it applicable to your use-case?

@tf.function
def load_image_train(datapoint):
  input_image = tf.image.resize(datapoint['image'], (128, 128))
  input_mask = tf.image.resize(datapoint['segmentation_mask'], (128, 128))

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.