Python object_detection.protos.region_similarity_calculator_pb2.RegionSimilarityCalculator() Examples

The following are 30 code examples of object_detection.protos.region_similarity_calculator_pb2.RegionSimilarityCalculator(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module object_detection.protos.region_similarity_calculator_pb2 , or try the search function .
Example #1
Source File: region_similarity_calculator_builder_test.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #2
Source File: region_similarity_calculator_builder_test.py    From MBMD with MIT License 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity)) 
Example #3
Source File: region_similarity_calculator_builder_test.py    From Live-feed-object-device-identification-using-Tensorflow-and-OpenCV with Apache License 2.0 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #4
Source File: region_similarity_calculator_builder_test.py    From MBMD with MIT License 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #5
Source File: region_similarity_calculator_builder.py    From Elphas with Apache License 2.0 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #6
Source File: region_similarity_calculator_builder_test.py    From MBMD with MIT License 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #7
Source File: region_similarity_calculator_builder_test.py    From object_detection_kitti with Apache License 2.0 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #8
Source File: region_similarity_calculator_builder_test.py    From object_detection_kitti with Apache License 2.0 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #9
Source File: region_similarity_calculator_builder_test.py    From object_detection_kitti with Apache License 2.0 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity)) 
Example #10
Source File: region_similarity_calculator_builder.py    From object_detection_kitti with Apache License 2.0 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #11
Source File: region_similarity_calculator_builder.py    From MBMD with MIT License 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #12
Source File: region_similarity_calculator_builder_test.py    From moveo_ros with MIT License 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #13
Source File: region_similarity_calculator_builder_test.py    From moveo_ros with MIT License 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #14
Source File: region_similarity_calculator_builder_test.py    From moveo_ros with MIT License 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity)) 
Example #15
Source File: region_similarity_calculator_builder.py    From moveo_ros with MIT License 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #16
Source File: region_similarity_calculator_builder.py    From hands-detection with MIT License 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #17
Source File: region_similarity_calculator_builder_test.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #18
Source File: region_similarity_calculator_builder_test.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity)) 
Example #19
Source File: region_similarity_calculator_builder.py    From BMW-TensorFlow-Training-GUI with Apache License 2.0 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()
  if similarity_calculator == 'thresholded_iou_similarity':
    return region_similarity_calculator.ThresholdedIouSimilarity(
        region_similarity_calculator_config.thresholded_iou_similarity.threshold
    )

  raise ValueError('Unknown region similarity calculator.') 
Example #20
Source File: region_similarity_calculator_builder_test.py    From ros_tensorflow with Apache License 2.0 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #21
Source File: region_similarity_calculator_builder_test.py    From ros_tensorflow with Apache License 2.0 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #22
Source File: region_similarity_calculator_builder_test.py    From ros_tensorflow with Apache License 2.0 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity)) 
Example #23
Source File: region_similarity_calculator_builder.py    From ros_tensorflow with Apache License 2.0 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #24
Source File: region_similarity_calculator_builder_test.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #25
Source File: region_similarity_calculator_builder_test.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #26
Source File: region_similarity_calculator_builder_test.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity)) 
Example #27
Source File: region_similarity_calculator_builder.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def build(region_similarity_calculator_config):
  """Builds region similarity calculator based on the configuration.

  Builds one of [IouSimilarity, IoaSimilarity, NegSqDistSimilarity] objects. See
  core/region_similarity_calculator.proto for details.

  Args:
    region_similarity_calculator_config: RegionSimilarityCalculator
      configuration proto.

  Returns:
    region_similarity_calculator: RegionSimilarityCalculator object.

  Raises:
    ValueError: On unknown region similarity calculator.
  """

  if not isinstance(
      region_similarity_calculator_config,
      region_similarity_calculator_pb2.RegionSimilarityCalculator):
    raise ValueError(
        'region_similarity_calculator_config not of type '
        'region_similarity_calculator_pb2.RegionsSimilarityCalculator')

  similarity_calculator = region_similarity_calculator_config.WhichOneof(
      'region_similarity')
  if similarity_calculator == 'iou_similarity':
    return region_similarity_calculator.IouSimilarity()
  if similarity_calculator == 'ioa_similarity':
    return region_similarity_calculator.IoaSimilarity()
  if similarity_calculator == 'neg_sq_dist_similarity':
    return region_similarity_calculator.NegSqDistSimilarity()

  raise ValueError('Unknown region similarity calculator.') 
Example #28
Source File: region_similarity_calculator_builder_test.py    From tensorflow with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def testBuildNegSqDistSimilarityCalculator(self):
    similarity_calc_text_proto = """
      neg_sq_dist_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.
                               NegSqDistSimilarity)) 
Example #29
Source File: region_similarity_calculator_builder_test.py    From tensorflow with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def testBuildIouSimilarityCalculator(self):
    similarity_calc_text_proto = """
      iou_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IouSimilarity)) 
Example #30
Source File: region_similarity_calculator_builder_test.py    From tensorflow with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def testBuildIoaSimilarityCalculator(self):
    similarity_calc_text_proto = """
      ioa_similarity {
      }
    """
    similarity_calc_proto = sim_calc_pb2.RegionSimilarityCalculator()
    text_format.Merge(similarity_calc_text_proto, similarity_calc_proto)
    similarity_calc = region_similarity_calculator_builder.build(
        similarity_calc_proto)
    self.assertTrue(isinstance(similarity_calc,
                               region_similarity_calculator.IoaSimilarity))