Python object_detection.core.region_similarity_calculator.proto() Examples
The following are 30
code examples of object_detection.core.region_similarity_calculator.proto().
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.core.region_similarity_calculator
, or try the search function
.
Example #1
Source File: region_similarity_calculator_builder.py From hands-detection with MIT License | 5 votes |
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 #2
Source File: region_similarity_calculator_builder.py From multilabel-image-classification-tensorflow with MIT License | 5 votes |
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 #3
Source File: region_similarity_calculator_builder.py From mtl-ssl with Apache License 2.0 | 5 votes |
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 #4
Source File: region_similarity_calculator_builder.py From motion-rcnn with MIT License | 5 votes |
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 #5
Source File: region_similarity_calculator_builder.py From models with Apache License 2.0 | 5 votes |
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 .iou_threshold) raise ValueError('Unknown region similarity calculator.')
Example #6
Source File: region_similarity_calculator_builder.py From g-tensorflow-models with Apache License 2.0 | 5 votes |
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 #7
Source File: region_similarity_calculator_builder.py From MAX-Object-Detector with Apache License 2.0 | 5 votes |
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 #8
Source File: region_similarity_calculator_builder.py From AniSeg with Apache License 2.0 | 5 votes |
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 #9
Source File: region_similarity_calculator_builder.py From object_detection_with_tensorflow with MIT License | 5 votes |
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 #10
Source File: region_similarity_calculator_builder.py From object_detection_with_tensorflow with MIT License | 5 votes |
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 Elphas with Apache License 2.0 | 5 votes |
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.py From MBMD with MIT License | 5 votes |
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 #13
Source File: region_similarity_calculator_builder.py From object_detection_kitti with Apache License 2.0 | 5 votes |
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 #14
Source File: region_similarity_calculator_builder.py From Live-feed-object-device-identification-using-Tensorflow-and-OpenCV with Apache License 2.0 | 5 votes |
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 .iou_threshold) raise ValueError('Unknown region similarity calculator.')
Example #15
Source File: region_similarity_calculator_builder.py From Live-feed-object-device-identification-using-Tensorflow-and-OpenCV with Apache License 2.0 | 5 votes |
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 .iou_threshold) raise ValueError('Unknown region similarity calculator.')
Example #16
Source File: region_similarity_calculator_builder.py From DOTA_models with Apache License 2.0 | 5 votes |
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.py From moveo_ros with MIT License | 5 votes |
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 #18
Source File: region_similarity_calculator_builder.py From BMW-TensorFlow-Training-GUI with Apache License 2.0 | 5 votes |
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 #19
Source File: region_similarity_calculator_builder.py From ros_tensorflow with Apache License 2.0 | 5 votes |
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 #20
Source File: region_similarity_calculator_builder.py From Gun-Detector with Apache License 2.0 | 5 votes |
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 #21
Source File: region_similarity_calculator_builder.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
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 #22
Source File: region_similarity_calculator_builder.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
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 #23
Source File: region_similarity_calculator_builder.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
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.py From yolo_v2 with Apache License 2.0 | 5 votes |
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 #25
Source File: region_similarity_calculator_builder.py From HereIsWally with MIT License | 5 votes |
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 #26
Source File: region_similarity_calculator_builder.py From garbage-object-detection-tensorflow with MIT License | 5 votes |
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 #27
Source File: region_similarity_calculator_builder.py From Person-Detection-and-Tracking with MIT License | 5 votes |
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.py From ros_people_object_detection_tensorflow with Apache License 2.0 | 5 votes |
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 #29
Source File: region_similarity_calculator_builder.py From vehicle_counting_tensorflow with MIT License | 5 votes |
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 #30
Source File: region_similarity_calculator_builder.py From object_detector_app with MIT License | 5 votes |
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.')