Ejemplo n.º 1
0
def create_target_assigner(reference, stage=None,
                           negative_class_weight=1.0,
                           unmatched_cls_target=None):
  """Factory function for creating standard target assigners.

  Args:
    reference: string referencing the type of TargetAssigner.
    stage: string denoting stage: {proposal, detection}.
    negative_class_weight: classification weight to be associated to negative
      anchors (default: 1.0)
    unmatched_cls_target: a float32 tensor with shape [d_1, d_2, ..., d_k]
      which is consistent with the classification target for each
      anchor (and can be empty for scalar targets).  This shape must thus be
      compatible with the groundtruth labels that are passed to the Assign
      function (which have shape [num_gt_boxes, d_1, d_2, ..., d_k]).
      If set to None, unmatched_cls_target is set to be 0 for each anchor.

  Returns:
    TargetAssigner: desired target assigner.

  Raises:
    ValueError: if combination reference+stage is invalid.
  """
  if reference == 'Multibox' and stage == 'proposal':
    similarity_calc = sim_calc.NegSqDistSimilarity()
    matcher = bipartite_matcher.GreedyBipartiteMatcher()
    box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()

  elif reference == 'FasterRCNN' and stage == 'proposal':
    similarity_calc = sim_calc.IouSimilarity()
    matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.7,
                                           unmatched_threshold=0.3,
                                           force_match_for_each_row=True)
    box_coder = faster_rcnn_box_coder.FasterRcnnBoxCoder(
        scale_factors=[10.0, 10.0, 5.0, 5.0])

  elif reference == 'FasterRCNN' and stage == 'detection':
    similarity_calc = sim_calc.IouSimilarity()
    # Uses all proposals with IOU < 0.5 as candidate negatives.
    matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                           negatives_lower_than_unmatched=True)
    box_coder = faster_rcnn_box_coder.FasterRcnnBoxCoder(
        scale_factors=[10.0, 10.0, 5.0, 5.0])

  elif reference == 'FastRCNN':
    similarity_calc = sim_calc.IouSimilarity()
    matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                           unmatched_threshold=0.1,
                                           force_match_for_each_row=False,
                                           negatives_lower_than_unmatched=False)
    box_coder = faster_rcnn_box_coder.FasterRcnnBoxCoder()

  else:
    raise ValueError('No valid combination of reference and stage.')

  return TargetAssigner(similarity_calc, matcher, box_coder,
                        negative_class_weight=negative_class_weight,
                        unmatched_cls_target=unmatched_cls_target)
def create_target_assigner(reference, stage=None,
                           negative_class_weight=1.0, use_matmul_gather=False):
  """Factory function for creating standard target assigners.

  Args:
    reference: string referencing the type of TargetAssigner.
    stage: string denoting stage: {proposal, detection}.
    negative_class_weight: classification weight to be associated to negative
      anchors (default: 1.0)
    use_matmul_gather: whether to use matrix multiplication based gather which
      are better suited for TPUs.

  Returns:
    TargetAssigner: desired target assigner.

  Raises:
    ValueError: if combination reference+stage is invalid.
  """
  if reference == 'Multibox' and stage == 'proposal':
    similarity_calc = sim_calc.NegSqDistSimilarity()
    matcher = bipartite_matcher.GreedyBipartiteMatcher()
    box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()

  elif reference == 'FasterRCNN' and stage == 'proposal':
    similarity_calc = sim_calc.IouSimilarity()
    matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.7,
                                           unmatched_threshold=0.3,
                                           force_match_for_each_row=True,
                                           use_matmul_gather=use_matmul_gather)
    box_coder = faster_rcnn_box_coder.FasterRcnnBoxCoder(
        scale_factors=[10.0, 10.0, 5.0, 5.0])

  elif reference == 'FasterRCNN' and stage == 'detection':
    similarity_calc = sim_calc.IouSimilarity()
    # Uses all proposals with IOU < 0.5 as candidate negatives.
    matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                           negatives_lower_than_unmatched=True,
                                           use_matmul_gather=use_matmul_gather)
    box_coder = faster_rcnn_box_coder.FasterRcnnBoxCoder(
        scale_factors=[10.0, 10.0, 5.0, 5.0])

  elif reference == 'FastRCNN':
    similarity_calc = sim_calc.IouSimilarity()
    matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                           unmatched_threshold=0.1,
                                           force_match_for_each_row=False,
                                           negatives_lower_than_unmatched=False,
                                           use_matmul_gather=use_matmul_gather)
    box_coder = faster_rcnn_box_coder.FasterRcnnBoxCoder()

  else:
    raise ValueError('No valid combination of reference and stage.')

  return TargetAssigner(similarity_calc, matcher, box_coder,
                        negative_class_weight=negative_class_weight)
def build(matcher_config):
    """Builds a matcher object based on the matcher config.

    Args:
      matcher_config: A matcher.proto object containing the config for the desired
        Matcher.

    Returns:
      Matcher based on the config.

    Raises:
      ValueError: On empty matcher proto.
    """
    if not isinstance(matcher_config, matcher_pb2.Matcher):
        raise ValueError('matcher_config not of type matcher_pb2.Matcher.')
    if matcher_config.WhichOneof('matcher_oneof') == 'argmax_matcher':
        matcher = matcher_config.argmax_matcher
        matched_threshold = unmatched_threshold = None
        if not matcher.ignore_thresholds:
            matched_threshold = matcher.matched_threshold
            unmatched_threshold = matcher.unmatched_threshold
        return argmax_matcher.ArgMaxMatcher(
            matched_threshold=matched_threshold,
            unmatched_threshold=unmatched_threshold,
            negatives_lower_than_unmatched=matcher.
            negatives_lower_than_unmatched,
            force_match_for_each_row=matcher.force_match_for_each_row)
    if matcher_config.WhichOneof('matcher_oneof') == 'bipartite_matcher':
        return bipartite_matcher.GreedyBipartiteMatcher()
    raise ValueError('Empty matcher.')
Ejemplo n.º 4
0
 def graph_fn(similarity):
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=3.)
   match = matcher.match(similarity)
   matched_cols = match.matched_column_indicator()
   unmatched_cols = match.unmatched_column_indicator()
   match_results = match.match_results
   return (matched_cols, unmatched_cols, match_results)
    def test_return_correct_matches_with_matched_and_unmatched_threshold(self):
        similarity = np.array([[1, 1, 1, 3, 1],
                               [2, -1, 2, 0, 4],
                               [3, 0, -1, 0, 0]], dtype=np.int32)

        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=3,
                                               unmatched_threshold=2)
        expected_matched_cols = np.array([0, 3, 4])
        expected_matched_rows = np.array([2, 0, 1])
        expected_unmatched_cols = np.array([1])  # col 2 has too high maximum val

        sim = tf.constant(similarity)
        match = matcher.match(sim)
        matched_cols = match.matched_column_indices()
        matched_rows = match.matched_row_indices()
        unmatched_cols = match.unmatched_column_indices()

        with self.test_session() as sess:
            res_matched_cols = sess.run(matched_cols)
            res_matched_rows = sess.run(matched_rows)
            res_unmatched_cols = sess.run(unmatched_cols)

        self.assertAllEqual(res_matched_rows, expected_matched_rows)
        self.assertAllEqual(res_matched_cols, expected_matched_cols)
        self.assertAllEqual(res_unmatched_cols, expected_unmatched_cols)
    def test_return_correct_matches_unmatched_row_while_using_force_match(self):
        similarity = np.array([[1, 1, 1, 3, 1],
                               [-1, 0, -2, -2, -1],
                               [3, 0, -1, 2, 0]], dtype=np.int32)

        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=3,
                                               unmatched_threshold=2,
                                               force_match_for_each_row=True)
        expected_matched_cols = np.array([0, 1, 3])
        expected_matched_rows = np.array([2, 1, 0])
        expected_unmatched_cols = np.array([2, 4])  # col 2 has too high max val

        sim = tf.constant(similarity)
        match = matcher.match(sim)
        matched_cols = match.matched_column_indices()
        matched_rows = match.matched_row_indices()
        unmatched_cols = match.unmatched_column_indices()

        with self.test_session() as sess:
            res_matched_cols = sess.run(matched_cols)
            res_matched_rows = sess.run(matched_rows)
            res_unmatched_cols = sess.run(unmatched_cols)

        self.assertAllEqual(res_matched_rows, expected_matched_rows)
        self.assertAllEqual(res_matched_cols, expected_matched_cols)
        self.assertAllEqual(res_unmatched_cols, expected_unmatched_cols)
    def test_return_correct_matches_with_matched_threshold(self):
        similarity = np.array([[1, 1, 1, 3, 1],
                               [2, -1, 2, 0, 4],
                               [3, 0, -1, 0, 0]], dtype=np.int32)

        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=3)
        expected_matched_cols = np.array([0, 3, 4])
        expected_matched_rows = np.array([2, 0, 1])
        expected_unmatched_cols = np.array([1, 2])

        sim = tf.constant(similarity)
        match = matcher.match(sim)
        matched_cols = match.matched_column_indices()
        matched_rows = match.matched_row_indices()
        unmatched_cols = match.unmatched_column_indices()

        init_op = tf.global_variables_initializer()

        with self.test_session() as sess:
            sess.run(init_op)
            res_matched_cols = sess.run(matched_cols)
            res_matched_rows = sess.run(matched_rows)
            res_unmatched_cols = sess.run(unmatched_cols)

        self.assertAllEqual(res_matched_rows, expected_matched_rows)
        self.assertAllEqual(res_matched_cols, expected_matched_cols)
        self.assertAllEqual(res_unmatched_cols, expected_unmatched_cols)
 def _get_agnostic_target_assigner(self):
   similarity_calc = region_similarity_calculator.IouSimilarity()
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                          unmatched_threshold=0.5)
   box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()
   return targetassigner.TargetAssigner(
       similarity_calc, matcher, box_coder,
       unmatched_cls_target=None)
    def test_return_correct_matches_with_empty_rows(self):
        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=None)
        sim = 0.2 * tf.ones([0, 5])
        match = matcher.match(sim)
        unmatched_cols = match.unmatched_column_indices()

        with self.test_session() as sess:
            res_unmatched_cols = sess.run(unmatched_cols)
            self.assertAllEqual(res_unmatched_cols, np.arange(5))
 def _get_multi_class_target_assigner(self, num_classes):
   similarity_calc = region_similarity_calculator.IouSimilarity()
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                          unmatched_threshold=0.5)
   box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()
   unmatched_cls_target = tf.constant([1] + num_classes * [0], tf.float32)
   return targetassigner.TargetAssigner(
       similarity_calc, matcher, box_coder,
       unmatched_cls_target=unmatched_cls_target)
Ejemplo n.º 11
0
 def graph_fn(similarity):
   matcher = argmax_matcher.ArgMaxMatcher(
       matched_threshold=3.,
       unmatched_threshold=2.,
       negatives_lower_than_unmatched=False)
   match = matcher.match(similarity)
   matched_cols = match.matched_column_indicator()
   unmatched_cols = match.unmatched_column_indicator()
   match_results = match.match_results
   return (matched_cols, unmatched_cols, match_results)
 def _get_multi_dimensional_target_assigner(self, target_dimensions):
   similarity_calc = region_similarity_calculator.IouSimilarity()
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                          unmatched_threshold=0.5)
   box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()
   unmatched_cls_target = tf.constant(np.zeros(target_dimensions),
                                      tf.float32)
   return targetassigner.TargetAssigner(
       similarity_calc, matcher, box_coder,
       unmatched_cls_target=unmatched_cls_target)
Ejemplo n.º 13
0
    def test_assign_multidimensional_class_targets_rbox(self):
        similarity_calc = region_similarity_calculator.IouSimilarity()
        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                               unmatched_threshold=0.3)
        box_coder = faster_rcnn_rbox_coder.FasterRcnnRBoxCoder()
        unmatched_cls_target = tf.constant([[0, 0], [0, 0]], tf.float32)
        target_assigner = targetassigner.TargetAssigner(
            similarity_calc,
            matcher,
            box_coder,
            unmatched_cls_target=unmatched_cls_target)

        anchors = tf.constant([[0.0, 0.0, 0.5, 0.5, 0.0],
                               [0.5, 0.5, 1.0, 0.8,
                                0.0], [0, 0.5, .5, 1.0, 0.0],
                               [.75, 0, 1.0, .25, 0.0]])
        anchors_rbox = rbox_list.RBoxList(anchors)

        box_corners = [[0.0, 0.0, 0.5, 0.5, 0.0], [0.5, 0.5, 0.9, 0.9, 0.0],
                       [.75, 0, .95, .27, 0.0]]
        rboxes = rbox_list.RBoxList(tf.constant(box_corners))

        groundtruth_labels = tf.constant(
            [[[0, 1], [1, 0]], [[1, 0], [0, 1]], [[0, 1], [1, .5]]],
            tf.float32)

        exp_cls_targets = [[[0, 1], [1, 0]], [[1, 0], [0, 1]], [[0, 0], [0,
                                                                         0]],
                           [[0, 1], [1, .5]]]
        exp_cls_weights = [1, 1, 1, 1]
        exp_reg_targets = [[0, 0, 0, 0, 0], [0, 0, -0.105361, 0.117783, 0],
                           [0, 0, 0, 0, 0], [0, 0, -0.0512933, .0769611, 0]]
        exp_reg_weights = [1, 1, 0, 1]
        exp_matching_anchors = [0, 1, 3]

        result = target_assigner.assign(anchors_rbox, rboxes,
                                        groundtruth_labels)
        (cls_targets, cls_weights, reg_targets, reg_weights, match) = result
        with self.test_session() as sess:
            (cls_targets_out, cls_weights_out, reg_targets_out, reg_weights_out, matching_anchors_out) = \
                sess.run([cls_targets, cls_weights, reg_targets, reg_weights, match.matched_column_indices()])

            self.assertAllClose(cls_targets_out, exp_cls_targets)
            self.assertAllClose(cls_weights_out, exp_cls_weights)
            self.assertAllClose(reg_targets_out, exp_reg_targets)
            self.assertAllClose(reg_weights_out, exp_reg_weights)
            self.assertAllClose(matching_anchors_out, exp_matching_anchors)
            self.assertEquals(cls_targets_out.dtype, np.float32)
            self.assertEquals(cls_weights_out.dtype, np.float32)
            self.assertEquals(reg_targets_out.dtype, np.float32)
            self.assertEquals(reg_weights_out.dtype, np.float32)
            self.assertEquals(matching_anchors_out.dtype, np.int32)
 def graph_fn(anchor_means, anchor_stddevs, groundtruth_box_corners):
   similarity_calc = region_similarity_calculator.IouSimilarity()
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                          unmatched_threshold=0.3)
   box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()
   target_assigner = targetassigner.TargetAssigner(
       similarity_calc, matcher, box_coder, unmatched_cls_target=None)
   anchors_boxlist = box_list.BoxList(anchor_means)
   anchors_boxlist.add_field('stddev', anchor_stddevs)
   groundtruth_boxlist = box_list.BoxList(groundtruth_box_corners)
   result = target_assigner.assign(anchors_boxlist, groundtruth_boxlist)
   (cls_targets, cls_weights, reg_targets, reg_weights, _) = result
   return (cls_targets, cls_weights, reg_targets, reg_weights)
Ejemplo n.º 15
0
 def _get_multi_dimensional_target_assigner_rbox(self, target_dimensions):
     similarity_calc = region_similarity_calculator.IouSimilarity()
     matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                            unmatched_threshold=0.3)
     box_coder = faster_rcnn_rbox_coder.FasterRcnnRBoxCoder()
     unmatched_cls_target = tf.constant(np.zeros(target_dimensions),
                                        tf.float32)
     return targetassigner.TargetAssigner(
         similarity_calc,
         matcher,
         box_coder,
         positive_class_weight=1.0,
         negative_class_weight=1.0,
         unmatched_cls_target=unmatched_cls_target)
 def graph_fn(anchor_means, groundtruth_box_corners,
              groundtruth_keypoints):
   similarity_calc = region_similarity_calculator.IouSimilarity()
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                          unmatched_threshold=0.5)
   box_coder = keypoint_box_coder.KeypointBoxCoder(
       num_keypoints=6, scale_factors=[10.0, 10.0, 5.0, 5.0])
   target_assigner = targetassigner.TargetAssigner(
       similarity_calc, matcher, box_coder, unmatched_cls_target=None)
   anchors_boxlist = box_list.BoxList(anchor_means)
   groundtruth_boxlist = box_list.BoxList(groundtruth_box_corners)
   groundtruth_boxlist.add_field(fields.BoxListFields.keypoints,
                                 groundtruth_keypoints)
   result = target_assigner.assign(anchors_boxlist, groundtruth_boxlist)
   (cls_targets, cls_weights, reg_targets, reg_weights, _) = result
   return (cls_targets, cls_weights, reg_targets, reg_weights)
Ejemplo n.º 17
0
    def test_assign_with_ignored_matches(self):
        # Note: test is very similar to above. The third box matched with an IOU
        # of 0.35, which is between the matched and unmatched threshold. This means
        # That like above the expected classification targets are [1, 1, 0].
        # Unlike above, the third target is ignored and therefore expected
        # classification weights are [1, 1, 0].
        similarity_calc = region_similarity_calculator.IouSimilarity()
        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=0.5,
                                               unmatched_threshold=0.3)
        box_coder = mean_stddev_box_coder.MeanStddevBoxCoder()
        target_assigner = targetassigner.TargetAssigner(
            similarity_calc, matcher, box_coder)

        prior_means = tf.constant([[0.0, 0.0, 0.5, 0.5], [0.5, 0.5, 1.0, 0.8],
                                   [0.0, 0.5, .9, 1.0]])
        prior_stddevs = tf.constant(3 * [4 * [.1]])
        priors = box_list.BoxList(prior_means)
        priors.add_field('stddev', prior_stddevs)

        box_corners = [[0.0, 0.0, 0.5, 0.5], [0.5, 0.5, 0.9, 0.9]]
        boxes = box_list.BoxList(tf.constant(box_corners))
        exp_cls_targets = [[1], [1], [0]]
        exp_cls_weights = [1, 1, 0]
        exp_reg_targets = [[0, 0, 0, 0], [0, 0, -1, 1], [0, 0, 0, 0]]
        exp_reg_weights = [1, 1, 0]
        exp_matching_anchors = [0, 1]

        result = target_assigner.assign(priors, boxes)
        (cls_targets, cls_weights, reg_targets, reg_weights, match) = result
        with self.test_session() as sess:
            (cls_targets_out, cls_weights_out, reg_targets_out,
             reg_weights_out, matching_anchors_out) = sess.run([
                 cls_targets, cls_weights, reg_targets, reg_weights,
                 match.matched_column_indices()
             ])

            self.assertAllClose(cls_targets_out, exp_cls_targets)
            self.assertAllClose(cls_weights_out, exp_cls_weights)
            self.assertAllClose(reg_targets_out, exp_reg_targets)
            self.assertAllClose(reg_weights_out, exp_reg_weights)
            self.assertAllClose(matching_anchors_out, exp_matching_anchors)
            self.assertEquals(cls_targets_out.dtype, np.float32)
            self.assertEquals(cls_weights_out.dtype, np.float32)
            self.assertEquals(reg_targets_out.dtype, np.float32)
            self.assertEquals(reg_weights_out.dtype, np.float32)
            self.assertEquals(matching_anchors_out.dtype, np.int32)
    def __init__(self, categories, iou_threshold=0.5):
        """Constructor.

    Args:
      categories: A list of dicts, each of which has the following keys -
        'id': (required) an integer id uniquely identifying this category.
        'name': (required) string representing category name e.g., 'cat', 'dog'.
      iou_threshold: Threshold above which to consider a box as matched during
        evaluation.
    """
        super(CalibrationDetectionEvaluator, self).__init__(categories)

        # Constructing target_assigner to match detections to groundtruth.
        similarity_calc = region_similarity_calculator.IouSimilarity()
        matcher = argmax_matcher.ArgMaxMatcher(
            matched_threshold=iou_threshold, unmatched_threshold=iou_threshold)
        box_coder = mean_stddev_box_coder.MeanStddevBoxCoder(stddev=0.1)
        self._target_assigner = target_assigner.TargetAssigner(
            similarity_calc, matcher, box_coder)
    def test_set_values_using_indicator(self):
        input_a = np.array([3, 4, 5, 1, 4, 3, 2])
        expected_b = np.array([3, 0, 0, 1, 0, 3, 2])  # Set a>3 to 0
        expected_c = np.array(
            [3., 4., 5., -1., 4., 3., -1.])  # Set a<3 to -1. Float32
        idxb_ = input_a > 3
        idxc_ = input_a < 3

        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=None)

        a = tf.constant(input_a)
        idxb = tf.constant(idxb_)
        idxc = tf.constant(idxc_)
        b = matcher._set_values_using_indicator(a, idxb, 0)
        c = matcher._set_values_using_indicator(tf.cast(a, tf.float32), idxc, -1)
        with self.test_session() as sess:
            res_b = sess.run(b)
            res_c = sess.run(c)
            self.assertAllEqual(res_b, expected_b)
            self.assertAllEqual(res_c, expected_c)
    def test_return_correct_matches_with_default_thresholds(self):
        similarity = np.array([[1., 1, 1, 3, 1],
                               [2, -1, 2, 0, 4],
                               [3, 0, -1, 0, 0]])

        matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=None)
        expected_matched_rows = np.array([2, 0, 1, 0, 1])

        sim = tf.constant(similarity)
        match = matcher.match(sim)
        matched_cols = match.matched_column_indices()
        matched_rows = match.matched_row_indices()
        unmatched_cols = match.unmatched_column_indices()

        with self.test_session() as sess:
            res_matched_cols = sess.run(matched_cols)
            res_matched_rows = sess.run(matched_rows)
            res_unmatched_cols = sess.run(unmatched_cols)

        self.assertAllEqual(res_matched_rows, expected_matched_rows)
        self.assertAllEqual(res_matched_cols, np.arange(similarity.shape[1]))
Ejemplo n.º 21
0
 def graph_fn(similarity_matrix):
   matcher = argmax_matcher.ArgMaxMatcher(matched_threshold=None)
   match = matcher.match(similarity_matrix)
   return match.unmatched_column_indicator()
 def test_valid_arguments_corner_case(self):
     argmax_matcher.ArgMaxMatcher(matched_threshold=1,
                                  unmatched_threshold=1)
 def test_invalid_arguments_no_matched_threshold(self):
     with self.assertRaises(ValueError):
         argmax_matcher.ArgMaxMatcher(matched_threshold=None,
                                      unmatched_threshold=4)
 def test_invalid_arguments_corner_case_negatives_lower_than_thres_false(self):
     with self.assertRaises(ValueError):
         argmax_matcher.ArgMaxMatcher(matched_threshold=1,
                                      unmatched_threshold=1,
                                      negatives_lower_than_unmatched=False)
 def test_invalid_arguments_unmatched_thres_larger_than_matched_thres(self):
     with self.assertRaises(ValueError):
         argmax_matcher.ArgMaxMatcher(matched_threshold=1,
                                      unmatched_threshold=2)