import tensorflow as tf

         min_score_thresh=0.65,
         min_iou_thresh=0.5,
         is_class_agnostic=False)
    nms_masks_expected2 = tf.stack([mask2, mask0, mask5, mask4])
    nms_scores_expected2 = tf.constant([0.95, 1.0, 0.8, 0.7], dtype=tf.float32)
    nms_classes_expected2 = tf.constant([0, 1, 2, 2], dtype=tf.int32)
    self.assertAllEqual(nms_masks1.numpy(), nms_masks_expected1.numpy())
    self.assertAllClose(nms_scores1.numpy(), nms_scores_expected1.numpy())
    self.assertAllEqual(nms_classes1.numpy(), nms_classes_expected1.numpy())
    self.assertAllEqual(nms_masks2.numpy(), nms_masks_expected2.numpy())
    self.assertAllClose(nms_scores2.numpy(), nms_scores_expected2.numpy())
    self.assertAllEqual(nms_classes2.numpy(), nms_classes_expected2.numpy())

  def test_points_mask_iou(self):
    masks1 = tf.constant([[0, 0, 0, 0, 0],
                          [1, 1, 1, 1, 1],
                          [1, 0, 1, 0, 1],
                          [0, 1, 0, 1, 0]], dtype=tf.int32)
    masks2 = tf.constant([[0, 0, 0, 0, 0],
                          [1, 1, 1, 1, 1],
                          [1, 0, 1, 0, 1]], dtype=tf.int32)
    iou = isu.points_mask_iou(masks1=masks1, masks2=masks2)
    expected_iou = tf.constant([[0, 0, 0],
                                [0, 1, 0.6],
                                [0, 0.6, 1.0],
                                [0, 0.4, 0]], dtype=tf.float32)
    self.assertAllClose(iou.numpy(), expected_iou.numpy())

