Python object_detection.builders.region_similarity_calculator_builder.build() Examples
The following are 30
code examples of object_detection.builders.region_similarity_calculator_builder.build().
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.builders.region_similarity_calculator_builder
, or try the search function
.
Example #1
Source File: model_builder.py From Live-feed-object-device-identification-using-Tensorflow-and-OpenCV with Apache License 2.0 | 6 votes |
def build(model_config, is_training, add_summaries=True): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. add_summaries: Whether to add tensorflow summaries in the model graph. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training, add_summaries) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training, add_summaries) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #2
Source File: model_builder.py From HereIsWally with MIT License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #3
Source File: model_builder.py From garbage-object-detection-tensorflow with MIT License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #4
Source File: model_builder.py From tensorflow with BSD 2-Clause "Simplified" License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #5
Source File: model_builder.py From ros_people_object_detection_tensorflow with Apache License 2.0 | 6 votes |
def build(model_config, is_training, add_summaries=True): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. add_summaries: Whether to add tensorflow summaries in the model graph. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training, add_summaries) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training, add_summaries) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #6
Source File: model_builder.py From yolo_v2 with Apache License 2.0 | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #7
Source File: model_builder.py From moveo_ros with MIT License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #8
Source File: model_builder.py From vehicle_counting_tensorflow with MIT License | 6 votes |
def build(model_config, is_training, add_summaries=True): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. add_summaries: Whether to add tensorflow summaries in the model graph. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training, add_summaries) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training, add_summaries) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #9
Source File: model_builder.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #10
Source File: model_builder.py From hands-detection with MIT License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #11
Source File: model_builder.py From object_detector_app with MIT License | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #12
Source File: model_builder.py From Traffic-Rule-Violation-Detection-System with MIT License | 6 votes |
def build(model_config, is_training, add_summaries=True): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. add_summaries: Whether to add tensorflow summaries in the model graph. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training, add_summaries) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training, add_summaries) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #13
Source File: model_builder.py From DOTA_models with Apache License 2.0 | 6 votes |
def build(model_config, is_training): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #14
Source File: model_builder.py From moveo_ros with MIT License | 5 votes |
def _build_ssd_feature_extractor(feature_extractor_config, is_training, reuse_weights=None): """Builds a ssd_meta_arch.SSDFeatureExtractor based on config. Args: feature_extractor_config: A SSDFeatureExtractor proto config from ssd.proto. is_training: True if this feature extractor is being built for training. reuse_weights: if the feature extractor should reuse weights. Returns: ssd_meta_arch.SSDFeatureExtractor based on config. Raises: ValueError: On invalid feature extractor type. """ feature_type = feature_extractor_config.type depth_multiplier = feature_extractor_config.depth_multiplier min_depth = feature_extractor_config.min_depth conv_hyperparams = hyperparams_builder.build( feature_extractor_config.conv_hyperparams, is_training) if feature_type not in SSD_FEATURE_EXTRACTOR_CLASS_MAP: raise ValueError('Unknown ssd feature_extractor: {}'.format(feature_type)) feature_extractor_class = SSD_FEATURE_EXTRACTOR_CLASS_MAP[feature_type] return feature_extractor_class(depth_multiplier, min_depth, conv_hyperparams, reuse_weights)
Example #15
Source File: region_similarity_calculator_builder_test.py From moveo_ros with MIT License | 5 votes |
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 #16
Source File: region_similarity_calculator_builder_test.py From moveo_ros with MIT License | 5 votes |
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 #17
Source File: region_similarity_calculator_builder_test.py From BMW-TensorFlow-Training-GUI with Apache License 2.0 | 5 votes |
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 #18
Source File: region_similarity_calculator_builder_test.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
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_test.py From Gun-Detector with Apache License 2.0 | 5 votes |
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 #20
Source File: region_similarity_calculator_builder_test.py From BMW-TensorFlow-Training-GUI with Apache License 2.0 | 5 votes |
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 #21
Source File: model_builder.py From Gun-Detector with Apache License 2.0 | 5 votes |
def _build_ssd_feature_extractor(feature_extractor_config, is_training, reuse_weights=None): """Builds a ssd_meta_arch.SSDFeatureExtractor based on config. Args: feature_extractor_config: A SSDFeatureExtractor proto config from ssd.proto. is_training: True if this feature extractor is being built for training. reuse_weights: if the feature extractor should reuse weights. Returns: ssd_meta_arch.SSDFeatureExtractor based on config. Raises: ValueError: On invalid feature extractor type. """ feature_type = feature_extractor_config.type depth_multiplier = feature_extractor_config.depth_multiplier min_depth = feature_extractor_config.min_depth pad_to_multiple = feature_extractor_config.pad_to_multiple use_explicit_padding = feature_extractor_config.use_explicit_padding use_depthwise = feature_extractor_config.use_depthwise conv_hyperparams = hyperparams_builder.build( feature_extractor_config.conv_hyperparams, is_training) override_base_feature_extractor_hyperparams = ( feature_extractor_config.override_base_feature_extractor_hyperparams) if feature_type not in SSD_FEATURE_EXTRACTOR_CLASS_MAP: raise ValueError('Unknown ssd feature_extractor: {}'.format(feature_type)) feature_extractor_class = SSD_FEATURE_EXTRACTOR_CLASS_MAP[feature_type] return feature_extractor_class( is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, reuse_weights, use_explicit_padding, use_depthwise, override_base_feature_extractor_hyperparams)
Example #22
Source File: model_builder.py From Gun-Detector with Apache License 2.0 | 5 votes |
def build(model_config, is_training, add_summaries=True, add_background_class=True): """Builds a DetectionModel based on the model config. Args: model_config: A model.proto object containing the config for the desired DetectionModel. is_training: True if this model is being built for training purposes. add_summaries: Whether to add tensorflow summaries in the model graph. add_background_class: Whether to add an implicit background class to one-hot encodings of groundtruth labels. Set to false if using groundtruth labels with an explicit background class or using multiclass scores instead of truth in the case of distillation. Ignored in the case of faster_rcnn. Returns: DetectionModel based on the config. Raises: ValueError: On invalid meta architecture or model. """ if not isinstance(model_config, model_pb2.DetectionModel): raise ValueError('model_config not of type model_pb2.DetectionModel.') meta_architecture = model_config.WhichOneof('model') if meta_architecture == 'ssd': return _build_ssd_model(model_config.ssd, is_training, add_summaries, add_background_class) if meta_architecture == 'faster_rcnn': return _build_faster_rcnn_model(model_config.faster_rcnn, is_training, add_summaries) raise ValueError('Unknown meta architecture: {}'.format(meta_architecture))
Example #23
Source File: region_similarity_calculator_builder_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
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 #24
Source File: region_similarity_calculator_builder_test.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
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 #25
Source File: model_builder.py From tensorflow with BSD 2-Clause "Simplified" License | 5 votes |
def _build_ssd_feature_extractor(feature_extractor_config, is_training, reuse_weights=None): """Builds a ssd_meta_arch.SSDFeatureExtractor based on config. Args: feature_extractor_config: A SSDFeatureExtractor proto config from ssd.proto. is_training: True if this feature extractor is being built for training. reuse_weights: if the feature extractor should reuse weights. Returns: ssd_meta_arch.SSDFeatureExtractor based on config. Raises: ValueError: On invalid feature extractor type. """ feature_type = feature_extractor_config.type depth_multiplier = feature_extractor_config.depth_multiplier min_depth = feature_extractor_config.min_depth conv_hyperparams = hyperparams_builder.build( feature_extractor_config.conv_hyperparams, is_training) if feature_type not in SSD_FEATURE_EXTRACTOR_CLASS_MAP: raise ValueError('Unknown ssd feature_extractor: {}'.format(feature_type)) feature_extractor_class = SSD_FEATURE_EXTRACTOR_CLASS_MAP[feature_type] return feature_extractor_class(depth_multiplier, min_depth, conv_hyperparams, reuse_weights)
Example #26
Source File: region_similarity_calculator_builder_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
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 #27
Source File: region_similarity_calculator_builder_test.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
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 #28
Source File: model_builder.py From Hands-On-Machine-Learning-with-OpenCV-4 with MIT License | 5 votes |
def _build_ssd_feature_extractor(feature_extractor_config, is_training, reuse_weights=None): """Builds a ssd_meta_arch.SSDFeatureExtractor based on config. Args: feature_extractor_config: A SSDFeatureExtractor proto config from ssd.proto. is_training: True if this feature extractor is being built for training. reuse_weights: if the feature extractor should reuse weights. Returns: ssd_meta_arch.SSDFeatureExtractor based on config. Raises: ValueError: On invalid feature extractor type. """ feature_type = feature_extractor_config.type depth_multiplier = feature_extractor_config.depth_multiplier min_depth = feature_extractor_config.min_depth conv_hyperparams = hyperparams_builder.build( feature_extractor_config.conv_hyperparams, is_training) if feature_type not in SSD_FEATURE_EXTRACTOR_CLASS_MAP: raise ValueError('Unknown ssd feature_extractor: {}'.format(feature_type)) feature_extractor_class = SSD_FEATURE_EXTRACTOR_CLASS_MAP[feature_type] return feature_extractor_class(depth_multiplier, min_depth, conv_hyperparams, reuse_weights)
Example #29
Source File: region_similarity_calculator_builder_test.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
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: model_builder.py From Traffic-Rule-Violation-Detection-System with MIT License | 5 votes |
def _build_ssd_feature_extractor(feature_extractor_config, is_training, reuse_weights=None): """Builds a ssd_meta_arch.SSDFeatureExtractor based on config. Args: feature_extractor_config: A SSDFeatureExtractor proto config from ssd.proto. is_training: True if this feature extractor is being built for training. reuse_weights: if the feature extractor should reuse weights. Returns: ssd_meta_arch.SSDFeatureExtractor based on config. Raises: ValueError: On invalid feature extractor type. """ feature_type = feature_extractor_config.type depth_multiplier = feature_extractor_config.depth_multiplier min_depth = feature_extractor_config.min_depth pad_to_multiple = feature_extractor_config.pad_to_multiple batch_norm_trainable = feature_extractor_config.batch_norm_trainable use_explicit_padding = feature_extractor_config.use_explicit_padding use_depthwise = feature_extractor_config.use_depthwise conv_hyperparams = hyperparams_builder.build( feature_extractor_config.conv_hyperparams, is_training) if feature_type not in SSD_FEATURE_EXTRACTOR_CLASS_MAP: raise ValueError('Unknown ssd feature_extractor: {}'.format(feature_type)) feature_extractor_class = SSD_FEATURE_EXTRACTOR_CLASS_MAP[feature_type] return feature_extractor_class(is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, batch_norm_trainable, reuse_weights, use_explicit_padding, use_depthwise)