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


Python box_coder_pb2.BoxCoder方法代碼示例

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


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

示例1: test_build_keypoint_box_coder_with_non_default_parameters

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_keypoint_box_coder_with_non_default_parameters(self):
    box_coder_text_proto = """
      keypoint_box_coder {
        num_keypoints: 6
        y_scale: 6.0
        x_scale: 3.0
        height_scale: 7.0
        width_scale: 8.0
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertIsInstance(box_coder_object, keypoint_box_coder.KeypointBoxCoder)
    self.assertEqual(box_coder_object._num_keypoints, 6)
    self.assertEqual(box_coder_object._scale_factors, [6.0, 3.0, 7.0, 8.0]) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:18,代碼來源:box_coder_builder_test.py

示例2: test_build_faster_rcnn_box_coder_with_defaults

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_faster_rcnn_box_coder_with_defaults(self):
    box_coder_text_proto = """
      faster_rcnn_box_coder {
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertTrue(isinstance(box_coder_object,
                               faster_rcnn_box_coder.FasterRcnnBoxCoder))
    self.assertEqual(box_coder_object._scale_factors, [10.0, 10.0, 5.0, 5.0]) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:13,代碼來源:box_coder_builder_test.py

示例3: test_build_faster_rcnn_box_coder_with_non_default_parameters

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_faster_rcnn_box_coder_with_non_default_parameters(self):
    box_coder_text_proto = """
      faster_rcnn_box_coder {
        y_scale: 6.0
        x_scale: 3.0
        height_scale: 7.0
        width_scale: 8.0
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertTrue(isinstance(box_coder_object,
                               faster_rcnn_box_coder.FasterRcnnBoxCoder))
    self.assertEqual(box_coder_object._scale_factors, [6.0, 3.0, 7.0, 8.0]) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:17,代碼來源:box_coder_builder_test.py

示例4: test_build_mean_stddev_box_coder

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_mean_stddev_box_coder(self):
    box_coder_text_proto = """
      mean_stddev_box_coder {
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertTrue(
        isinstance(box_coder_object,
                   mean_stddev_box_coder.MeanStddevBoxCoder)) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:13,代碼來源:box_coder_builder_test.py

示例5: test_build_square_box_coder_with_defaults

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_square_box_coder_with_defaults(self):
    box_coder_text_proto = """
      square_box_coder {
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertTrue(
        isinstance(box_coder_object, square_box_coder.SquareBoxCoder))
    self.assertEqual(box_coder_object._scale_factors, [10.0, 10.0, 5.0]) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:13,代碼來源:box_coder_builder_test.py

示例6: test_build_square_box_coder_with_non_default_parameters

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_square_box_coder_with_non_default_parameters(self):
    box_coder_text_proto = """
      square_box_coder {
        y_scale: 6.0
        x_scale: 3.0
        length_scale: 7.0
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertTrue(
        isinstance(box_coder_object, square_box_coder.SquareBoxCoder))
    self.assertEqual(box_coder_object._scale_factors, [6.0, 3.0, 7.0]) 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:16,代碼來源:box_coder_builder_test.py

示例7: build

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def build(box_coder_config):
  """Builds a box coder object based on the box coder config.

  Args:
    box_coder_config: A box_coder.proto object containing the config for the
      desired box coder.

  Returns:
    BoxCoder based on the config.

  Raises:
    ValueError: On empty box coder proto.
  """
  if not isinstance(box_coder_config, box_coder_pb2.BoxCoder):
    raise ValueError('box_coder_config not of type box_coder_pb2.BoxCoder.')

  if box_coder_config.WhichOneof('box_coder_oneof') == 'faster_rcnn_box_coder':
    return faster_rcnn_box_coder.FasterRcnnBoxCoder(scale_factors=[
        box_coder_config.faster_rcnn_box_coder.y_scale,
        box_coder_config.faster_rcnn_box_coder.x_scale,
        box_coder_config.faster_rcnn_box_coder.height_scale,
        box_coder_config.faster_rcnn_box_coder.width_scale
    ])
  if (box_coder_config.WhichOneof('box_coder_oneof') ==
      'mean_stddev_box_coder'):
    return mean_stddev_box_coder.MeanStddevBoxCoder()
  if box_coder_config.WhichOneof('box_coder_oneof') == 'square_box_coder':
    return square_box_coder.SquareBoxCoder(scale_factors=[
        box_coder_config.square_box_coder.y_scale,
        box_coder_config.square_box_coder.x_scale,
        box_coder_config.square_box_coder.length_scale
    ])
  raise ValueError('Empty box coder.') 
開發者ID:ringringyi,項目名稱:DOTA_models,代碼行數:35,代碼來源:box_coder_builder.py

示例8: test_build_faster_rcnn_box_coder_with_defaults

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_faster_rcnn_box_coder_with_defaults(self):
    box_coder_text_proto = """
      faster_rcnn_box_coder {
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertIsInstance(box_coder_object,
                          faster_rcnn_box_coder.FasterRcnnBoxCoder)
    self.assertEqual(box_coder_object._scale_factors, [10.0, 10.0, 5.0, 5.0]) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:13,代碼來源:box_coder_builder_test.py

示例9: test_build_faster_rcnn_box_coder_with_non_default_parameters

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_faster_rcnn_box_coder_with_non_default_parameters(self):
    box_coder_text_proto = """
      faster_rcnn_box_coder {
        y_scale: 6.0
        x_scale: 3.0
        height_scale: 7.0
        width_scale: 8.0
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertIsInstance(box_coder_object,
                          faster_rcnn_box_coder.FasterRcnnBoxCoder)
    self.assertEqual(box_coder_object._scale_factors, [6.0, 3.0, 7.0, 8.0]) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:17,代碼來源:box_coder_builder_test.py

示例10: test_build_keypoint_box_coder_with_defaults

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_build_keypoint_box_coder_with_defaults(self):
    box_coder_text_proto = """
      keypoint_box_coder {
      }
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    box_coder_object = box_coder_builder.build(box_coder_proto)
    self.assertIsInstance(box_coder_object, keypoint_box_coder.KeypointBoxCoder)
    self.assertEqual(box_coder_object._scale_factors, [10.0, 10.0, 5.0, 5.0]) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:12,代碼來源:box_coder_builder_test.py

示例11: test_raise_error_on_empty_box_coder

# 需要導入模塊: from object_detection.protos import box_coder_pb2 [as 別名]
# 或者: from object_detection.protos.box_coder_pb2 import BoxCoder [as 別名]
def test_raise_error_on_empty_box_coder(self):
    box_coder_text_proto = """
    """
    box_coder_proto = box_coder_pb2.BoxCoder()
    text_format.Merge(box_coder_text_proto, box_coder_proto)
    with self.assertRaises(ValueError):
      box_coder_builder.build(box_coder_proto) 
開發者ID:ahmetozlu,項目名稱:vehicle_counting_tensorflow,代碼行數:9,代碼來源:box_coder_builder_test.py


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