// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: object_detection/protos/ssd.proto

#include "object_detection/protos/ssd.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace object_detection {
namespace protos {
PROTOBUF_CONSTEXPR Ssd_MaskHead::Ssd_MaskHead(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.conv_hyperparams_)*/nullptr
  , /*decltype(_impl_.convolve_then_upsample_masks_)*/false
  , /*decltype(_impl_.mask_height_)*/15
  , /*decltype(_impl_.mask_width_)*/15
  , /*decltype(_impl_.masks_are_class_agnostic_)*/true
  , /*decltype(_impl_.mask_prediction_conv_depth_)*/256
  , /*decltype(_impl_.mask_prediction_num_conv_layers_)*/2
  , /*decltype(_impl_.mask_loss_weight_)*/5
  , /*decltype(_impl_.mask_loss_sample_size_)*/16
  , /*decltype(_impl_.initial_crop_size_)*/15} {}
struct Ssd_MaskHeadDefaultTypeInternal {
  PROTOBUF_CONSTEXPR Ssd_MaskHeadDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~Ssd_MaskHeadDefaultTypeInternal() {}
  union {
    Ssd_MaskHead _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 Ssd_MaskHeadDefaultTypeInternal _Ssd_MaskHead_default_instance_;
PROTOBUF_CONSTEXPR Ssd::Ssd(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.image_resizer_)*/nullptr
  , /*decltype(_impl_.feature_extractor_)*/nullptr
  , /*decltype(_impl_.box_coder_)*/nullptr
  , /*decltype(_impl_.matcher_)*/nullptr
  , /*decltype(_impl_.similarity_calculator_)*/nullptr
  , /*decltype(_impl_.box_predictor_)*/nullptr
  , /*decltype(_impl_.anchor_generator_)*/nullptr
  , /*decltype(_impl_.post_processing_)*/nullptr
  , /*decltype(_impl_.loss_)*/nullptr
  , /*decltype(_impl_.mask_head_config_)*/nullptr
  , /*decltype(_impl_.num_classes_)*/0
  , /*decltype(_impl_.encode_background_as_zeros_)*/false
  , /*decltype(_impl_.normalize_loc_loss_by_codesize_)*/false
  , /*decltype(_impl_.freeze_batchnorm_)*/false
  , /*decltype(_impl_.inplace_batchnorm_update_)*/false
  , /*decltype(_impl_.explicit_background_class_)*/false
  , /*decltype(_impl_.use_confidences_as_targets_)*/false
  , /*decltype(_impl_.implicit_example_weight_)*/1
  , /*decltype(_impl_.negative_class_weight_)*/1
  , /*decltype(_impl_.normalize_loss_by_num_matches_)*/true
  , /*decltype(_impl_.add_background_class_)*/true} {}
struct SsdDefaultTypeInternal {
  PROTOBUF_CONSTEXPR SsdDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~SsdDefaultTypeInternal() {}
  union {
    Ssd _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SsdDefaultTypeInternal _Ssd_default_instance_;
PROTOBUF_CONSTEXPR SsdFeatureExtractor::SsdFeatureExtractor(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.conv_hyperparams_)*/nullptr
  , /*decltype(_impl_.fpn_)*/nullptr
  , /*decltype(_impl_.override_base_feature_extractor_hyperparams_)*/false
  , /*decltype(_impl_.use_explicit_padding_)*/false
  , /*decltype(_impl_.use_depthwise_)*/false
  , /*decltype(_impl_.replace_preprocessor_with_placeholder_)*/false
  , /*decltype(_impl_.depth_multiplier_)*/1
  , /*decltype(_impl_.min_depth_)*/16
  , /*decltype(_impl_.pad_to_multiple_)*/1
  , /*decltype(_impl_.num_layers_)*/6} {}
struct SsdFeatureExtractorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR SsdFeatureExtractorDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~SsdFeatureExtractorDefaultTypeInternal() {}
  union {
    SsdFeatureExtractor _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SsdFeatureExtractorDefaultTypeInternal _SsdFeatureExtractor_default_instance_;
PROTOBUF_CONSTEXPR FeaturePyramidNetworks::FeaturePyramidNetworks(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.additional_layer_depth_)*/256
  , /*decltype(_impl_.min_level_)*/3
  , /*decltype(_impl_.max_level_)*/7} {}
struct FeaturePyramidNetworksDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FeaturePyramidNetworksDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FeaturePyramidNetworksDefaultTypeInternal() {}
  union {
    FeaturePyramidNetworks _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FeaturePyramidNetworksDefaultTypeInternal _FeaturePyramidNetworks_default_instance_;
}  // namespace protos
}  // namespace object_detection
static ::_pb::Metadata file_level_metadata_object_5fdetection_2fprotos_2fssd_2eproto[4];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_object_5fdetection_2fprotos_2fssd_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_object_5fdetection_2fprotos_2fssd_2eproto = nullptr;

const uint32_t TableStruct_object_5fdetection_2fprotos_2fssd_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.mask_height_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.mask_width_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.masks_are_class_agnostic_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.mask_prediction_conv_depth_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.mask_prediction_num_conv_layers_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.convolve_then_upsample_masks_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.mask_loss_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.mask_loss_sample_size_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.conv_hyperparams_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd_MaskHead, _impl_.initial_crop_size_),
  2,
  3,
  4,
  5,
  6,
  1,
  7,
  8,
  0,
  9,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.num_classes_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.image_resizer_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.feature_extractor_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.box_coder_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.matcher_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.similarity_calculator_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.encode_background_as_zeros_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.negative_class_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.box_predictor_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.anchor_generator_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.post_processing_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.normalize_loss_by_num_matches_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.normalize_loc_loss_by_codesize_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.loss_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.freeze_batchnorm_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.inplace_batchnorm_update_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.add_background_class_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.explicit_background_class_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.use_confidences_as_targets_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.implicit_example_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::Ssd, _impl_.mask_head_config_),
  10,
  0,
  1,
  2,
  3,
  4,
  11,
  18,
  5,
  6,
  7,
  19,
  12,
  8,
  13,
  14,
  20,
  15,
  16,
  17,
  9,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.type_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.depth_multiplier_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.min_depth_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.conv_hyperparams_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.override_base_feature_extractor_hyperparams_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.pad_to_multiple_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.use_explicit_padding_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.use_depthwise_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.fpn_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.replace_preprocessor_with_placeholder_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::SsdFeatureExtractor, _impl_.num_layers_),
  0,
  7,
  8,
  1,
  3,
  9,
  4,
  5,
  2,
  6,
  10,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FeaturePyramidNetworks, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FeaturePyramidNetworks, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FeaturePyramidNetworks, _impl_.min_level_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FeaturePyramidNetworks, _impl_.max_level_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FeaturePyramidNetworks, _impl_.additional_layer_depth_),
  1,
  2,
  0,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 16, -1, sizeof(::object_detection::protos::Ssd_MaskHead)},
  { 26, 53, -1, sizeof(::object_detection::protos::Ssd)},
  { 74, 91, -1, sizeof(::object_detection::protos::SsdFeatureExtractor)},
  { 102, 111, -1, sizeof(::object_detection::protos::FeaturePyramidNetworks)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::object_detection::protos::_Ssd_MaskHead_default_instance_._instance,
  &::object_detection::protos::_Ssd_default_instance_._instance,
  &::object_detection::protos::_SsdFeatureExtractor_default_instance_._instance,
  &::object_detection::protos::_FeaturePyramidNetworks_default_instance_._instance,
};

const char descriptor_table_protodef_object_5fdetection_2fprotos_2fssd_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n!object_detection/protos/ssd.proto\022\027obj"
  "ect_detection.protos\032.object_detection/p"
  "rotos/anchor_generator.proto\032\'object_det"
  "ection/protos/box_coder.proto\032+object_de"
  "tection/protos/box_predictor.proto\032)obje"
  "ct_detection/protos/hyperparams.proto\032+o"
  "bject_detection/protos/image_resizer.pro"
  "to\032$object_detection/protos/losses.proto"
  "\032%object_detection/protos/matcher.proto\032"
  "-object_detection/protos/post_processing"
  ".proto\032:object_detection/protos/region_s"
  "imilarity_calculator.proto\"\247\013\n\003Ssd\022\023\n\013nu"
  "m_classes\030\001 \001(\005\022<\n\rimage_resizer\030\002 \001(\0132%"
  ".object_detection.protos.ImageResizer\022G\n"
  "\021feature_extractor\030\003 \001(\0132,.object_detect"
  "ion.protos.SsdFeatureExtractor\0224\n\tbox_co"
  "der\030\004 \001(\0132!.object_detection.protos.BoxC"
  "oder\0221\n\007matcher\030\005 \001(\0132 .object_detection"
  ".protos.Matcher\022R\n\025similarity_calculator"
  "\030\006 \001(\01323.object_detection.protos.RegionS"
  "imilarityCalculator\022)\n\032encode_background"
  "_as_zeros\030\014 \001(\010:\005false\022 \n\025negative_class"
  "_weight\030\r \001(\002:\0011\022<\n\rbox_predictor\030\007 \001(\0132"
  "%.object_detection.protos.BoxPredictor\022B"
  "\n\020anchor_generator\030\010 \001(\0132(.object_detect"
  "ion.protos.AnchorGenerator\022@\n\017post_proce"
  "ssing\030\t \001(\0132\'.object_detection.protos.Po"
  "stProcessing\022+\n\035normalize_loss_by_num_ma"
  "tches\030\n \001(\010:\004true\022-\n\036normalize_loc_loss_"
  "by_codesize\030\016 \001(\010:\005false\022+\n\004loss\030\013 \001(\0132\035"
  ".object_detection.protos.Loss\022\037\n\020freeze_"
  "batchnorm\030\020 \001(\010:\005false\022\'\n\030inplace_batchn"
  "orm_update\030\017 \001(\010:\005false\022\"\n\024add_backgroun"
  "d_class\030\025 \001(\010:\004true\022(\n\031explicit_backgrou"
  "nd_class\030\030 \001(\010:\005false\022)\n\032use_confidences"
  "_as_targets\030\026 \001(\010:\005false\022\"\n\027implicit_exa"
  "mple_weight\030\027 \001(\002:\0011\022\?\n\020mask_head_config"
  "\030\031 \001(\0132%.object_detection.protos.Ssd.Mas"
  "kHead\032\204\003\n\010MaskHead\022\027\n\013mask_height\030\001 \001(\005:"
  "\00215\022\026\n\nmask_width\030\002 \001(\005:\00215\022&\n\030masks_are"
  "_class_agnostic\030\003 \001(\010:\004true\022\'\n\032mask_pred"
  "iction_conv_depth\030\004 \001(\005:\003256\022*\n\037mask_pre"
  "diction_num_conv_layers\030\005 \001(\005:\0012\022+\n\034conv"
  "olve_then_upsample_masks\030\006 \001(\010:\005false\022\033\n"
  "\020mask_loss_weight\030\007 \001(\002:\0015\022!\n\025mask_loss_"
  "sample_size\030\010 \001(\005:\00216\022>\n\020conv_hyperparam"
  "s\030\t \001(\0132$.object_detection.protos.Hyperp"
  "arams\022\035\n\021initial_crop_size\030\n \001(\005:\00215\"\303\003\n"
  "\023SsdFeatureExtractor\022\014\n\004type\030\001 \001(\t\022\033\n\020de"
  "pth_multiplier\030\002 \001(\002:\0011\022\025\n\tmin_depth\030\003 \001"
  "(\005:\00216\022>\n\020conv_hyperparams\030\004 \001(\0132$.objec"
  "t_detection.protos.Hyperparams\022:\n+overri"
  "de_base_feature_extractor_hyperparams\030\t "
  "\001(\010:\005false\022\032\n\017pad_to_multiple\030\005 \001(\005:\0011\022#"
  "\n\024use_explicit_padding\030\007 \001(\010:\005false\022\034\n\ru"
  "se_depthwise\030\010 \001(\010:\005false\022<\n\003fpn\030\n \001(\0132/"
  ".object_detection.protos.FeaturePyramidN"
  "etworks\0224\n%replace_preprocessor_with_pla"
  "ceholder\030\013 \001(\010:\005false\022\025\n\nnum_layers\030\014 \001("
  "\005:\0016J\004\010\006\020\007\"i\n\026FeaturePyramidNetworks\022\024\n\t"
  "min_level\030\001 \001(\005:\0013\022\024\n\tmax_level\030\002 \001(\005:\0017"
  "\022#\n\026additional_layer_depth\030\003 \001(\005:\003256"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_deps[9] = {
  &::descriptor_table_object_5fdetection_2fprotos_2fanchor_5fgenerator_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fbox_5fcoder_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fbox_5fpredictor_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fhyperparams_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2flosses_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fmatcher_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto,
  &::descriptor_table_object_5fdetection_2fprotos_2fregion_5fsimilarity_5fcalculator_2eproto,
};
static ::_pbi::once_flag descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto = {
    false, false, 2477, descriptor_table_protodef_object_5fdetection_2fprotos_2fssd_2eproto,
    "object_detection/protos/ssd.proto",
    &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_once, descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_deps, 9, 4,
    schemas, file_default_instances, TableStruct_object_5fdetection_2fprotos_2fssd_2eproto::offsets,
    file_level_metadata_object_5fdetection_2fprotos_2fssd_2eproto, file_level_enum_descriptors_object_5fdetection_2fprotos_2fssd_2eproto,
    file_level_service_descriptors_object_5fdetection_2fprotos_2fssd_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_getter() {
  return &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_object_5fdetection_2fprotos_2fssd_2eproto(&descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto);
namespace object_detection {
namespace protos {

// ===================================================================

class Ssd_MaskHead::_Internal {
 public:
  using HasBits = decltype(std::declval<Ssd_MaskHead>()._impl_._has_bits_);
  static void set_has_mask_height(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_mask_width(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_masks_are_class_agnostic(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_mask_prediction_conv_depth(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_mask_prediction_num_conv_layers(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_convolve_then_upsample_masks(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_mask_loss_weight(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_mask_loss_sample_size(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static const ::object_detection::protos::Hyperparams& conv_hyperparams(const Ssd_MaskHead* msg);
  static void set_has_conv_hyperparams(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_initial_crop_size(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
};

const ::object_detection::protos::Hyperparams&
Ssd_MaskHead::_Internal::conv_hyperparams(const Ssd_MaskHead* msg) {
  return *msg->_impl_.conv_hyperparams_;
}
void Ssd_MaskHead::clear_conv_hyperparams() {
  if (_impl_.conv_hyperparams_ != nullptr) _impl_.conv_hyperparams_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
Ssd_MaskHead::Ssd_MaskHead(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.Ssd.MaskHead)
}
Ssd_MaskHead::Ssd_MaskHead(const Ssd_MaskHead& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Ssd_MaskHead* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.conv_hyperparams_){nullptr}
    , decltype(_impl_.convolve_then_upsample_masks_){}
    , decltype(_impl_.mask_height_){}
    , decltype(_impl_.mask_width_){}
    , decltype(_impl_.masks_are_class_agnostic_){}
    , decltype(_impl_.mask_prediction_conv_depth_){}
    , decltype(_impl_.mask_prediction_num_conv_layers_){}
    , decltype(_impl_.mask_loss_weight_){}
    , decltype(_impl_.mask_loss_sample_size_){}
    , decltype(_impl_.initial_crop_size_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_conv_hyperparams()) {
    _this->_impl_.conv_hyperparams_ = new ::object_detection::protos::Hyperparams(*from._impl_.conv_hyperparams_);
  }
  ::memcpy(&_impl_.convolve_then_upsample_masks_, &from._impl_.convolve_then_upsample_masks_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.initial_crop_size_) -
    reinterpret_cast<char*>(&_impl_.convolve_then_upsample_masks_)) + sizeof(_impl_.initial_crop_size_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.Ssd.MaskHead)
}

inline void Ssd_MaskHead::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.conv_hyperparams_){nullptr}
    , decltype(_impl_.convolve_then_upsample_masks_){false}
    , decltype(_impl_.mask_height_){15}
    , decltype(_impl_.mask_width_){15}
    , decltype(_impl_.masks_are_class_agnostic_){true}
    , decltype(_impl_.mask_prediction_conv_depth_){256}
    , decltype(_impl_.mask_prediction_num_conv_layers_){2}
    , decltype(_impl_.mask_loss_weight_){5}
    , decltype(_impl_.mask_loss_sample_size_){16}
    , decltype(_impl_.initial_crop_size_){15}
  };
}

Ssd_MaskHead::~Ssd_MaskHead() {
  // @@protoc_insertion_point(destructor:object_detection.protos.Ssd.MaskHead)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Ssd_MaskHead::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.conv_hyperparams_;
}

void Ssd_MaskHead::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Ssd_MaskHead::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.Ssd.MaskHead)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    GOOGLE_DCHECK(_impl_.conv_hyperparams_ != nullptr);
    _impl_.conv_hyperparams_->Clear();
  }
  if (cached_has_bits & 0x000000feu) {
    _impl_.convolve_then_upsample_masks_ = false;
    _impl_.mask_height_ = 15;
    _impl_.mask_width_ = 15;
    _impl_.masks_are_class_agnostic_ = true;
    _impl_.mask_prediction_conv_depth_ = 256;
    _impl_.mask_prediction_num_conv_layers_ = 2;
    _impl_.mask_loss_weight_ = 5;
  }
  if (cached_has_bits & 0x00000300u) {
    _impl_.mask_loss_sample_size_ = 16;
    _impl_.initial_crop_size_ = 15;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Ssd_MaskHead::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 mask_height = 1 [default = 15];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_mask_height(&has_bits);
          _impl_.mask_height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 mask_width = 2 [default = 15];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_mask_width(&has_bits);
          _impl_.mask_width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool masks_are_class_agnostic = 3 [default = true];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_masks_are_class_agnostic(&has_bits);
          _impl_.masks_are_class_agnostic_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 mask_prediction_conv_depth = 4 [default = 256];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_mask_prediction_conv_depth(&has_bits);
          _impl_.mask_prediction_conv_depth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 mask_prediction_num_conv_layers = 5 [default = 2];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_mask_prediction_num_conv_layers(&has_bits);
          _impl_.mask_prediction_num_conv_layers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool convolve_then_upsample_masks = 6 [default = false];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_convolve_then_upsample_masks(&has_bits);
          _impl_.convolve_then_upsample_masks_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float mask_loss_weight = 7 [default = 5];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 61)) {
          _Internal::set_has_mask_loss_weight(&has_bits);
          _impl_.mask_loss_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional int32 mask_loss_sample_size = 8 [default = 16];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_mask_loss_sample_size(&has_bits);
          _impl_.mask_loss_sample_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.Hyperparams conv_hyperparams = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          ptr = ctx->ParseMessage(_internal_mutable_conv_hyperparams(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 initial_crop_size = 10 [default = 15];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
          _Internal::set_has_initial_crop_size(&has_bits);
          _impl_.initial_crop_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Ssd_MaskHead::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.Ssd.MaskHead)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 mask_height = 1 [default = 15];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_mask_height(), target);
  }

  // optional int32 mask_width = 2 [default = 15];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_mask_width(), target);
  }

  // optional bool masks_are_class_agnostic = 3 [default = true];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_masks_are_class_agnostic(), target);
  }

  // optional int32 mask_prediction_conv_depth = 4 [default = 256];
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_mask_prediction_conv_depth(), target);
  }

  // optional int32 mask_prediction_num_conv_layers = 5 [default = 2];
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_mask_prediction_num_conv_layers(), target);
  }

  // optional bool convolve_then_upsample_masks = 6 [default = false];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_convolve_then_upsample_masks(), target);
  }

  // optional float mask_loss_weight = 7 [default = 5];
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(7, this->_internal_mask_loss_weight(), target);
  }

  // optional int32 mask_loss_sample_size = 8 [default = 16];
  if (cached_has_bits & 0x00000100u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(8, this->_internal_mask_loss_sample_size(), target);
  }

  // optional .object_detection.protos.Hyperparams conv_hyperparams = 9;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, _Internal::conv_hyperparams(this),
        _Internal::conv_hyperparams(this).GetCachedSize(), target, stream);
  }

  // optional int32 initial_crop_size = 10 [default = 15];
  if (cached_has_bits & 0x00000200u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(10, this->_internal_initial_crop_size(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:object_detection.protos.Ssd.MaskHead)
  return target;
}

size_t Ssd_MaskHead::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.Ssd.MaskHead)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional .object_detection.protos.Hyperparams conv_hyperparams = 9;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.conv_hyperparams_);
    }

    // optional bool convolve_then_upsample_masks = 6 [default = false];
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 + 1;
    }

    // optional int32 mask_height = 1 [default = 15];
    if (cached_has_bits & 0x00000004u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mask_height());
    }

    // optional int32 mask_width = 2 [default = 15];
    if (cached_has_bits & 0x00000008u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mask_width());
    }

    // optional bool masks_are_class_agnostic = 3 [default = true];
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 1;
    }

    // optional int32 mask_prediction_conv_depth = 4 [default = 256];
    if (cached_has_bits & 0x00000020u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mask_prediction_conv_depth());
    }

    // optional int32 mask_prediction_num_conv_layers = 5 [default = 2];
    if (cached_has_bits & 0x00000040u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mask_prediction_num_conv_layers());
    }

    // optional float mask_loss_weight = 7 [default = 5];
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 + 4;
    }

  }
  if (cached_has_bits & 0x00000300u) {
    // optional int32 mask_loss_sample_size = 8 [default = 16];
    if (cached_has_bits & 0x00000100u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_mask_loss_sample_size());
    }

    // optional int32 initial_crop_size = 10 [default = 15];
    if (cached_has_bits & 0x00000200u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_initial_crop_size());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Ssd_MaskHead::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Ssd_MaskHead::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Ssd_MaskHead::GetClassData() const { return &_class_data_; }


void Ssd_MaskHead::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Ssd_MaskHead*>(&to_msg);
  auto& from = static_cast<const Ssd_MaskHead&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.Ssd.MaskHead)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_conv_hyperparams()->::object_detection::protos::Hyperparams::MergeFrom(
          from._internal_conv_hyperparams());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.convolve_then_upsample_masks_ = from._impl_.convolve_then_upsample_masks_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.mask_height_ = from._impl_.mask_height_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.mask_width_ = from._impl_.mask_width_;
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_impl_.masks_are_class_agnostic_ = from._impl_.masks_are_class_agnostic_;
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_impl_.mask_prediction_conv_depth_ = from._impl_.mask_prediction_conv_depth_;
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_impl_.mask_prediction_num_conv_layers_ = from._impl_.mask_prediction_num_conv_layers_;
    }
    if (cached_has_bits & 0x00000080u) {
      _this->_impl_.mask_loss_weight_ = from._impl_.mask_loss_weight_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00000300u) {
    if (cached_has_bits & 0x00000100u) {
      _this->_impl_.mask_loss_sample_size_ = from._impl_.mask_loss_sample_size_;
    }
    if (cached_has_bits & 0x00000200u) {
      _this->_impl_.initial_crop_size_ = from._impl_.initial_crop_size_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Ssd_MaskHead::CopyFrom(const Ssd_MaskHead& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.Ssd.MaskHead)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Ssd_MaskHead::IsInitialized() const {
  return true;
}

void Ssd_MaskHead::InternalSwap(Ssd_MaskHead* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Ssd_MaskHead, _impl_.convolve_then_upsample_masks_)
      + sizeof(Ssd_MaskHead::_impl_.convolve_then_upsample_masks_)
      - PROTOBUF_FIELD_OFFSET(Ssd_MaskHead, _impl_.conv_hyperparams_)>(
          reinterpret_cast<char*>(&_impl_.conv_hyperparams_),
          reinterpret_cast<char*>(&other->_impl_.conv_hyperparams_));
  swap(_impl_.mask_height_, other->_impl_.mask_height_);
  swap(_impl_.mask_width_, other->_impl_.mask_width_);
  swap(_impl_.masks_are_class_agnostic_, other->_impl_.masks_are_class_agnostic_);
  swap(_impl_.mask_prediction_conv_depth_, other->_impl_.mask_prediction_conv_depth_);
  swap(_impl_.mask_prediction_num_conv_layers_, other->_impl_.mask_prediction_num_conv_layers_);
  swap(_impl_.mask_loss_weight_, other->_impl_.mask_loss_weight_);
  swap(_impl_.mask_loss_sample_size_, other->_impl_.mask_loss_sample_size_);
  swap(_impl_.initial_crop_size_, other->_impl_.initial_crop_size_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Ssd_MaskHead::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fssd_2eproto[0]);
}

// ===================================================================

class Ssd::_Internal {
 public:
  using HasBits = decltype(std::declval<Ssd>()._impl_._has_bits_);
  static void set_has_num_classes(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
  static const ::object_detection::protos::ImageResizer& image_resizer(const Ssd* msg);
  static void set_has_image_resizer(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::object_detection::protos::SsdFeatureExtractor& feature_extractor(const Ssd* msg);
  static void set_has_feature_extractor(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::object_detection::protos::BoxCoder& box_coder(const Ssd* msg);
  static void set_has_box_coder(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static const ::object_detection::protos::Matcher& matcher(const Ssd* msg);
  static void set_has_matcher(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static const ::object_detection::protos::RegionSimilarityCalculator& similarity_calculator(const Ssd* msg);
  static void set_has_similarity_calculator(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_encode_background_as_zeros(HasBits* has_bits) {
    (*has_bits)[0] |= 2048u;
  }
  static void set_has_negative_class_weight(HasBits* has_bits) {
    (*has_bits)[0] |= 262144u;
  }
  static const ::object_detection::protos::BoxPredictor& box_predictor(const Ssd* msg);
  static void set_has_box_predictor(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static const ::object_detection::protos::AnchorGenerator& anchor_generator(const Ssd* msg);
  static void set_has_anchor_generator(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static const ::object_detection::protos::PostProcessing& post_processing(const Ssd* msg);
  static void set_has_post_processing(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_normalize_loss_by_num_matches(HasBits* has_bits) {
    (*has_bits)[0] |= 524288u;
  }
  static void set_has_normalize_loc_loss_by_codesize(HasBits* has_bits) {
    (*has_bits)[0] |= 4096u;
  }
  static const ::object_detection::protos::Loss& loss(const Ssd* msg);
  static void set_has_loss(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static void set_has_freeze_batchnorm(HasBits* has_bits) {
    (*has_bits)[0] |= 8192u;
  }
  static void set_has_inplace_batchnorm_update(HasBits* has_bits) {
    (*has_bits)[0] |= 16384u;
  }
  static void set_has_add_background_class(HasBits* has_bits) {
    (*has_bits)[0] |= 1048576u;
  }
  static void set_has_explicit_background_class(HasBits* has_bits) {
    (*has_bits)[0] |= 32768u;
  }
  static void set_has_use_confidences_as_targets(HasBits* has_bits) {
    (*has_bits)[0] |= 65536u;
  }
  static void set_has_implicit_example_weight(HasBits* has_bits) {
    (*has_bits)[0] |= 131072u;
  }
  static const ::object_detection::protos::Ssd_MaskHead& mask_head_config(const Ssd* msg);
  static void set_has_mask_head_config(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
};

const ::object_detection::protos::ImageResizer&
Ssd::_Internal::image_resizer(const Ssd* msg) {
  return *msg->_impl_.image_resizer_;
}
const ::object_detection::protos::SsdFeatureExtractor&
Ssd::_Internal::feature_extractor(const Ssd* msg) {
  return *msg->_impl_.feature_extractor_;
}
const ::object_detection::protos::BoxCoder&
Ssd::_Internal::box_coder(const Ssd* msg) {
  return *msg->_impl_.box_coder_;
}
const ::object_detection::protos::Matcher&
Ssd::_Internal::matcher(const Ssd* msg) {
  return *msg->_impl_.matcher_;
}
const ::object_detection::protos::RegionSimilarityCalculator&
Ssd::_Internal::similarity_calculator(const Ssd* msg) {
  return *msg->_impl_.similarity_calculator_;
}
const ::object_detection::protos::BoxPredictor&
Ssd::_Internal::box_predictor(const Ssd* msg) {
  return *msg->_impl_.box_predictor_;
}
const ::object_detection::protos::AnchorGenerator&
Ssd::_Internal::anchor_generator(const Ssd* msg) {
  return *msg->_impl_.anchor_generator_;
}
const ::object_detection::protos::PostProcessing&
Ssd::_Internal::post_processing(const Ssd* msg) {
  return *msg->_impl_.post_processing_;
}
const ::object_detection::protos::Loss&
Ssd::_Internal::loss(const Ssd* msg) {
  return *msg->_impl_.loss_;
}
const ::object_detection::protos::Ssd_MaskHead&
Ssd::_Internal::mask_head_config(const Ssd* msg) {
  return *msg->_impl_.mask_head_config_;
}
void Ssd::clear_image_resizer() {
  if (_impl_.image_resizer_ != nullptr) _impl_.image_resizer_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void Ssd::clear_box_coder() {
  if (_impl_.box_coder_ != nullptr) _impl_.box_coder_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
void Ssd::clear_matcher() {
  if (_impl_.matcher_ != nullptr) _impl_.matcher_->Clear();
  _impl_._has_bits_[0] &= ~0x00000008u;
}
void Ssd::clear_similarity_calculator() {
  if (_impl_.similarity_calculator_ != nullptr) _impl_.similarity_calculator_->Clear();
  _impl_._has_bits_[0] &= ~0x00000010u;
}
void Ssd::clear_box_predictor() {
  if (_impl_.box_predictor_ != nullptr) _impl_.box_predictor_->Clear();
  _impl_._has_bits_[0] &= ~0x00000020u;
}
void Ssd::clear_anchor_generator() {
  if (_impl_.anchor_generator_ != nullptr) _impl_.anchor_generator_->Clear();
  _impl_._has_bits_[0] &= ~0x00000040u;
}
void Ssd::clear_post_processing() {
  if (_impl_.post_processing_ != nullptr) _impl_.post_processing_->Clear();
  _impl_._has_bits_[0] &= ~0x00000080u;
}
void Ssd::clear_loss() {
  if (_impl_.loss_ != nullptr) _impl_.loss_->Clear();
  _impl_._has_bits_[0] &= ~0x00000100u;
}
Ssd::Ssd(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.Ssd)
}
Ssd::Ssd(const Ssd& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  Ssd* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.image_resizer_){nullptr}
    , decltype(_impl_.feature_extractor_){nullptr}
    , decltype(_impl_.box_coder_){nullptr}
    , decltype(_impl_.matcher_){nullptr}
    , decltype(_impl_.similarity_calculator_){nullptr}
    , decltype(_impl_.box_predictor_){nullptr}
    , decltype(_impl_.anchor_generator_){nullptr}
    , decltype(_impl_.post_processing_){nullptr}
    , decltype(_impl_.loss_){nullptr}
    , decltype(_impl_.mask_head_config_){nullptr}
    , decltype(_impl_.num_classes_){}
    , decltype(_impl_.encode_background_as_zeros_){}
    , decltype(_impl_.normalize_loc_loss_by_codesize_){}
    , decltype(_impl_.freeze_batchnorm_){}
    , decltype(_impl_.inplace_batchnorm_update_){}
    , decltype(_impl_.explicit_background_class_){}
    , decltype(_impl_.use_confidences_as_targets_){}
    , decltype(_impl_.implicit_example_weight_){}
    , decltype(_impl_.negative_class_weight_){}
    , decltype(_impl_.normalize_loss_by_num_matches_){}
    , decltype(_impl_.add_background_class_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_image_resizer()) {
    _this->_impl_.image_resizer_ = new ::object_detection::protos::ImageResizer(*from._impl_.image_resizer_);
  }
  if (from._internal_has_feature_extractor()) {
    _this->_impl_.feature_extractor_ = new ::object_detection::protos::SsdFeatureExtractor(*from._impl_.feature_extractor_);
  }
  if (from._internal_has_box_coder()) {
    _this->_impl_.box_coder_ = new ::object_detection::protos::BoxCoder(*from._impl_.box_coder_);
  }
  if (from._internal_has_matcher()) {
    _this->_impl_.matcher_ = new ::object_detection::protos::Matcher(*from._impl_.matcher_);
  }
  if (from._internal_has_similarity_calculator()) {
    _this->_impl_.similarity_calculator_ = new ::object_detection::protos::RegionSimilarityCalculator(*from._impl_.similarity_calculator_);
  }
  if (from._internal_has_box_predictor()) {
    _this->_impl_.box_predictor_ = new ::object_detection::protos::BoxPredictor(*from._impl_.box_predictor_);
  }
  if (from._internal_has_anchor_generator()) {
    _this->_impl_.anchor_generator_ = new ::object_detection::protos::AnchorGenerator(*from._impl_.anchor_generator_);
  }
  if (from._internal_has_post_processing()) {
    _this->_impl_.post_processing_ = new ::object_detection::protos::PostProcessing(*from._impl_.post_processing_);
  }
  if (from._internal_has_loss()) {
    _this->_impl_.loss_ = new ::object_detection::protos::Loss(*from._impl_.loss_);
  }
  if (from._internal_has_mask_head_config()) {
    _this->_impl_.mask_head_config_ = new ::object_detection::protos::Ssd_MaskHead(*from._impl_.mask_head_config_);
  }
  ::memcpy(&_impl_.num_classes_, &from._impl_.num_classes_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.add_background_class_) -
    reinterpret_cast<char*>(&_impl_.num_classes_)) + sizeof(_impl_.add_background_class_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.Ssd)
}

inline void Ssd::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.image_resizer_){nullptr}
    , decltype(_impl_.feature_extractor_){nullptr}
    , decltype(_impl_.box_coder_){nullptr}
    , decltype(_impl_.matcher_){nullptr}
    , decltype(_impl_.similarity_calculator_){nullptr}
    , decltype(_impl_.box_predictor_){nullptr}
    , decltype(_impl_.anchor_generator_){nullptr}
    , decltype(_impl_.post_processing_){nullptr}
    , decltype(_impl_.loss_){nullptr}
    , decltype(_impl_.mask_head_config_){nullptr}
    , decltype(_impl_.num_classes_){0}
    , decltype(_impl_.encode_background_as_zeros_){false}
    , decltype(_impl_.normalize_loc_loss_by_codesize_){false}
    , decltype(_impl_.freeze_batchnorm_){false}
    , decltype(_impl_.inplace_batchnorm_update_){false}
    , decltype(_impl_.explicit_background_class_){false}
    , decltype(_impl_.use_confidences_as_targets_){false}
    , decltype(_impl_.implicit_example_weight_){1}
    , decltype(_impl_.negative_class_weight_){1}
    , decltype(_impl_.normalize_loss_by_num_matches_){true}
    , decltype(_impl_.add_background_class_){true}
  };
}

Ssd::~Ssd() {
  // @@protoc_insertion_point(destructor:object_detection.protos.Ssd)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void Ssd::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (this != internal_default_instance()) delete _impl_.image_resizer_;
  if (this != internal_default_instance()) delete _impl_.feature_extractor_;
  if (this != internal_default_instance()) delete _impl_.box_coder_;
  if (this != internal_default_instance()) delete _impl_.matcher_;
  if (this != internal_default_instance()) delete _impl_.similarity_calculator_;
  if (this != internal_default_instance()) delete _impl_.box_predictor_;
  if (this != internal_default_instance()) delete _impl_.anchor_generator_;
  if (this != internal_default_instance()) delete _impl_.post_processing_;
  if (this != internal_default_instance()) delete _impl_.loss_;
  if (this != internal_default_instance()) delete _impl_.mask_head_config_;
}

void Ssd::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void Ssd::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.Ssd)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(_impl_.image_resizer_ != nullptr);
      _impl_.image_resizer_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(_impl_.feature_extractor_ != nullptr);
      _impl_.feature_extractor_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(_impl_.box_coder_ != nullptr);
      _impl_.box_coder_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(_impl_.matcher_ != nullptr);
      _impl_.matcher_->Clear();
    }
    if (cached_has_bits & 0x00000010u) {
      GOOGLE_DCHECK(_impl_.similarity_calculator_ != nullptr);
      _impl_.similarity_calculator_->Clear();
    }
    if (cached_has_bits & 0x00000020u) {
      GOOGLE_DCHECK(_impl_.box_predictor_ != nullptr);
      _impl_.box_predictor_->Clear();
    }
    if (cached_has_bits & 0x00000040u) {
      GOOGLE_DCHECK(_impl_.anchor_generator_ != nullptr);
      _impl_.anchor_generator_->Clear();
    }
    if (cached_has_bits & 0x00000080u) {
      GOOGLE_DCHECK(_impl_.post_processing_ != nullptr);
      _impl_.post_processing_->Clear();
    }
  }
  if (cached_has_bits & 0x00000300u) {
    if (cached_has_bits & 0x00000100u) {
      GOOGLE_DCHECK(_impl_.loss_ != nullptr);
      _impl_.loss_->Clear();
    }
    if (cached_has_bits & 0x00000200u) {
      GOOGLE_DCHECK(_impl_.mask_head_config_ != nullptr);
      _impl_.mask_head_config_->Clear();
    }
  }
  if (cached_has_bits & 0x0000fc00u) {
    ::memset(&_impl_.num_classes_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.explicit_background_class_) -
        reinterpret_cast<char*>(&_impl_.num_classes_)) + sizeof(_impl_.explicit_background_class_));
  }
  if (cached_has_bits & 0x001f0000u) {
    _impl_.use_confidences_as_targets_ = false;
    _impl_.implicit_example_weight_ = 1;
    _impl_.negative_class_weight_ = 1;
    _impl_.normalize_loss_by_num_matches_ = true;
    _impl_.add_background_class_ = true;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* Ssd::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 num_classes = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_num_classes(&has_bits);
          _impl_.num_classes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.ImageResizer image_resizer = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_image_resizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.SsdFeatureExtractor feature_extractor = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_feature_extractor(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.BoxCoder box_coder = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_box_coder(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.Matcher matcher = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_matcher(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.RegionSimilarityCalculator similarity_calculator = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          ptr = ctx->ParseMessage(_internal_mutable_similarity_calculator(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.BoxPredictor box_predictor = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          ptr = ctx->ParseMessage(_internal_mutable_box_predictor(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.AnchorGenerator anchor_generator = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_anchor_generator(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.PostProcessing post_processing = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
          ptr = ctx->ParseMessage(_internal_mutable_post_processing(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool normalize_loss_by_num_matches = 10 [default = true];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
          _Internal::set_has_normalize_loss_by_num_matches(&has_bits);
          _impl_.normalize_loss_by_num_matches_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.Loss loss = 11;
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 90)) {
          ptr = ctx->ParseMessage(_internal_mutable_loss(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool encode_background_as_zeros = 12 [default = false];
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
          _Internal::set_has_encode_background_as_zeros(&has_bits);
          _impl_.encode_background_as_zeros_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float negative_class_weight = 13 [default = 1];
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 109)) {
          _Internal::set_has_negative_class_weight(&has_bits);
          _impl_.negative_class_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional bool normalize_loc_loss_by_codesize = 14 [default = false];
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 112)) {
          _Internal::set_has_normalize_loc_loss_by_codesize(&has_bits);
          _impl_.normalize_loc_loss_by_codesize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool inplace_batchnorm_update = 15 [default = false];
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
          _Internal::set_has_inplace_batchnorm_update(&has_bits);
          _impl_.inplace_batchnorm_update_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool freeze_batchnorm = 16 [default = false];
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 128)) {
          _Internal::set_has_freeze_batchnorm(&has_bits);
          _impl_.freeze_batchnorm_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool add_background_class = 21 [default = true];
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
          _Internal::set_has_add_background_class(&has_bits);
          _impl_.add_background_class_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_confidences_as_targets = 22 [default = false];
      case 22:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 176)) {
          _Internal::set_has_use_confidences_as_targets(&has_bits);
          _impl_.use_confidences_as_targets_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float implicit_example_weight = 23 [default = 1];
      case 23:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 189)) {
          _Internal::set_has_implicit_example_weight(&has_bits);
          _impl_.implicit_example_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional bool explicit_background_class = 24 [default = false];
      case 24:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 192)) {
          _Internal::set_has_explicit_background_class(&has_bits);
          _impl_.explicit_background_class_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.Ssd.MaskHead mask_head_config = 25;
      case 25:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 202)) {
          ptr = ctx->ParseMessage(_internal_mutable_mask_head_config(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* Ssd::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.Ssd)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 num_classes = 1;
  if (cached_has_bits & 0x00000400u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_num_classes(), target);
  }

  // optional .object_detection.protos.ImageResizer image_resizer = 2;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(2, _Internal::image_resizer(this),
        _Internal::image_resizer(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.SsdFeatureExtractor feature_extractor = 3;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(3, _Internal::feature_extractor(this),
        _Internal::feature_extractor(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.BoxCoder box_coder = 4;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::box_coder(this),
        _Internal::box_coder(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.Matcher matcher = 5;
  if (cached_has_bits & 0x00000008u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(5, _Internal::matcher(this),
        _Internal::matcher(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.RegionSimilarityCalculator similarity_calculator = 6;
  if (cached_has_bits & 0x00000010u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(6, _Internal::similarity_calculator(this),
        _Internal::similarity_calculator(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.BoxPredictor box_predictor = 7;
  if (cached_has_bits & 0x00000020u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(7, _Internal::box_predictor(this),
        _Internal::box_predictor(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.AnchorGenerator anchor_generator = 8;
  if (cached_has_bits & 0x00000040u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(8, _Internal::anchor_generator(this),
        _Internal::anchor_generator(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.PostProcessing post_processing = 9;
  if (cached_has_bits & 0x00000080u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(9, _Internal::post_processing(this),
        _Internal::post_processing(this).GetCachedSize(), target, stream);
  }

  // optional bool normalize_loss_by_num_matches = 10 [default = true];
  if (cached_has_bits & 0x00080000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_normalize_loss_by_num_matches(), target);
  }

  // optional .object_detection.protos.Loss loss = 11;
  if (cached_has_bits & 0x00000100u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(11, _Internal::loss(this),
        _Internal::loss(this).GetCachedSize(), target, stream);
  }

  // optional bool encode_background_as_zeros = 12 [default = false];
  if (cached_has_bits & 0x00000800u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_encode_background_as_zeros(), target);
  }

  // optional float negative_class_weight = 13 [default = 1];
  if (cached_has_bits & 0x00040000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(13, this->_internal_negative_class_weight(), target);
  }

  // optional bool normalize_loc_loss_by_codesize = 14 [default = false];
  if (cached_has_bits & 0x00001000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(14, this->_internal_normalize_loc_loss_by_codesize(), target);
  }

  // optional bool inplace_batchnorm_update = 15 [default = false];
  if (cached_has_bits & 0x00004000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(15, this->_internal_inplace_batchnorm_update(), target);
  }

  // optional bool freeze_batchnorm = 16 [default = false];
  if (cached_has_bits & 0x00002000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(16, this->_internal_freeze_batchnorm(), target);
  }

  // optional bool add_background_class = 21 [default = true];
  if (cached_has_bits & 0x00100000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(21, this->_internal_add_background_class(), target);
  }

  // optional bool use_confidences_as_targets = 22 [default = false];
  if (cached_has_bits & 0x00010000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(22, this->_internal_use_confidences_as_targets(), target);
  }

  // optional float implicit_example_weight = 23 [default = 1];
  if (cached_has_bits & 0x00020000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(23, this->_internal_implicit_example_weight(), target);
  }

  // optional bool explicit_background_class = 24 [default = false];
  if (cached_has_bits & 0x00008000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(24, this->_internal_explicit_background_class(), target);
  }

  // optional .object_detection.protos.Ssd.MaskHead mask_head_config = 25;
  if (cached_has_bits & 0x00000200u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(25, _Internal::mask_head_config(this),
        _Internal::mask_head_config(this).GetCachedSize(), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:object_detection.protos.Ssd)
  return target;
}

size_t Ssd::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.Ssd)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional .object_detection.protos.ImageResizer image_resizer = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.image_resizer_);
    }

    // optional .object_detection.protos.SsdFeatureExtractor feature_extractor = 3;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.feature_extractor_);
    }

    // optional .object_detection.protos.BoxCoder box_coder = 4;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.box_coder_);
    }

    // optional .object_detection.protos.Matcher matcher = 5;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.matcher_);
    }

    // optional .object_detection.protos.RegionSimilarityCalculator similarity_calculator = 6;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.similarity_calculator_);
    }

    // optional .object_detection.protos.BoxPredictor box_predictor = 7;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.box_predictor_);
    }

    // optional .object_detection.protos.AnchorGenerator anchor_generator = 8;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.anchor_generator_);
    }

    // optional .object_detection.protos.PostProcessing post_processing = 9;
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.post_processing_);
    }

  }
  if (cached_has_bits & 0x0000ff00u) {
    // optional .object_detection.protos.Loss loss = 11;
    if (cached_has_bits & 0x00000100u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.loss_);
    }

    // optional .object_detection.protos.Ssd.MaskHead mask_head_config = 25;
    if (cached_has_bits & 0x00000200u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.mask_head_config_);
    }

    // optional int32 num_classes = 1;
    if (cached_has_bits & 0x00000400u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_num_classes());
    }

    // optional bool encode_background_as_zeros = 12 [default = false];
    if (cached_has_bits & 0x00000800u) {
      total_size += 1 + 1;
    }

    // optional bool normalize_loc_loss_by_codesize = 14 [default = false];
    if (cached_has_bits & 0x00001000u) {
      total_size += 1 + 1;
    }

    // optional bool freeze_batchnorm = 16 [default = false];
    if (cached_has_bits & 0x00002000u) {
      total_size += 2 + 1;
    }

    // optional bool inplace_batchnorm_update = 15 [default = false];
    if (cached_has_bits & 0x00004000u) {
      total_size += 1 + 1;
    }

    // optional bool explicit_background_class = 24 [default = false];
    if (cached_has_bits & 0x00008000u) {
      total_size += 2 + 1;
    }

  }
  if (cached_has_bits & 0x001f0000u) {
    // optional bool use_confidences_as_targets = 22 [default = false];
    if (cached_has_bits & 0x00010000u) {
      total_size += 2 + 1;
    }

    // optional float implicit_example_weight = 23 [default = 1];
    if (cached_has_bits & 0x00020000u) {
      total_size += 2 + 4;
    }

    // optional float negative_class_weight = 13 [default = 1];
    if (cached_has_bits & 0x00040000u) {
      total_size += 1 + 4;
    }

    // optional bool normalize_loss_by_num_matches = 10 [default = true];
    if (cached_has_bits & 0x00080000u) {
      total_size += 1 + 1;
    }

    // optional bool add_background_class = 21 [default = true];
    if (cached_has_bits & 0x00100000u) {
      total_size += 2 + 1;
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Ssd::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    Ssd::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Ssd::GetClassData() const { return &_class_data_; }


void Ssd::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<Ssd*>(&to_msg);
  auto& from = static_cast<const Ssd&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.Ssd)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_image_resizer()->::object_detection::protos::ImageResizer::MergeFrom(
          from._internal_image_resizer());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_feature_extractor()->::object_detection::protos::SsdFeatureExtractor::MergeFrom(
          from._internal_feature_extractor());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_box_coder()->::object_detection::protos::BoxCoder::MergeFrom(
          from._internal_box_coder());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_internal_mutable_matcher()->::object_detection::protos::Matcher::MergeFrom(
          from._internal_matcher());
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_internal_mutable_similarity_calculator()->::object_detection::protos::RegionSimilarityCalculator::MergeFrom(
          from._internal_similarity_calculator());
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_internal_mutable_box_predictor()->::object_detection::protos::BoxPredictor::MergeFrom(
          from._internal_box_predictor());
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_internal_mutable_anchor_generator()->::object_detection::protos::AnchorGenerator::MergeFrom(
          from._internal_anchor_generator());
    }
    if (cached_has_bits & 0x00000080u) {
      _this->_internal_mutable_post_processing()->::object_detection::protos::PostProcessing::MergeFrom(
          from._internal_post_processing());
    }
  }
  if (cached_has_bits & 0x0000ff00u) {
    if (cached_has_bits & 0x00000100u) {
      _this->_internal_mutable_loss()->::object_detection::protos::Loss::MergeFrom(
          from._internal_loss());
    }
    if (cached_has_bits & 0x00000200u) {
      _this->_internal_mutable_mask_head_config()->::object_detection::protos::Ssd_MaskHead::MergeFrom(
          from._internal_mask_head_config());
    }
    if (cached_has_bits & 0x00000400u) {
      _this->_impl_.num_classes_ = from._impl_.num_classes_;
    }
    if (cached_has_bits & 0x00000800u) {
      _this->_impl_.encode_background_as_zeros_ = from._impl_.encode_background_as_zeros_;
    }
    if (cached_has_bits & 0x00001000u) {
      _this->_impl_.normalize_loc_loss_by_codesize_ = from._impl_.normalize_loc_loss_by_codesize_;
    }
    if (cached_has_bits & 0x00002000u) {
      _this->_impl_.freeze_batchnorm_ = from._impl_.freeze_batchnorm_;
    }
    if (cached_has_bits & 0x00004000u) {
      _this->_impl_.inplace_batchnorm_update_ = from._impl_.inplace_batchnorm_update_;
    }
    if (cached_has_bits & 0x00008000u) {
      _this->_impl_.explicit_background_class_ = from._impl_.explicit_background_class_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x001f0000u) {
    if (cached_has_bits & 0x00010000u) {
      _this->_impl_.use_confidences_as_targets_ = from._impl_.use_confidences_as_targets_;
    }
    if (cached_has_bits & 0x00020000u) {
      _this->_impl_.implicit_example_weight_ = from._impl_.implicit_example_weight_;
    }
    if (cached_has_bits & 0x00040000u) {
      _this->_impl_.negative_class_weight_ = from._impl_.negative_class_weight_;
    }
    if (cached_has_bits & 0x00080000u) {
      _this->_impl_.normalize_loss_by_num_matches_ = from._impl_.normalize_loss_by_num_matches_;
    }
    if (cached_has_bits & 0x00100000u) {
      _this->_impl_.add_background_class_ = from._impl_.add_background_class_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void Ssd::CopyFrom(const Ssd& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.Ssd)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Ssd::IsInitialized() const {
  return true;
}

void Ssd::InternalSwap(Ssd* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(Ssd, _impl_.use_confidences_as_targets_)
      + sizeof(Ssd::_impl_.use_confidences_as_targets_)
      - PROTOBUF_FIELD_OFFSET(Ssd, _impl_.image_resizer_)>(
          reinterpret_cast<char*>(&_impl_.image_resizer_),
          reinterpret_cast<char*>(&other->_impl_.image_resizer_));
  swap(_impl_.implicit_example_weight_, other->_impl_.implicit_example_weight_);
  swap(_impl_.negative_class_weight_, other->_impl_.negative_class_weight_);
  swap(_impl_.normalize_loss_by_num_matches_, other->_impl_.normalize_loss_by_num_matches_);
  swap(_impl_.add_background_class_, other->_impl_.add_background_class_);
}

::PROTOBUF_NAMESPACE_ID::Metadata Ssd::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fssd_2eproto[1]);
}

// ===================================================================

class SsdFeatureExtractor::_Internal {
 public:
  using HasBits = decltype(std::declval<SsdFeatureExtractor>()._impl_._has_bits_);
  static void set_has_type(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_depth_multiplier(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_min_depth(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static const ::object_detection::protos::Hyperparams& conv_hyperparams(const SsdFeatureExtractor* msg);
  static void set_has_conv_hyperparams(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_override_base_feature_extractor_hyperparams(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_pad_to_multiple(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
  static void set_has_use_explicit_padding(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_use_depthwise(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static const ::object_detection::protos::FeaturePyramidNetworks& fpn(const SsdFeatureExtractor* msg);
  static void set_has_fpn(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_replace_preprocessor_with_placeholder(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_num_layers(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
};

const ::object_detection::protos::Hyperparams&
SsdFeatureExtractor::_Internal::conv_hyperparams(const SsdFeatureExtractor* msg) {
  return *msg->_impl_.conv_hyperparams_;
}
const ::object_detection::protos::FeaturePyramidNetworks&
SsdFeatureExtractor::_Internal::fpn(const SsdFeatureExtractor* msg) {
  return *msg->_impl_.fpn_;
}
void SsdFeatureExtractor::clear_conv_hyperparams() {
  if (_impl_.conv_hyperparams_ != nullptr) _impl_.conv_hyperparams_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
SsdFeatureExtractor::SsdFeatureExtractor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.SsdFeatureExtractor)
}
SsdFeatureExtractor::SsdFeatureExtractor(const SsdFeatureExtractor& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  SsdFeatureExtractor* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.type_){}
    , decltype(_impl_.conv_hyperparams_){nullptr}
    , decltype(_impl_.fpn_){nullptr}
    , decltype(_impl_.override_base_feature_extractor_hyperparams_){}
    , decltype(_impl_.use_explicit_padding_){}
    , decltype(_impl_.use_depthwise_){}
    , decltype(_impl_.replace_preprocessor_with_placeholder_){}
    , decltype(_impl_.depth_multiplier_){}
    , decltype(_impl_.min_depth_){}
    , decltype(_impl_.pad_to_multiple_){}
    , decltype(_impl_.num_layers_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  _impl_.type_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.type_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_type()) {
    _this->_impl_.type_.Set(from._internal_type(), 
      _this->GetArenaForAllocation());
  }
  if (from._internal_has_conv_hyperparams()) {
    _this->_impl_.conv_hyperparams_ = new ::object_detection::protos::Hyperparams(*from._impl_.conv_hyperparams_);
  }
  if (from._internal_has_fpn()) {
    _this->_impl_.fpn_ = new ::object_detection::protos::FeaturePyramidNetworks(*from._impl_.fpn_);
  }
  ::memcpy(&_impl_.override_base_feature_extractor_hyperparams_, &from._impl_.override_base_feature_extractor_hyperparams_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.num_layers_) -
    reinterpret_cast<char*>(&_impl_.override_base_feature_extractor_hyperparams_)) + sizeof(_impl_.num_layers_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.SsdFeatureExtractor)
}

inline void SsdFeatureExtractor::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.type_){}
    , decltype(_impl_.conv_hyperparams_){nullptr}
    , decltype(_impl_.fpn_){nullptr}
    , decltype(_impl_.override_base_feature_extractor_hyperparams_){false}
    , decltype(_impl_.use_explicit_padding_){false}
    , decltype(_impl_.use_depthwise_){false}
    , decltype(_impl_.replace_preprocessor_with_placeholder_){false}
    , decltype(_impl_.depth_multiplier_){1}
    , decltype(_impl_.min_depth_){16}
    , decltype(_impl_.pad_to_multiple_){1}
    , decltype(_impl_.num_layers_){6}
  };
  _impl_.type_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.type_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

SsdFeatureExtractor::~SsdFeatureExtractor() {
  // @@protoc_insertion_point(destructor:object_detection.protos.SsdFeatureExtractor)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void SsdFeatureExtractor::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.type_.Destroy();
  if (this != internal_default_instance()) delete _impl_.conv_hyperparams_;
  if (this != internal_default_instance()) delete _impl_.fpn_;
}

void SsdFeatureExtractor::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void SsdFeatureExtractor::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.SsdFeatureExtractor)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _impl_.type_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(_impl_.conv_hyperparams_ != nullptr);
      _impl_.conv_hyperparams_->Clear();
    }
    if (cached_has_bits & 0x00000004u) {
      GOOGLE_DCHECK(_impl_.fpn_ != nullptr);
      _impl_.fpn_->Clear();
    }
  }
  ::memset(&_impl_.override_base_feature_extractor_hyperparams_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&_impl_.replace_preprocessor_with_placeholder_) -
      reinterpret_cast<char*>(&_impl_.override_base_feature_extractor_hyperparams_)) + sizeof(_impl_.replace_preprocessor_with_placeholder_));
  _impl_.depth_multiplier_ = 1;
  if (cached_has_bits & 0x00000700u) {
    _impl_.min_depth_ = 16;
    _impl_.pad_to_multiple_ = 1;
    _impl_.num_layers_ = 6;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* SsdFeatureExtractor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional string type = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          auto str = _internal_mutable_type();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
          #ifndef NDEBUG
          ::_pbi::VerifyUTF8(str, "object_detection.protos.SsdFeatureExtractor.type");
          #endif  // !NDEBUG
        } else
          goto handle_unusual;
        continue;
      // optional float depth_multiplier = 2 [default = 1];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _Internal::set_has_depth_multiplier(&has_bits);
          _impl_.depth_multiplier_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional int32 min_depth = 3 [default = 16];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_min_depth(&has_bits);
          _impl_.min_depth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.Hyperparams conv_hyperparams = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_conv_hyperparams(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 pad_to_multiple = 5 [default = 1];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_pad_to_multiple(&has_bits);
          _impl_.pad_to_multiple_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_explicit_padding = 7 [default = false];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_use_explicit_padding(&has_bits);
          _impl_.use_explicit_padding_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_depthwise = 8 [default = false];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_use_depthwise(&has_bits);
          _impl_.use_depthwise_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool override_base_feature_extractor_hyperparams = 9 [default = false];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          _Internal::set_has_override_base_feature_extractor_hyperparams(&has_bits);
          _impl_.override_base_feature_extractor_hyperparams_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.FeaturePyramidNetworks fpn = 10;
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
          ptr = ctx->ParseMessage(_internal_mutable_fpn(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool replace_preprocessor_with_placeholder = 11 [default = false];
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          _Internal::set_has_replace_preprocessor_with_placeholder(&has_bits);
          _impl_.replace_preprocessor_with_placeholder_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 num_layers = 12 [default = 6];
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
          _Internal::set_has_num_layers(&has_bits);
          _impl_.num_layers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* SsdFeatureExtractor::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.SsdFeatureExtractor)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional string type = 1;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_type().data(), static_cast<int>(this->_internal_type().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "object_detection.protos.SsdFeatureExtractor.type");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_type(), target);
  }

  // optional float depth_multiplier = 2 [default = 1];
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_depth_multiplier(), target);
  }

  // optional int32 min_depth = 3 [default = 16];
  if (cached_has_bits & 0x00000100u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_min_depth(), target);
  }

  // optional .object_detection.protos.Hyperparams conv_hyperparams = 4;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::conv_hyperparams(this),
        _Internal::conv_hyperparams(this).GetCachedSize(), target, stream);
  }

  // optional int32 pad_to_multiple = 5 [default = 1];
  if (cached_has_bits & 0x00000200u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_pad_to_multiple(), target);
  }

  // optional bool use_explicit_padding = 7 [default = false];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_use_explicit_padding(), target);
  }

  // optional bool use_depthwise = 8 [default = false];
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_use_depthwise(), target);
  }

  // optional bool override_base_feature_extractor_hyperparams = 9 [default = false];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_override_base_feature_extractor_hyperparams(), target);
  }

  // optional .object_detection.protos.FeaturePyramidNetworks fpn = 10;
  if (cached_has_bits & 0x00000004u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(10, _Internal::fpn(this),
        _Internal::fpn(this).GetCachedSize(), target, stream);
  }

  // optional bool replace_preprocessor_with_placeholder = 11 [default = false];
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_replace_preprocessor_with_placeholder(), target);
  }

  // optional int32 num_layers = 12 [default = 6];
  if (cached_has_bits & 0x00000400u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(12, this->_internal_num_layers(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:object_detection.protos.SsdFeatureExtractor)
  return target;
}

size_t SsdFeatureExtractor::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.SsdFeatureExtractor)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    // optional string type = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_type());
    }

    // optional .object_detection.protos.Hyperparams conv_hyperparams = 4;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.conv_hyperparams_);
    }

    // optional .object_detection.protos.FeaturePyramidNetworks fpn = 10;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.fpn_);
    }

    // optional bool override_base_feature_extractor_hyperparams = 9 [default = false];
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 + 1;
    }

    // optional bool use_explicit_padding = 7 [default = false];
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 1;
    }

    // optional bool use_depthwise = 8 [default = false];
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 + 1;
    }

    // optional bool replace_preprocessor_with_placeholder = 11 [default = false];
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 + 1;
    }

    // optional float depth_multiplier = 2 [default = 1];
    if (cached_has_bits & 0x00000080u) {
      total_size += 1 + 4;
    }

  }
  if (cached_has_bits & 0x00000700u) {
    // optional int32 min_depth = 3 [default = 16];
    if (cached_has_bits & 0x00000100u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_min_depth());
    }

    // optional int32 pad_to_multiple = 5 [default = 1];
    if (cached_has_bits & 0x00000200u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pad_to_multiple());
    }

    // optional int32 num_layers = 12 [default = 6];
    if (cached_has_bits & 0x00000400u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_num_layers());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SsdFeatureExtractor::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    SsdFeatureExtractor::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SsdFeatureExtractor::GetClassData() const { return &_class_data_; }


void SsdFeatureExtractor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<SsdFeatureExtractor*>(&to_msg);
  auto& from = static_cast<const SsdFeatureExtractor&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.SsdFeatureExtractor)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_set_type(from._internal_type());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_conv_hyperparams()->::object_detection::protos::Hyperparams::MergeFrom(
          from._internal_conv_hyperparams());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_fpn()->::object_detection::protos::FeaturePyramidNetworks::MergeFrom(
          from._internal_fpn());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.override_base_feature_extractor_hyperparams_ = from._impl_.override_base_feature_extractor_hyperparams_;
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_impl_.use_explicit_padding_ = from._impl_.use_explicit_padding_;
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_impl_.use_depthwise_ = from._impl_.use_depthwise_;
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_impl_.replace_preprocessor_with_placeholder_ = from._impl_.replace_preprocessor_with_placeholder_;
    }
    if (cached_has_bits & 0x00000080u) {
      _this->_impl_.depth_multiplier_ = from._impl_.depth_multiplier_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00000700u) {
    if (cached_has_bits & 0x00000100u) {
      _this->_impl_.min_depth_ = from._impl_.min_depth_;
    }
    if (cached_has_bits & 0x00000200u) {
      _this->_impl_.pad_to_multiple_ = from._impl_.pad_to_multiple_;
    }
    if (cached_has_bits & 0x00000400u) {
      _this->_impl_.num_layers_ = from._impl_.num_layers_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void SsdFeatureExtractor::CopyFrom(const SsdFeatureExtractor& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.SsdFeatureExtractor)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SsdFeatureExtractor::IsInitialized() const {
  return true;
}

void SsdFeatureExtractor::InternalSwap(SsdFeatureExtractor* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &_impl_.type_, lhs_arena,
      &other->_impl_.type_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(SsdFeatureExtractor, _impl_.replace_preprocessor_with_placeholder_)
      + sizeof(SsdFeatureExtractor::_impl_.replace_preprocessor_with_placeholder_)
      - PROTOBUF_FIELD_OFFSET(SsdFeatureExtractor, _impl_.conv_hyperparams_)>(
          reinterpret_cast<char*>(&_impl_.conv_hyperparams_),
          reinterpret_cast<char*>(&other->_impl_.conv_hyperparams_));
  swap(_impl_.depth_multiplier_, other->_impl_.depth_multiplier_);
  swap(_impl_.min_depth_, other->_impl_.min_depth_);
  swap(_impl_.pad_to_multiple_, other->_impl_.pad_to_multiple_);
  swap(_impl_.num_layers_, other->_impl_.num_layers_);
}

::PROTOBUF_NAMESPACE_ID::Metadata SsdFeatureExtractor::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fssd_2eproto[2]);
}

// ===================================================================

class FeaturePyramidNetworks::_Internal {
 public:
  using HasBits = decltype(std::declval<FeaturePyramidNetworks>()._impl_._has_bits_);
  static void set_has_min_level(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_max_level(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_additional_layer_depth(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

FeaturePyramidNetworks::FeaturePyramidNetworks(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor(arena, is_message_owned);
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.FeaturePyramidNetworks)
}
FeaturePyramidNetworks::FeaturePyramidNetworks(const FeaturePyramidNetworks& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FeaturePyramidNetworks* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.additional_layer_depth_){}
    , decltype(_impl_.min_level_){}
    , decltype(_impl_.max_level_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  ::memcpy(&_impl_.additional_layer_depth_, &from._impl_.additional_layer_depth_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.max_level_) -
    reinterpret_cast<char*>(&_impl_.additional_layer_depth_)) + sizeof(_impl_.max_level_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.FeaturePyramidNetworks)
}

inline void FeaturePyramidNetworks::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.additional_layer_depth_){256}
    , decltype(_impl_.min_level_){3}
    , decltype(_impl_.max_level_){7}
  };
}

FeaturePyramidNetworks::~FeaturePyramidNetworks() {
  // @@protoc_insertion_point(destructor:object_detection.protos.FeaturePyramidNetworks)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void FeaturePyramidNetworks::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}

void FeaturePyramidNetworks::SetCachedSize(int size) const {
  _impl_._cached_size_.Set(size);
}

void FeaturePyramidNetworks::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.FeaturePyramidNetworks)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    _impl_.additional_layer_depth_ = 256;
    _impl_.min_level_ = 3;
    _impl_.max_level_ = 7;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* FeaturePyramidNetworks::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 min_level = 1 [default = 3];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_min_level(&has_bits);
          _impl_.min_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_level = 2 [default = 7];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_max_level(&has_bits);
          _impl_.max_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 additional_layer_depth = 3 [default = 256];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_additional_layer_depth(&has_bits);
          _impl_.additional_layer_depth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _impl_._has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* FeaturePyramidNetworks::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.FeaturePyramidNetworks)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 min_level = 1 [default = 3];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_min_level(), target);
  }

  // optional int32 max_level = 2 [default = 7];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_max_level(), target);
  }

  // optional int32 additional_layer_depth = 3 [default = 256];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_additional_layer_depth(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
  }
  // @@protoc_insertion_point(serialize_to_array_end:object_detection.protos.FeaturePyramidNetworks)
  return target;
}

size_t FeaturePyramidNetworks::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.FeaturePyramidNetworks)
  size_t total_size = 0;

  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional int32 additional_layer_depth = 3 [default = 256];
    if (cached_has_bits & 0x00000001u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_additional_layer_depth());
    }

    // optional int32 min_level = 1 [default = 3];
    if (cached_has_bits & 0x00000002u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_min_level());
    }

    // optional int32 max_level = 2 [default = 7];
    if (cached_has_bits & 0x00000004u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_max_level());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData FeaturePyramidNetworks::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck,
    FeaturePyramidNetworks::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*FeaturePyramidNetworks::GetClassData() const { return &_class_data_; }


void FeaturePyramidNetworks::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<FeaturePyramidNetworks*>(&to_msg);
  auto& from = static_cast<const FeaturePyramidNetworks&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.FeaturePyramidNetworks)
  GOOGLE_DCHECK_NE(&from, _this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      _this->_impl_.additional_layer_depth_ = from._impl_.additional_layer_depth_;
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.min_level_ = from._impl_.min_level_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.max_level_ = from._impl_.max_level_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void FeaturePyramidNetworks::CopyFrom(const FeaturePyramidNetworks& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:object_detection.protos.FeaturePyramidNetworks)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FeaturePyramidNetworks::IsInitialized() const {
  return true;
}

void FeaturePyramidNetworks::InternalSwap(FeaturePyramidNetworks* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_.additional_layer_depth_, other->_impl_.additional_layer_depth_);
  swap(_impl_.min_level_, other->_impl_.min_level_);
  swap(_impl_.max_level_, other->_impl_.max_level_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FeaturePyramidNetworks::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fssd_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fssd_2eproto[3]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace object_detection
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::object_detection::protos::Ssd_MaskHead*
Arena::CreateMaybeMessage< ::object_detection::protos::Ssd_MaskHead >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::Ssd_MaskHead >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::Ssd*
Arena::CreateMaybeMessage< ::object_detection::protos::Ssd >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::Ssd >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::SsdFeatureExtractor*
Arena::CreateMaybeMessage< ::object_detection::protos::SsdFeatureExtractor >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::SsdFeatureExtractor >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::FeaturePyramidNetworks*
Arena::CreateMaybeMessage< ::object_detection::protos::FeaturePyramidNetworks >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::FeaturePyramidNetworks >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
