Commit f281248c authored by Ronny Votel's avatar Ronny Votel Committed by TF Object Detection Team
Browse files

Update model builder to be backwards compatible with mobilenet_v2_fpn_sep_conv

PiperOrigin-RevId: 368024164
parent f2d90e1a
......@@ -170,6 +170,8 @@ if tf_version.is_tf2():
center_net_mobilenet_v2_feature_extractor.mobilenet_v2,
'mobilenet_v2_fpn':
center_net_mobilenet_v2_fpn_feature_extractor.mobilenet_v2_fpn,
'mobilenet_v2_fpn_sep_conv':
center_net_mobilenet_v2_fpn_feature_extractor.mobilenet_v2_fpn,
}
FEATURE_EXTRACTOR_MAPS = [
......@@ -1123,12 +1125,16 @@ def _build_center_net_feature_extractor(feature_extractor_config, is_training):
if feature_extractor_config.type not in CENTER_NET_EXTRACTOR_FUNCTION_MAP:
raise ValueError('\'{}\' is not a known CenterNet feature extractor type'
.format(feature_extractor_config.type))
# For backwards compatibility:
use_separable_conv = (
feature_extractor_config.use_separable_conv or
feature_extractor_config.type == 'mobilenet_v2_fpn_sep_conv')
kwargs = {
'channel_means': list(feature_extractor_config.channel_means),
'channel_stds': list(feature_extractor_config.channel_stds),
'bgr_ordering': feature_extractor_config.bgr_ordering,
'depth_multiplier': feature_extractor_config.depth_multiplier,
'use_separable_conv': feature_extractor_config.use_separable_conv,
'use_separable_conv': use_separable_conv,
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment