def test_get_instance_masks(self):
    image_features = tf.random_uniform([2, 7, 7, 3], dtype=tf.float32)
    mask_box_predictor = box_predictor.MaskRCNNBoxPredictor(is_training=False, num_classes=5, fc_hyperparams=self._build_arg_scope_with_hyperparams(), use_dropout=False, dropout_keep_prob=0.5, box_code_size=4, conv_hyperparams=self._build_arg_scope_with_hyperparams(op_type=hyperparams_pb2.Hyperparams.CONV), predict_instance_masks=True)
    box_predictions = mask_box_predictor.predict(image_features, num_predictions_per_location=1, scope='BoxPredictor')
    mask_predictions = box_predictions[box_predictor.MASK_PREDICTIONS]
    self.assertListEqual([2, 1, 5, 14, 14], mask_predictions.get_shape().as_list())
def test_get_instance_masks(self):
    image_features = tf.random_uniform([2, 7, 7, 3], dtype=tf.float32)
    mask_box_predictor = box_predictor.MaskRCNNBoxPredictor(is_training=False, num_classes=5, fc_hyperparams=self._build_arg_scope_with_hyperparams(), use_dropout=False, dropout_keep_prob=0.5, box_code_size=4, conv_hyperparams=self._build_arg_scope_with_hyperparams(op_type=hyperparams_pb2.Hyperparams.CONV), predict_instance_masks=True)
    box_predictions = mask_box_predictor.predict(image_features, num_predictions_per_location=1, scope='BoxPredictor')
    mask_predictions = box_predictions[box_predictor.MASK_PREDICTIONS]
    self.assertListEqual([2, 1, 5, 14, 14], mask_predictions.get_shape().as_list())