當前位置: 首頁>>代碼示例>>Python>>正文


Python matcher_pb2.Matcher方法代碼示例

本文整理匯總了Python中object_detection.protos.matcher_pb2.Matcher方法的典型用法代碼示例。如果您正苦於以下問題:Python matcher_pb2.Matcher方法的具體用法?Python matcher_pb2.Matcher怎麽用?Python matcher_pb2.Matcher使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在object_detection.protos.matcher_pb2的用法示例。


在下文中一共展示了matcher_pb2.Matcher方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_build_arg_max_matcher_with_non_default_parameters

# 需要導入模塊: from object_detection.protos import matcher_pb2 [as 別名]
# 或者: from object_detection.protos.matcher_pb2 import Matcher [as 別名]
def test_build_arg_max_matcher_with_non_default_parameters(self):
    matcher_text_proto = """
      argmax_matcher {
        matched_threshold: 0.7
        unmatched_threshold: 0.3
        negatives_lower_than_unmatched: false
        force_match_for_each_row: true
      }
    """
    matcher_proto = matcher_pb2.Matcher()
    text_format.Merge(matcher_text_proto, matcher_proto)
    matcher_object = matcher_builder.build(matcher_proto)
    self.assertTrue(isinstance(matcher_object, argmax_matcher.ArgMaxMatcher))
    self.assertAlmostEqual(matcher_object._matched_threshold, 0.7)
    self.assertAlmostEqual(matcher_object._unmatched_threshold, 0.3)
    self.assertFalse(matcher_object._negatives_lower_than_unmatched)
    self.assertTrue(matcher_object._force_match_for_each_row) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:19,代碼來源:matcher_builder_test.py

示例2: test_build_arg_max_matcher_with_non_default_parameters

# 需要導入模塊: from object_detection.protos import matcher_pb2 [as 別名]
# 或者: from object_detection.protos.matcher_pb2 import Matcher [as 別名]
def test_build_arg_max_matcher_with_non_default_parameters(self):
    matcher_text_proto = """
      argmax_matcher {
        matched_threshold: 0.7
        unmatched_threshold: 0.3
        negatives_lower_than_unmatched: false
        force_match_for_each_row: true
        use_matmul_gather: true
      }
    """
    matcher_proto = matcher_pb2.Matcher()
    text_format.Merge(matcher_text_proto, matcher_proto)
    matcher_object = matcher_builder.build(matcher_proto)
    self.assertTrue(isinstance(matcher_object, argmax_matcher.ArgMaxMatcher))
    self.assertAlmostEqual(matcher_object._matched_threshold, 0.7)
    self.assertAlmostEqual(matcher_object._unmatched_threshold, 0.3)
    self.assertFalse(matcher_object._negatives_lower_than_unmatched)
    self.assertTrue(matcher_object._force_match_for_each_row)
    self.assertTrue(matcher_object._use_matmul_gather) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:21,代碼來源:matcher_builder_test.py

示例3: test_build_arg_max_matcher_with_defaults

# 需要導入模塊: from object_detection.protos import matcher_pb2 [as 別名]
# 或者: from object_detection.protos.matcher_pb2 import Matcher [as 別名]
def test_build_arg_max_matcher_with_defaults(self):
    matcher_text_proto = """
      argmax_matcher {
      }
    """
    matcher_proto = matcher_pb2.Matcher()
    text_format.Merge(matcher_text_proto, matcher_proto)
    matcher_object = matcher_builder.build(matcher_proto)
    self.assertTrue(isinstance(matcher_object, argmax_matcher.ArgMaxMatcher))
    self.assertAlmostEqual(matcher_object._matched_threshold, 0.5)
    self.assertAlmostEqual(matcher_object._unmatched_threshold, 0.5)
    self.assertTrue(matcher_object._negatives_lower_than_unmatched)
    self.assertFalse(matcher_object._force_match_for_each_row) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:15,代碼來源:matcher_builder_test.py

示例4: test_build_arg_max_matcher_without_thresholds

# 需要導入模塊: from object_detection.protos import matcher_pb2 [as 別名]
# 或者: from object_detection.protos.matcher_pb2 import Matcher [as 別名]
def test_build_arg_max_matcher_without_thresholds(self):
    matcher_text_proto = """
      argmax_matcher {
        ignore_thresholds: true
      }
    """
    matcher_proto = matcher_pb2.Matcher()
    text_format.Merge(matcher_text_proto, matcher_proto)
    matcher_object = matcher_builder.build(matcher_proto)
    self.assertTrue(isinstance(matcher_object, argmax_matcher.ArgMaxMatcher))
    self.assertEqual(matcher_object._matched_threshold, None)
    self.assertEqual(matcher_object._unmatched_threshold, None)
    self.assertTrue(matcher_object._negatives_lower_than_unmatched)
    self.assertFalse(matcher_object._force_match_for_each_row) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:16,代碼來源:matcher_builder_test.py

示例5: test_build_bipartite_matcher

# 需要導入模塊: from object_detection.protos import matcher_pb2 [as 別名]
# 或者: from object_detection.protos.matcher_pb2 import Matcher [as 別名]
def test_build_bipartite_matcher(self):
    matcher_text_proto = """
      bipartite_matcher {
      }
    """
    matcher_proto = matcher_pb2.Matcher()
    text_format.Merge(matcher_text_proto, matcher_proto)
    matcher_object = matcher_builder.build(matcher_proto)
    self.assertTrue(
        isinstance(matcher_object, bipartite_matcher.GreedyBipartiteMatcher)) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:12,代碼來源:matcher_builder_test.py

示例6: test_raise_error_on_empty_matcher

# 需要導入模塊: from object_detection.protos import matcher_pb2 [as 別名]
# 或者: from object_detection.protos.matcher_pb2 import Matcher [as 別名]
def test_raise_error_on_empty_matcher(self):
    matcher_text_proto = """
    """
    matcher_proto = matcher_pb2.Matcher()
    text_format.Merge(matcher_text_proto, matcher_proto)
    with self.assertRaises(ValueError):
      matcher_builder.build(matcher_proto) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:9,代碼來源:matcher_builder_test.py


注:本文中的object_detection.protos.matcher_pb2.Matcher方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。