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

#include "object_detection/protos/faster_rcnn.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 FasterRcnn::FasterRcnn(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.image_resizer_)*/nullptr
  , /*decltype(_impl_.feature_extractor_)*/nullptr
  , /*decltype(_impl_.first_stage_anchor_generator_)*/nullptr
  , /*decltype(_impl_.first_stage_box_predictor_conv_hyperparams_)*/nullptr
  , /*decltype(_impl_.second_stage_box_predictor_)*/nullptr
  , /*decltype(_impl_.second_stage_post_processing_)*/nullptr
  , /*decltype(_impl_.hard_example_miner_)*/nullptr
  , /*decltype(_impl_.second_stage_classification_loss_)*/nullptr
  , /*decltype(_impl_.num_classes_)*/0
  , /*decltype(_impl_.first_stage_nms_score_threshold_)*/0
  , /*decltype(_impl_.initial_crop_size_)*/0
  , /*decltype(_impl_.maxpool_kernel_size_)*/0
  , /*decltype(_impl_.maxpool_stride_)*/0
  , /*decltype(_impl_.inplace_batchnorm_update_)*/false
  , /*decltype(_impl_.use_matmul_crop_and_resize_)*/false
  , /*decltype(_impl_.clip_anchors_to_image_)*/false
  , /*decltype(_impl_.use_matmul_gather_in_matcher_)*/false
  , /*decltype(_impl_.use_static_balanced_label_sampler_)*/false
  , /*decltype(_impl_.use_static_shapes_)*/false
  , /*decltype(_impl_.use_static_shapes_for_eval_)*/false
  , /*decltype(_impl_.number_of_stages_)*/2
  , /*decltype(_impl_.first_stage_atrous_rate_)*/1
  , /*decltype(_impl_.first_stage_box_predictor_kernel_size_)*/3
  , /*decltype(_impl_.first_stage_box_predictor_depth_)*/512
  , /*decltype(_impl_.first_stage_minibatch_size_)*/256
  , /*decltype(_impl_.first_stage_positive_balance_fraction_)*/0.5f
  , /*decltype(_impl_.first_stage_nms_iou_threshold_)*/0.7f
  , /*decltype(_impl_.first_stage_max_proposals_)*/300
  , /*decltype(_impl_.first_stage_localization_loss_weight_)*/1
  , /*decltype(_impl_.first_stage_objectness_loss_weight_)*/1
  , /*decltype(_impl_.second_stage_batch_size_)*/64
  , /*decltype(_impl_.second_stage_balance_fraction_)*/0.25f
  , /*decltype(_impl_.second_stage_localization_loss_weight_)*/1
  , /*decltype(_impl_.second_stage_classification_loss_weight_)*/1
  , /*decltype(_impl_.second_stage_mask_prediction_loss_weight_)*/1
  , /*decltype(_impl_.resize_masks_)*/true} {}
struct FasterRcnnDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FasterRcnnDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FasterRcnnDefaultTypeInternal() {}
  union {
    FasterRcnn _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FasterRcnnDefaultTypeInternal _FasterRcnn_default_instance_;
PROTOBUF_CONSTEXPR FasterRcnnFeatureExtractor::FasterRcnnFeatureExtractor(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
  , /*decltype(_impl_.batch_norm_trainable_)*/false
  , /*decltype(_impl_.first_stage_features_stride_)*/16} {}
struct FasterRcnnFeatureExtractorDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FasterRcnnFeatureExtractorDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FasterRcnnFeatureExtractorDefaultTypeInternal() {}
  union {
    FasterRcnnFeatureExtractor _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FasterRcnnFeatureExtractorDefaultTypeInternal _FasterRcnnFeatureExtractor_default_instance_;
}  // namespace protos
}  // namespace object_detection
static ::_pb::Metadata file_level_metadata_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto[2];
static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto = nullptr;
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto = nullptr;

const uint32_t TableStruct_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _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::FasterRcnn, _impl_.number_of_stages_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.num_classes_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.image_resizer_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.feature_extractor_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_anchor_generator_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_atrous_rate_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_box_predictor_conv_hyperparams_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_box_predictor_kernel_size_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_box_predictor_depth_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_minibatch_size_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_positive_balance_fraction_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_nms_score_threshold_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_nms_iou_threshold_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_max_proposals_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_localization_loss_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.first_stage_objectness_loss_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.initial_crop_size_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.maxpool_kernel_size_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.maxpool_stride_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_box_predictor_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_batch_size_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_balance_fraction_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_post_processing_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_localization_loss_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_classification_loss_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_mask_prediction_loss_weight_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.hard_example_miner_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.second_stage_classification_loss_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.inplace_batchnorm_update_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.use_matmul_crop_and_resize_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.clip_anchors_to_image_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.use_matmul_gather_in_matcher_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.use_static_balanced_label_sampler_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.use_static_shapes_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.resize_masks_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnn, _impl_.use_static_shapes_for_eval_),
  20,
  8,
  0,
  1,
  2,
  21,
  3,
  22,
  23,
  24,
  25,
  9,
  26,
  27,
  28,
  29,
  10,
  11,
  12,
  4,
  30,
  31,
  5,
  32,
  33,
  34,
  6,
  7,
  13,
  14,
  15,
  16,
  17,
  18,
  35,
  19,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnnFeatureExtractor, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnnFeatureExtractor, _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::FasterRcnnFeatureExtractor, _impl_.type_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnnFeatureExtractor, _impl_.first_stage_features_stride_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FasterRcnnFeatureExtractor, _impl_.batch_norm_trainable_),
  0,
  2,
  1,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 42, -1, sizeof(::object_detection::protos::FasterRcnn)},
  { 78, 87, -1, sizeof(::object_detection::protos::FasterRcnnFeatureExtractor)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::object_detection::protos::_FasterRcnn_default_instance_._instance,
  &::object_detection::protos::_FasterRcnnFeatureExtractor_default_instance_._instance,
};

const char descriptor_table_protodef_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n)object_detection/protos/faster_rcnn.pr"
  "oto\022\027object_detection.protos\032.object_det"
  "ection/protos/anchor_generator.proto\032+ob"
  "ject_detection/protos/box_predictor.prot"
  "o\032)object_detection/protos/hyperparams.p"
  "roto\032+object_detection/protos/image_resi"
  "zer.proto\032$object_detection/protos/losse"
  "s.proto\032-object_detection/protos/post_pr"
  "ocessing.proto\"\356\r\n\nFasterRcnn\022\033\n\020number_"
  "of_stages\030\001 \001(\005:\0012\022\023\n\013num_classes\030\003 \001(\005\022"
  "<\n\rimage_resizer\030\004 \001(\0132%.object_detectio"
  "n.protos.ImageResizer\022N\n\021feature_extract"
  "or\030\005 \001(\01323.object_detection.protos.Faste"
  "rRcnnFeatureExtractor\022N\n\034first_stage_anc"
  "hor_generator\030\006 \001(\0132(.object_detection.p"
  "rotos.AnchorGenerator\022\"\n\027first_stage_atr"
  "ous_rate\030\007 \001(\005:\0011\022X\n*first_stage_box_pre"
  "dictor_conv_hyperparams\030\010 \001(\0132$.object_d"
  "etection.protos.Hyperparams\0220\n%first_sta"
  "ge_box_predictor_kernel_size\030\t \001(\005:\0013\022,\n"
  "\037first_stage_box_predictor_depth\030\n \001(\005:\003"
  "512\022\'\n\032first_stage_minibatch_size\030\013 \001(\005:"
  "\003256\0222\n%first_stage_positive_balance_fra"
  "ction\030\014 \001(\002:\0030.5\022*\n\037first_stage_nms_scor"
  "e_threshold\030\r \001(\002:\0010\022*\n\035first_stage_nms_"
  "iou_threshold\030\016 \001(\002:\0030.7\022&\n\031first_stage_"
  "max_proposals\030\017 \001(\005:\003300\022/\n$first_stage_"
  "localization_loss_weight\030\020 \001(\002:\0011\022-\n\"fir"
  "st_stage_objectness_loss_weight\030\021 \001(\002:\0011"
  "\022\031\n\021initial_crop_size\030\022 \001(\005\022\033\n\023maxpool_k"
  "ernel_size\030\023 \001(\005\022\026\n\016maxpool_stride\030\024 \001(\005"
  "\022I\n\032second_stage_box_predictor\030\025 \001(\0132%.o"
  "bject_detection.protos.BoxPredictor\022#\n\027s"
  "econd_stage_batch_size\030\026 \001(\005:\00264\022+\n\035seco"
  "nd_stage_balance_fraction\030\027 \001(\002:\0040.25\022M\n"
  "\034second_stage_post_processing\030\030 \001(\0132\'.ob"
  "ject_detection.protos.PostProcessing\0220\n%"
  "second_stage_localization_loss_weight\030\031 "
  "\001(\002:\0011\0222\n\'second_stage_classification_lo"
  "ss_weight\030\032 \001(\002:\0011\0223\n(second_stage_mask_"
  "prediction_loss_weight\030\033 \001(\002:\0011\022E\n\022hard_"
  "example_miner\030\034 \001(\0132).object_detection.p"
  "rotos.HardExampleMiner\022U\n second_stage_c"
  "lassification_loss\030\035 \001(\0132+.object_detect"
  "ion.protos.ClassificationLoss\022\'\n\030inplace"
  "_batchnorm_update\030\036 \001(\010:\005false\022)\n\032use_ma"
  "tmul_crop_and_resize\030\037 \001(\010:\005false\022$\n\025cli"
  "p_anchors_to_image\030  \001(\010:\005false\022+\n\034use_m"
  "atmul_gather_in_matcher\030! \001(\010:\005false\0220\n!"
  "use_static_balanced_label_sampler\030\" \001(\010:"
  "\005false\022 \n\021use_static_shapes\030# \001(\010:\005false"
  "\022\032\n\014resize_masks\030$ \001(\010:\004true\022)\n\032use_stat"
  "ic_shapes_for_eval\030% \001(\010:\005false\"x\n\032Faste"
  "rRcnnFeatureExtractor\022\014\n\004type\030\001 \001(\t\022\'\n\033f"
  "irst_stage_features_stride\030\002 \001(\005:\00216\022#\n\024"
  "batch_norm_trainable\030\003 \001(\010:\005false"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_deps[6] = {
  &::descriptor_table_object_5fdetection_2fprotos_2fanchor_5fgenerator_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_2fpost_5fprocessing_2eproto,
};
static ::_pbi::once_flag descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto = {
    false, false, 2233, descriptor_table_protodef_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto,
    "object_detection/protos/faster_rcnn.proto",
    &descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_once, descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_deps, 6, 2,
    schemas, file_default_instances, TableStruct_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto::offsets,
    file_level_metadata_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto, file_level_enum_descriptors_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto,
    file_level_service_descriptors_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_getter() {
  return &descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto;
}

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

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

class FasterRcnn::_Internal {
 public:
  using HasBits = decltype(std::declval<FasterRcnn>()._impl_._has_bits_);
  static void set_has_number_of_stages(HasBits* has_bits) {
    (*has_bits)[0] |= 1048576u;
  }
  static void set_has_num_classes(HasBits* has_bits) {
    (*has_bits)[0] |= 256u;
  }
  static const ::object_detection::protos::ImageResizer& image_resizer(const FasterRcnn* msg);
  static void set_has_image_resizer(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::object_detection::protos::FasterRcnnFeatureExtractor& feature_extractor(const FasterRcnn* msg);
  static void set_has_feature_extractor(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static const ::object_detection::protos::AnchorGenerator& first_stage_anchor_generator(const FasterRcnn* msg);
  static void set_has_first_stage_anchor_generator(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_first_stage_atrous_rate(HasBits* has_bits) {
    (*has_bits)[0] |= 2097152u;
  }
  static const ::object_detection::protos::Hyperparams& first_stage_box_predictor_conv_hyperparams(const FasterRcnn* msg);
  static void set_has_first_stage_box_predictor_conv_hyperparams(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_first_stage_box_predictor_kernel_size(HasBits* has_bits) {
    (*has_bits)[0] |= 4194304u;
  }
  static void set_has_first_stage_box_predictor_depth(HasBits* has_bits) {
    (*has_bits)[0] |= 8388608u;
  }
  static void set_has_first_stage_minibatch_size(HasBits* has_bits) {
    (*has_bits)[0] |= 16777216u;
  }
  static void set_has_first_stage_positive_balance_fraction(HasBits* has_bits) {
    (*has_bits)[0] |= 33554432u;
  }
  static void set_has_first_stage_nms_score_threshold(HasBits* has_bits) {
    (*has_bits)[0] |= 512u;
  }
  static void set_has_first_stage_nms_iou_threshold(HasBits* has_bits) {
    (*has_bits)[0] |= 67108864u;
  }
  static void set_has_first_stage_max_proposals(HasBits* has_bits) {
    (*has_bits)[0] |= 134217728u;
  }
  static void set_has_first_stage_localization_loss_weight(HasBits* has_bits) {
    (*has_bits)[0] |= 268435456u;
  }
  static void set_has_first_stage_objectness_loss_weight(HasBits* has_bits) {
    (*has_bits)[0] |= 536870912u;
  }
  static void set_has_initial_crop_size(HasBits* has_bits) {
    (*has_bits)[0] |= 1024u;
  }
  static void set_has_maxpool_kernel_size(HasBits* has_bits) {
    (*has_bits)[0] |= 2048u;
  }
  static void set_has_maxpool_stride(HasBits* has_bits) {
    (*has_bits)[0] |= 4096u;
  }
  static const ::object_detection::protos::BoxPredictor& second_stage_box_predictor(const FasterRcnn* msg);
  static void set_has_second_stage_box_predictor(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_second_stage_batch_size(HasBits* has_bits) {
    (*has_bits)[0] |= 1073741824u;
  }
  static void set_has_second_stage_balance_fraction(HasBits* has_bits) {
    (*has_bits)[0] |= 2147483648u;
  }
  static const ::object_detection::protos::PostProcessing& second_stage_post_processing(const FasterRcnn* msg);
  static void set_has_second_stage_post_processing(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_second_stage_localization_loss_weight(HasBits* has_bits) {
    (*has_bits)[1] |= 1u;
  }
  static void set_has_second_stage_classification_loss_weight(HasBits* has_bits) {
    (*has_bits)[1] |= 2u;
  }
  static void set_has_second_stage_mask_prediction_loss_weight(HasBits* has_bits) {
    (*has_bits)[1] |= 4u;
  }
  static const ::object_detection::protos::HardExampleMiner& hard_example_miner(const FasterRcnn* msg);
  static void set_has_hard_example_miner(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static const ::object_detection::protos::ClassificationLoss& second_stage_classification_loss(const FasterRcnn* msg);
  static void set_has_second_stage_classification_loss(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_inplace_batchnorm_update(HasBits* has_bits) {
    (*has_bits)[0] |= 8192u;
  }
  static void set_has_use_matmul_crop_and_resize(HasBits* has_bits) {
    (*has_bits)[0] |= 16384u;
  }
  static void set_has_clip_anchors_to_image(HasBits* has_bits) {
    (*has_bits)[0] |= 32768u;
  }
  static void set_has_use_matmul_gather_in_matcher(HasBits* has_bits) {
    (*has_bits)[0] |= 65536u;
  }
  static void set_has_use_static_balanced_label_sampler(HasBits* has_bits) {
    (*has_bits)[0] |= 131072u;
  }
  static void set_has_use_static_shapes(HasBits* has_bits) {
    (*has_bits)[0] |= 262144u;
  }
  static void set_has_resize_masks(HasBits* has_bits) {
    (*has_bits)[1] |= 8u;
  }
  static void set_has_use_static_shapes_for_eval(HasBits* has_bits) {
    (*has_bits)[0] |= 524288u;
  }
};

const ::object_detection::protos::ImageResizer&
FasterRcnn::_Internal::image_resizer(const FasterRcnn* msg) {
  return *msg->_impl_.image_resizer_;
}
const ::object_detection::protos::FasterRcnnFeatureExtractor&
FasterRcnn::_Internal::feature_extractor(const FasterRcnn* msg) {
  return *msg->_impl_.feature_extractor_;
}
const ::object_detection::protos::AnchorGenerator&
FasterRcnn::_Internal::first_stage_anchor_generator(const FasterRcnn* msg) {
  return *msg->_impl_.first_stage_anchor_generator_;
}
const ::object_detection::protos::Hyperparams&
FasterRcnn::_Internal::first_stage_box_predictor_conv_hyperparams(const FasterRcnn* msg) {
  return *msg->_impl_.first_stage_box_predictor_conv_hyperparams_;
}
const ::object_detection::protos::BoxPredictor&
FasterRcnn::_Internal::second_stage_box_predictor(const FasterRcnn* msg) {
  return *msg->_impl_.second_stage_box_predictor_;
}
const ::object_detection::protos::PostProcessing&
FasterRcnn::_Internal::second_stage_post_processing(const FasterRcnn* msg) {
  return *msg->_impl_.second_stage_post_processing_;
}
const ::object_detection::protos::HardExampleMiner&
FasterRcnn::_Internal::hard_example_miner(const FasterRcnn* msg) {
  return *msg->_impl_.hard_example_miner_;
}
const ::object_detection::protos::ClassificationLoss&
FasterRcnn::_Internal::second_stage_classification_loss(const FasterRcnn* msg) {
  return *msg->_impl_.second_stage_classification_loss_;
}
void FasterRcnn::clear_image_resizer() {
  if (_impl_.image_resizer_ != nullptr) _impl_.image_resizer_->Clear();
  _impl_._has_bits_[0] &= ~0x00000001u;
}
void FasterRcnn::clear_first_stage_anchor_generator() {
  if (_impl_.first_stage_anchor_generator_ != nullptr) _impl_.first_stage_anchor_generator_->Clear();
  _impl_._has_bits_[0] &= ~0x00000004u;
}
void FasterRcnn::clear_first_stage_box_predictor_conv_hyperparams() {
  if (_impl_.first_stage_box_predictor_conv_hyperparams_ != nullptr) _impl_.first_stage_box_predictor_conv_hyperparams_->Clear();
  _impl_._has_bits_[0] &= ~0x00000008u;
}
void FasterRcnn::clear_second_stage_box_predictor() {
  if (_impl_.second_stage_box_predictor_ != nullptr) _impl_.second_stage_box_predictor_->Clear();
  _impl_._has_bits_[0] &= ~0x00000010u;
}
void FasterRcnn::clear_second_stage_post_processing() {
  if (_impl_.second_stage_post_processing_ != nullptr) _impl_.second_stage_post_processing_->Clear();
  _impl_._has_bits_[0] &= ~0x00000020u;
}
void FasterRcnn::clear_hard_example_miner() {
  if (_impl_.hard_example_miner_ != nullptr) _impl_.hard_example_miner_->Clear();
  _impl_._has_bits_[0] &= ~0x00000040u;
}
void FasterRcnn::clear_second_stage_classification_loss() {
  if (_impl_.second_stage_classification_loss_ != nullptr) _impl_.second_stage_classification_loss_->Clear();
  _impl_._has_bits_[0] &= ~0x00000080u;
}
FasterRcnn::FasterRcnn(::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.FasterRcnn)
}
FasterRcnn::FasterRcnn(const FasterRcnn& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FasterRcnn* 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_.first_stage_anchor_generator_){nullptr}
    , decltype(_impl_.first_stage_box_predictor_conv_hyperparams_){nullptr}
    , decltype(_impl_.second_stage_box_predictor_){nullptr}
    , decltype(_impl_.second_stage_post_processing_){nullptr}
    , decltype(_impl_.hard_example_miner_){nullptr}
    , decltype(_impl_.second_stage_classification_loss_){nullptr}
    , decltype(_impl_.num_classes_){}
    , decltype(_impl_.first_stage_nms_score_threshold_){}
    , decltype(_impl_.initial_crop_size_){}
    , decltype(_impl_.maxpool_kernel_size_){}
    , decltype(_impl_.maxpool_stride_){}
    , decltype(_impl_.inplace_batchnorm_update_){}
    , decltype(_impl_.use_matmul_crop_and_resize_){}
    , decltype(_impl_.clip_anchors_to_image_){}
    , decltype(_impl_.use_matmul_gather_in_matcher_){}
    , decltype(_impl_.use_static_balanced_label_sampler_){}
    , decltype(_impl_.use_static_shapes_){}
    , decltype(_impl_.use_static_shapes_for_eval_){}
    , decltype(_impl_.number_of_stages_){}
    , decltype(_impl_.first_stage_atrous_rate_){}
    , decltype(_impl_.first_stage_box_predictor_kernel_size_){}
    , decltype(_impl_.first_stage_box_predictor_depth_){}
    , decltype(_impl_.first_stage_minibatch_size_){}
    , decltype(_impl_.first_stage_positive_balance_fraction_){}
    , decltype(_impl_.first_stage_nms_iou_threshold_){}
    , decltype(_impl_.first_stage_max_proposals_){}
    , decltype(_impl_.first_stage_localization_loss_weight_){}
    , decltype(_impl_.first_stage_objectness_loss_weight_){}
    , decltype(_impl_.second_stage_batch_size_){}
    , decltype(_impl_.second_stage_balance_fraction_){}
    , decltype(_impl_.second_stage_localization_loss_weight_){}
    , decltype(_impl_.second_stage_classification_loss_weight_){}
    , decltype(_impl_.second_stage_mask_prediction_loss_weight_){}
    , decltype(_impl_.resize_masks_){}};

  _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::FasterRcnnFeatureExtractor(*from._impl_.feature_extractor_);
  }
  if (from._internal_has_first_stage_anchor_generator()) {
    _this->_impl_.first_stage_anchor_generator_ = new ::object_detection::protos::AnchorGenerator(*from._impl_.first_stage_anchor_generator_);
  }
  if (from._internal_has_first_stage_box_predictor_conv_hyperparams()) {
    _this->_impl_.first_stage_box_predictor_conv_hyperparams_ = new ::object_detection::protos::Hyperparams(*from._impl_.first_stage_box_predictor_conv_hyperparams_);
  }
  if (from._internal_has_second_stage_box_predictor()) {
    _this->_impl_.second_stage_box_predictor_ = new ::object_detection::protos::BoxPredictor(*from._impl_.second_stage_box_predictor_);
  }
  if (from._internal_has_second_stage_post_processing()) {
    _this->_impl_.second_stage_post_processing_ = new ::object_detection::protos::PostProcessing(*from._impl_.second_stage_post_processing_);
  }
  if (from._internal_has_hard_example_miner()) {
    _this->_impl_.hard_example_miner_ = new ::object_detection::protos::HardExampleMiner(*from._impl_.hard_example_miner_);
  }
  if (from._internal_has_second_stage_classification_loss()) {
    _this->_impl_.second_stage_classification_loss_ = new ::object_detection::protos::ClassificationLoss(*from._impl_.second_stage_classification_loss_);
  }
  ::memcpy(&_impl_.num_classes_, &from._impl_.num_classes_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.resize_masks_) -
    reinterpret_cast<char*>(&_impl_.num_classes_)) + sizeof(_impl_.resize_masks_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.FasterRcnn)
}

inline void FasterRcnn::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_.first_stage_anchor_generator_){nullptr}
    , decltype(_impl_.first_stage_box_predictor_conv_hyperparams_){nullptr}
    , decltype(_impl_.second_stage_box_predictor_){nullptr}
    , decltype(_impl_.second_stage_post_processing_){nullptr}
    , decltype(_impl_.hard_example_miner_){nullptr}
    , decltype(_impl_.second_stage_classification_loss_){nullptr}
    , decltype(_impl_.num_classes_){0}
    , decltype(_impl_.first_stage_nms_score_threshold_){0}
    , decltype(_impl_.initial_crop_size_){0}
    , decltype(_impl_.maxpool_kernel_size_){0}
    , decltype(_impl_.maxpool_stride_){0}
    , decltype(_impl_.inplace_batchnorm_update_){false}
    , decltype(_impl_.use_matmul_crop_and_resize_){false}
    , decltype(_impl_.clip_anchors_to_image_){false}
    , decltype(_impl_.use_matmul_gather_in_matcher_){false}
    , decltype(_impl_.use_static_balanced_label_sampler_){false}
    , decltype(_impl_.use_static_shapes_){false}
    , decltype(_impl_.use_static_shapes_for_eval_){false}
    , decltype(_impl_.number_of_stages_){2}
    , decltype(_impl_.first_stage_atrous_rate_){1}
    , decltype(_impl_.first_stage_box_predictor_kernel_size_){3}
    , decltype(_impl_.first_stage_box_predictor_depth_){512}
    , decltype(_impl_.first_stage_minibatch_size_){256}
    , decltype(_impl_.first_stage_positive_balance_fraction_){0.5f}
    , decltype(_impl_.first_stage_nms_iou_threshold_){0.7f}
    , decltype(_impl_.first_stage_max_proposals_){300}
    , decltype(_impl_.first_stage_localization_loss_weight_){1}
    , decltype(_impl_.first_stage_objectness_loss_weight_){1}
    , decltype(_impl_.second_stage_batch_size_){64}
    , decltype(_impl_.second_stage_balance_fraction_){0.25f}
    , decltype(_impl_.second_stage_localization_loss_weight_){1}
    , decltype(_impl_.second_stage_classification_loss_weight_){1}
    , decltype(_impl_.second_stage_mask_prediction_loss_weight_){1}
    , decltype(_impl_.resize_masks_){true}
  };
}

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

inline void FasterRcnn::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_.first_stage_anchor_generator_;
  if (this != internal_default_instance()) delete _impl_.first_stage_box_predictor_conv_hyperparams_;
  if (this != internal_default_instance()) delete _impl_.second_stage_box_predictor_;
  if (this != internal_default_instance()) delete _impl_.second_stage_post_processing_;
  if (this != internal_default_instance()) delete _impl_.hard_example_miner_;
  if (this != internal_default_instance()) delete _impl_.second_stage_classification_loss_;
}

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

void FasterRcnn::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.FasterRcnn)
  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_.first_stage_anchor_generator_ != nullptr);
      _impl_.first_stage_anchor_generator_->Clear();
    }
    if (cached_has_bits & 0x00000008u) {
      GOOGLE_DCHECK(_impl_.first_stage_box_predictor_conv_hyperparams_ != nullptr);
      _impl_.first_stage_box_predictor_conv_hyperparams_->Clear();
    }
    if (cached_has_bits & 0x00000010u) {
      GOOGLE_DCHECK(_impl_.second_stage_box_predictor_ != nullptr);
      _impl_.second_stage_box_predictor_->Clear();
    }
    if (cached_has_bits & 0x00000020u) {
      GOOGLE_DCHECK(_impl_.second_stage_post_processing_ != nullptr);
      _impl_.second_stage_post_processing_->Clear();
    }
    if (cached_has_bits & 0x00000040u) {
      GOOGLE_DCHECK(_impl_.hard_example_miner_ != nullptr);
      _impl_.hard_example_miner_->Clear();
    }
    if (cached_has_bits & 0x00000080u) {
      GOOGLE_DCHECK(_impl_.second_stage_classification_loss_ != nullptr);
      _impl_.second_stage_classification_loss_->Clear();
    }
  }
  if (cached_has_bits & 0x0000ff00u) {
    ::memset(&_impl_.num_classes_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.clip_anchors_to_image_) -
        reinterpret_cast<char*>(&_impl_.num_classes_)) + sizeof(_impl_.clip_anchors_to_image_));
  }
  if (cached_has_bits & 0x00ff0000u) {
    ::memset(&_impl_.use_matmul_gather_in_matcher_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.use_static_shapes_for_eval_) -
        reinterpret_cast<char*>(&_impl_.use_matmul_gather_in_matcher_)) + sizeof(_impl_.use_static_shapes_for_eval_));
    _impl_.number_of_stages_ = 2;
    _impl_.first_stage_atrous_rate_ = 1;
    _impl_.first_stage_box_predictor_kernel_size_ = 3;
    _impl_.first_stage_box_predictor_depth_ = 512;
  }
  if (cached_has_bits & 0xff000000u) {
    _impl_.first_stage_minibatch_size_ = 256;
    _impl_.first_stage_positive_balance_fraction_ = 0.5f;
    _impl_.first_stage_nms_iou_threshold_ = 0.7f;
    _impl_.first_stage_max_proposals_ = 300;
    _impl_.first_stage_localization_loss_weight_ = 1;
    _impl_.first_stage_objectness_loss_weight_ = 1;
    _impl_.second_stage_batch_size_ = 64;
    _impl_.second_stage_balance_fraction_ = 0.25f;
  }
  cached_has_bits = _impl_._has_bits_[1];
  if (cached_has_bits & 0x0000000fu) {
    _impl_.second_stage_localization_loss_weight_ = 1;
    _impl_.second_stage_classification_loss_weight_ = 1;
    _impl_.second_stage_mask_prediction_loss_weight_ = 1;
    _impl_.resize_masks_ = true;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* FasterRcnn::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 number_of_stages = 1 [default = 2];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_number_of_stages(&_impl_._has_bits_);
          _impl_.number_of_stages_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 num_classes = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_num_classes(&_impl_._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 = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_image_resizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.FasterRcnnFeatureExtractor feature_extractor = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_feature_extractor(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.AnchorGenerator first_stage_anchor_generator = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          ptr = ctx->ParseMessage(_internal_mutable_first_stage_anchor_generator(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 first_stage_atrous_rate = 7 [default = 1];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_first_stage_atrous_rate(&_impl_._has_bits_);
          _impl_.first_stage_atrous_rate_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.Hyperparams first_stage_box_predictor_conv_hyperparams = 8;
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr = ctx->ParseMessage(_internal_mutable_first_stage_box_predictor_conv_hyperparams(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 first_stage_box_predictor_kernel_size = 9 [default = 3];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          _Internal::set_has_first_stage_box_predictor_kernel_size(&_impl_._has_bits_);
          _impl_.first_stage_box_predictor_kernel_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 first_stage_box_predictor_depth = 10 [default = 512];
      case 10:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 80)) {
          _Internal::set_has_first_stage_box_predictor_depth(&_impl_._has_bits_);
          _impl_.first_stage_box_predictor_depth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 first_stage_minibatch_size = 11 [default = 256];
      case 11:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
          _Internal::set_has_first_stage_minibatch_size(&_impl_._has_bits_);
          _impl_.first_stage_minibatch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float first_stage_positive_balance_fraction = 12 [default = 0.5];
      case 12:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 101)) {
          _Internal::set_has_first_stage_positive_balance_fraction(&_impl_._has_bits_);
          _impl_.first_stage_positive_balance_fraction_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional float first_stage_nms_score_threshold = 13 [default = 0];
      case 13:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 109)) {
          _Internal::set_has_first_stage_nms_score_threshold(&_impl_._has_bits_);
          _impl_.first_stage_nms_score_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional float first_stage_nms_iou_threshold = 14 [default = 0.7];
      case 14:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 117)) {
          _Internal::set_has_first_stage_nms_iou_threshold(&_impl_._has_bits_);
          _impl_.first_stage_nms_iou_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional int32 first_stage_max_proposals = 15 [default = 300];
      case 15:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
          _Internal::set_has_first_stage_max_proposals(&_impl_._has_bits_);
          _impl_.first_stage_max_proposals_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float first_stage_localization_loss_weight = 16 [default = 1];
      case 16:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 133)) {
          _Internal::set_has_first_stage_localization_loss_weight(&_impl_._has_bits_);
          _impl_.first_stage_localization_loss_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional float first_stage_objectness_loss_weight = 17 [default = 1];
      case 17:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 141)) {
          _Internal::set_has_first_stage_objectness_loss_weight(&_impl_._has_bits_);
          _impl_.first_stage_objectness_loss_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional int32 initial_crop_size = 18;
      case 18:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 144)) {
          _Internal::set_has_initial_crop_size(&_impl_._has_bits_);
          _impl_.initial_crop_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 maxpool_kernel_size = 19;
      case 19:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 152)) {
          _Internal::set_has_maxpool_kernel_size(&_impl_._has_bits_);
          _impl_.maxpool_kernel_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 maxpool_stride = 20;
      case 20:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
          _Internal::set_has_maxpool_stride(&_impl_._has_bits_);
          _impl_.maxpool_stride_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.BoxPredictor second_stage_box_predictor = 21;
      case 21:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 170)) {
          ptr = ctx->ParseMessage(_internal_mutable_second_stage_box_predictor(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 second_stage_batch_size = 22 [default = 64];
      case 22:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 176)) {
          _Internal::set_has_second_stage_batch_size(&_impl_._has_bits_);
          _impl_.second_stage_batch_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float second_stage_balance_fraction = 23 [default = 0.25];
      case 23:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 189)) {
          _Internal::set_has_second_stage_balance_fraction(&_impl_._has_bits_);
          _impl_.second_stage_balance_fraction_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.PostProcessing second_stage_post_processing = 24;
      case 24:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 194)) {
          ptr = ctx->ParseMessage(_internal_mutable_second_stage_post_processing(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float second_stage_localization_loss_weight = 25 [default = 1];
      case 25:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 205)) {
          _Internal::set_has_second_stage_localization_loss_weight(&_impl_._has_bits_);
          _impl_.second_stage_localization_loss_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional float second_stage_classification_loss_weight = 26 [default = 1];
      case 26:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 213)) {
          _Internal::set_has_second_stage_classification_loss_weight(&_impl_._has_bits_);
          _impl_.second_stage_classification_loss_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional float second_stage_mask_prediction_loss_weight = 27 [default = 1];
      case 27:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 221)) {
          _Internal::set_has_second_stage_mask_prediction_loss_weight(&_impl_._has_bits_);
          _impl_.second_stage_mask_prediction_loss_weight_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.HardExampleMiner hard_example_miner = 28;
      case 28:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 226)) {
          ptr = ctx->ParseMessage(_internal_mutable_hard_example_miner(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.ClassificationLoss second_stage_classification_loss = 29;
      case 29:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 234)) {
          ptr = ctx->ParseMessage(_internal_mutable_second_stage_classification_loss(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool inplace_batchnorm_update = 30 [default = false];
      case 30:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 240)) {
          _Internal::set_has_inplace_batchnorm_update(&_impl_._has_bits_);
          _impl_.inplace_batchnorm_update_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_matmul_crop_and_resize = 31 [default = false];
      case 31:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 248)) {
          _Internal::set_has_use_matmul_crop_and_resize(&_impl_._has_bits_);
          _impl_.use_matmul_crop_and_resize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool clip_anchors_to_image = 32 [default = false];
      case 32:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 0)) {
          _Internal::set_has_clip_anchors_to_image(&_impl_._has_bits_);
          _impl_.clip_anchors_to_image_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_matmul_gather_in_matcher = 33 [default = false];
      case 33:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_use_matmul_gather_in_matcher(&_impl_._has_bits_);
          _impl_.use_matmul_gather_in_matcher_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_static_balanced_label_sampler = 34 [default = false];
      case 34:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_use_static_balanced_label_sampler(&_impl_._has_bits_);
          _impl_.use_static_balanced_label_sampler_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_static_shapes = 35 [default = false];
      case 35:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_use_static_shapes(&_impl_._has_bits_);
          _impl_.use_static_shapes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool resize_masks = 36 [default = true];
      case 36:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_resize_masks(&_impl_._has_bits_);
          _impl_.resize_masks_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_static_shapes_for_eval = 37 [default = false];
      case 37:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_use_static_shapes_for_eval(&_impl_._has_bits_);
          _impl_.use_static_shapes_for_eval_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&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:
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 number_of_stages = 1 [default = 2];
  if (cached_has_bits & 0x00100000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_number_of_stages(), target);
  }

  // optional int32 num_classes = 3;
  if (cached_has_bits & 0x00000100u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_num_classes(), target);
  }

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

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

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

  // optional int32 first_stage_atrous_rate = 7 [default = 1];
  if (cached_has_bits & 0x00200000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_first_stage_atrous_rate(), target);
  }

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

  // optional int32 first_stage_box_predictor_kernel_size = 9 [default = 3];
  if (cached_has_bits & 0x00400000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(9, this->_internal_first_stage_box_predictor_kernel_size(), target);
  }

  // optional int32 first_stage_box_predictor_depth = 10 [default = 512];
  if (cached_has_bits & 0x00800000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(10, this->_internal_first_stage_box_predictor_depth(), target);
  }

  // optional int32 first_stage_minibatch_size = 11 [default = 256];
  if (cached_has_bits & 0x01000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(11, this->_internal_first_stage_minibatch_size(), target);
  }

  // optional float first_stage_positive_balance_fraction = 12 [default = 0.5];
  if (cached_has_bits & 0x02000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(12, this->_internal_first_stage_positive_balance_fraction(), target);
  }

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

  // optional float first_stage_nms_iou_threshold = 14 [default = 0.7];
  if (cached_has_bits & 0x04000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(14, this->_internal_first_stage_nms_iou_threshold(), target);
  }

  // optional int32 first_stage_max_proposals = 15 [default = 300];
  if (cached_has_bits & 0x08000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(15, this->_internal_first_stage_max_proposals(), target);
  }

  // optional float first_stage_localization_loss_weight = 16 [default = 1];
  if (cached_has_bits & 0x10000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(16, this->_internal_first_stage_localization_loss_weight(), target);
  }

  // optional float first_stage_objectness_loss_weight = 17 [default = 1];
  if (cached_has_bits & 0x20000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(17, this->_internal_first_stage_objectness_loss_weight(), target);
  }

  // optional int32 initial_crop_size = 18;
  if (cached_has_bits & 0x00000400u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(18, this->_internal_initial_crop_size(), target);
  }

  // optional int32 maxpool_kernel_size = 19;
  if (cached_has_bits & 0x00000800u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(19, this->_internal_maxpool_kernel_size(), target);
  }

  // optional int32 maxpool_stride = 20;
  if (cached_has_bits & 0x00001000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(20, this->_internal_maxpool_stride(), target);
  }

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

  // optional int32 second_stage_batch_size = 22 [default = 64];
  if (cached_has_bits & 0x40000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(22, this->_internal_second_stage_batch_size(), target);
  }

  // optional float second_stage_balance_fraction = 23 [default = 0.25];
  if (cached_has_bits & 0x80000000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(23, this->_internal_second_stage_balance_fraction(), target);
  }

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

  cached_has_bits = _impl_._has_bits_[1];
  // optional float second_stage_localization_loss_weight = 25 [default = 1];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(25, this->_internal_second_stage_localization_loss_weight(), target);
  }

  // optional float second_stage_classification_loss_weight = 26 [default = 1];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(26, this->_internal_second_stage_classification_loss_weight(), target);
  }

  // optional float second_stage_mask_prediction_loss_weight = 27 [default = 1];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(27, this->_internal_second_stage_mask_prediction_loss_weight(), target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // optional .object_detection.protos.HardExampleMiner hard_example_miner = 28;
  if (cached_has_bits & 0x00000040u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(28, _Internal::hard_example_miner(this),
        _Internal::hard_example_miner(this).GetCachedSize(), target, stream);
  }

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

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

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

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

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

  // optional bool use_static_balanced_label_sampler = 34 [default = false];
  if (cached_has_bits & 0x00020000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(34, this->_internal_use_static_balanced_label_sampler(), target);
  }

  // optional bool use_static_shapes = 35 [default = false];
  if (cached_has_bits & 0x00040000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(35, this->_internal_use_static_shapes(), target);
  }

  cached_has_bits = _impl_._has_bits_[1];
  // optional bool resize_masks = 36 [default = true];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(36, this->_internal_resize_masks(), target);
  }

  cached_has_bits = _impl_._has_bits_[0];
  // optional bool use_static_shapes_for_eval = 37 [default = false];
  if (cached_has_bits & 0x00080000u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(37, this->_internal_use_static_shapes_for_eval(), 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.FasterRcnn)
  return target;
}

size_t FasterRcnn::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.FasterRcnn)
  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 = 4;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.image_resizer_);
    }

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

    // optional .object_detection.protos.AnchorGenerator first_stage_anchor_generator = 6;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.first_stage_anchor_generator_);
    }

    // optional .object_detection.protos.Hyperparams first_stage_box_predictor_conv_hyperparams = 8;
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.first_stage_box_predictor_conv_hyperparams_);
    }

    // optional .object_detection.protos.BoxPredictor second_stage_box_predictor = 21;
    if (cached_has_bits & 0x00000010u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.second_stage_box_predictor_);
    }

    // optional .object_detection.protos.PostProcessing second_stage_post_processing = 24;
    if (cached_has_bits & 0x00000020u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.second_stage_post_processing_);
    }

    // optional .object_detection.protos.HardExampleMiner hard_example_miner = 28;
    if (cached_has_bits & 0x00000040u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.hard_example_miner_);
    }

    // optional .object_detection.protos.ClassificationLoss second_stage_classification_loss = 29;
    if (cached_has_bits & 0x00000080u) {
      total_size += 2 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.second_stage_classification_loss_);
    }

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

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

    // optional int32 initial_crop_size = 18;
    if (cached_has_bits & 0x00000400u) {
      total_size += 2 +
        ::_pbi::WireFormatLite::Int32Size(
          this->_internal_initial_crop_size());
    }

    // optional int32 maxpool_kernel_size = 19;
    if (cached_has_bits & 0x00000800u) {
      total_size += 2 +
        ::_pbi::WireFormatLite::Int32Size(
          this->_internal_maxpool_kernel_size());
    }

    // optional int32 maxpool_stride = 20;
    if (cached_has_bits & 0x00001000u) {
      total_size += 2 +
        ::_pbi::WireFormatLite::Int32Size(
          this->_internal_maxpool_stride());
    }

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

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

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

  }
  if (cached_has_bits & 0x00ff0000u) {
    // optional bool use_matmul_gather_in_matcher = 33 [default = false];
    if (cached_has_bits & 0x00010000u) {
      total_size += 2 + 1;
    }

    // optional bool use_static_balanced_label_sampler = 34 [default = false];
    if (cached_has_bits & 0x00020000u) {
      total_size += 2 + 1;
    }

    // optional bool use_static_shapes = 35 [default = false];
    if (cached_has_bits & 0x00040000u) {
      total_size += 2 + 1;
    }

    // optional bool use_static_shapes_for_eval = 37 [default = false];
    if (cached_has_bits & 0x00080000u) {
      total_size += 2 + 1;
    }

    // optional int32 number_of_stages = 1 [default = 2];
    if (cached_has_bits & 0x00100000u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_number_of_stages());
    }

    // optional int32 first_stage_atrous_rate = 7 [default = 1];
    if (cached_has_bits & 0x00200000u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_first_stage_atrous_rate());
    }

    // optional int32 first_stage_box_predictor_kernel_size = 9 [default = 3];
    if (cached_has_bits & 0x00400000u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_first_stage_box_predictor_kernel_size());
    }

    // optional int32 first_stage_box_predictor_depth = 10 [default = 512];
    if (cached_has_bits & 0x00800000u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_first_stage_box_predictor_depth());
    }

  }
  if (cached_has_bits & 0xff000000u) {
    // optional int32 first_stage_minibatch_size = 11 [default = 256];
    if (cached_has_bits & 0x01000000u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_first_stage_minibatch_size());
    }

    // optional float first_stage_positive_balance_fraction = 12 [default = 0.5];
    if (cached_has_bits & 0x02000000u) {
      total_size += 1 + 4;
    }

    // optional float first_stage_nms_iou_threshold = 14 [default = 0.7];
    if (cached_has_bits & 0x04000000u) {
      total_size += 1 + 4;
    }

    // optional int32 first_stage_max_proposals = 15 [default = 300];
    if (cached_has_bits & 0x08000000u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_first_stage_max_proposals());
    }

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

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

    // optional int32 second_stage_batch_size = 22 [default = 64];
    if (cached_has_bits & 0x40000000u) {
      total_size += 2 +
        ::_pbi::WireFormatLite::Int32Size(
          this->_internal_second_stage_batch_size());
    }

    // optional float second_stage_balance_fraction = 23 [default = 0.25];
    if (cached_has_bits & 0x80000000u) {
      total_size += 2 + 4;
    }

  }
  cached_has_bits = _impl_._has_bits_[1];
  if (cached_has_bits & 0x0000000fu) {
    // optional float second_stage_localization_loss_weight = 25 [default = 1];
    if (cached_has_bits & 0x00000001u) {
      total_size += 2 + 4;
    }

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

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

    // optional bool resize_masks = 36 [default = true];
    if (cached_has_bits & 0x00000008u) {
      total_size += 2 + 1;
    }

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

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


void FasterRcnn::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<FasterRcnn*>(&to_msg);
  auto& from = static_cast<const FasterRcnn&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.FasterRcnn)
  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::FasterRcnnFeatureExtractor::MergeFrom(
          from._internal_feature_extractor());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_internal_mutable_first_stage_anchor_generator()->::object_detection::protos::AnchorGenerator::MergeFrom(
          from._internal_first_stage_anchor_generator());
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_internal_mutable_first_stage_box_predictor_conv_hyperparams()->::object_detection::protos::Hyperparams::MergeFrom(
          from._internal_first_stage_box_predictor_conv_hyperparams());
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_internal_mutable_second_stage_box_predictor()->::object_detection::protos::BoxPredictor::MergeFrom(
          from._internal_second_stage_box_predictor());
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_internal_mutable_second_stage_post_processing()->::object_detection::protos::PostProcessing::MergeFrom(
          from._internal_second_stage_post_processing());
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_internal_mutable_hard_example_miner()->::object_detection::protos::HardExampleMiner::MergeFrom(
          from._internal_hard_example_miner());
    }
    if (cached_has_bits & 0x00000080u) {
      _this->_internal_mutable_second_stage_classification_loss()->::object_detection::protos::ClassificationLoss::MergeFrom(
          from._internal_second_stage_classification_loss());
    }
  }
  if (cached_has_bits & 0x0000ff00u) {
    if (cached_has_bits & 0x00000100u) {
      _this->_impl_.num_classes_ = from._impl_.num_classes_;
    }
    if (cached_has_bits & 0x00000200u) {
      _this->_impl_.first_stage_nms_score_threshold_ = from._impl_.first_stage_nms_score_threshold_;
    }
    if (cached_has_bits & 0x00000400u) {
      _this->_impl_.initial_crop_size_ = from._impl_.initial_crop_size_;
    }
    if (cached_has_bits & 0x00000800u) {
      _this->_impl_.maxpool_kernel_size_ = from._impl_.maxpool_kernel_size_;
    }
    if (cached_has_bits & 0x00001000u) {
      _this->_impl_.maxpool_stride_ = from._impl_.maxpool_stride_;
    }
    if (cached_has_bits & 0x00002000u) {
      _this->_impl_.inplace_batchnorm_update_ = from._impl_.inplace_batchnorm_update_;
    }
    if (cached_has_bits & 0x00004000u) {
      _this->_impl_.use_matmul_crop_and_resize_ = from._impl_.use_matmul_crop_and_resize_;
    }
    if (cached_has_bits & 0x00008000u) {
      _this->_impl_.clip_anchors_to_image_ = from._impl_.clip_anchors_to_image_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0x00ff0000u) {
    if (cached_has_bits & 0x00010000u) {
      _this->_impl_.use_matmul_gather_in_matcher_ = from._impl_.use_matmul_gather_in_matcher_;
    }
    if (cached_has_bits & 0x00020000u) {
      _this->_impl_.use_static_balanced_label_sampler_ = from._impl_.use_static_balanced_label_sampler_;
    }
    if (cached_has_bits & 0x00040000u) {
      _this->_impl_.use_static_shapes_ = from._impl_.use_static_shapes_;
    }
    if (cached_has_bits & 0x00080000u) {
      _this->_impl_.use_static_shapes_for_eval_ = from._impl_.use_static_shapes_for_eval_;
    }
    if (cached_has_bits & 0x00100000u) {
      _this->_impl_.number_of_stages_ = from._impl_.number_of_stages_;
    }
    if (cached_has_bits & 0x00200000u) {
      _this->_impl_.first_stage_atrous_rate_ = from._impl_.first_stage_atrous_rate_;
    }
    if (cached_has_bits & 0x00400000u) {
      _this->_impl_.first_stage_box_predictor_kernel_size_ = from._impl_.first_stage_box_predictor_kernel_size_;
    }
    if (cached_has_bits & 0x00800000u) {
      _this->_impl_.first_stage_box_predictor_depth_ = from._impl_.first_stage_box_predictor_depth_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  if (cached_has_bits & 0xff000000u) {
    if (cached_has_bits & 0x01000000u) {
      _this->_impl_.first_stage_minibatch_size_ = from._impl_.first_stage_minibatch_size_;
    }
    if (cached_has_bits & 0x02000000u) {
      _this->_impl_.first_stage_positive_balance_fraction_ = from._impl_.first_stage_positive_balance_fraction_;
    }
    if (cached_has_bits & 0x04000000u) {
      _this->_impl_.first_stage_nms_iou_threshold_ = from._impl_.first_stage_nms_iou_threshold_;
    }
    if (cached_has_bits & 0x08000000u) {
      _this->_impl_.first_stage_max_proposals_ = from._impl_.first_stage_max_proposals_;
    }
    if (cached_has_bits & 0x10000000u) {
      _this->_impl_.first_stage_localization_loss_weight_ = from._impl_.first_stage_localization_loss_weight_;
    }
    if (cached_has_bits & 0x20000000u) {
      _this->_impl_.first_stage_objectness_loss_weight_ = from._impl_.first_stage_objectness_loss_weight_;
    }
    if (cached_has_bits & 0x40000000u) {
      _this->_impl_.second_stage_batch_size_ = from._impl_.second_stage_batch_size_;
    }
    if (cached_has_bits & 0x80000000u) {
      _this->_impl_.second_stage_balance_fraction_ = from._impl_.second_stage_balance_fraction_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  cached_has_bits = from._impl_._has_bits_[1];
  if (cached_has_bits & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_impl_.second_stage_localization_loss_weight_ = from._impl_.second_stage_localization_loss_weight_;
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.second_stage_classification_loss_weight_ = from._impl_.second_stage_classification_loss_weight_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.second_stage_mask_prediction_loss_weight_ = from._impl_.second_stage_mask_prediction_loss_weight_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.resize_masks_ = from._impl_.resize_masks_;
    }
    _this->_impl_._has_bits_[1] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void FasterRcnn::InternalSwap(FasterRcnn* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  swap(_impl_._has_bits_[1], other->_impl_._has_bits_[1]);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(FasterRcnn, _impl_.use_static_shapes_for_eval_)
      + sizeof(FasterRcnn::_impl_.use_static_shapes_for_eval_)
      - PROTOBUF_FIELD_OFFSET(FasterRcnn, _impl_.image_resizer_)>(
          reinterpret_cast<char*>(&_impl_.image_resizer_),
          reinterpret_cast<char*>(&other->_impl_.image_resizer_));
  swap(_impl_.number_of_stages_, other->_impl_.number_of_stages_);
  swap(_impl_.first_stage_atrous_rate_, other->_impl_.first_stage_atrous_rate_);
  swap(_impl_.first_stage_box_predictor_kernel_size_, other->_impl_.first_stage_box_predictor_kernel_size_);
  swap(_impl_.first_stage_box_predictor_depth_, other->_impl_.first_stage_box_predictor_depth_);
  swap(_impl_.first_stage_minibatch_size_, other->_impl_.first_stage_minibatch_size_);
  swap(_impl_.first_stage_positive_balance_fraction_, other->_impl_.first_stage_positive_balance_fraction_);
  swap(_impl_.first_stage_nms_iou_threshold_, other->_impl_.first_stage_nms_iou_threshold_);
  swap(_impl_.first_stage_max_proposals_, other->_impl_.first_stage_max_proposals_);
  swap(_impl_.first_stage_localization_loss_weight_, other->_impl_.first_stage_localization_loss_weight_);
  swap(_impl_.first_stage_objectness_loss_weight_, other->_impl_.first_stage_objectness_loss_weight_);
  swap(_impl_.second_stage_batch_size_, other->_impl_.second_stage_batch_size_);
  swap(_impl_.second_stage_balance_fraction_, other->_impl_.second_stage_balance_fraction_);
  swap(_impl_.second_stage_localization_loss_weight_, other->_impl_.second_stage_localization_loss_weight_);
  swap(_impl_.second_stage_classification_loss_weight_, other->_impl_.second_stage_classification_loss_weight_);
  swap(_impl_.second_stage_mask_prediction_loss_weight_, other->_impl_.second_stage_mask_prediction_loss_weight_);
  swap(_impl_.resize_masks_, other->_impl_.resize_masks_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FasterRcnn::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto[0]);
}

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

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

FasterRcnnFeatureExtractor::FasterRcnnFeatureExtractor(::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.FasterRcnnFeatureExtractor)
}
FasterRcnnFeatureExtractor::FasterRcnnFeatureExtractor(const FasterRcnnFeatureExtractor& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FasterRcnnFeatureExtractor* 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_.batch_norm_trainable_){}
    , decltype(_impl_.first_stage_features_stride_){}};

  _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());
  }
  ::memcpy(&_impl_.batch_norm_trainable_, &from._impl_.batch_norm_trainable_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.first_stage_features_stride_) -
    reinterpret_cast<char*>(&_impl_.batch_norm_trainable_)) + sizeof(_impl_.first_stage_features_stride_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.FasterRcnnFeatureExtractor)
}

inline void FasterRcnnFeatureExtractor::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_.batch_norm_trainable_){false}
    , decltype(_impl_.first_stage_features_stride_){16}
  };
  _impl_.type_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    _impl_.type_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
}

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

inline void FasterRcnnFeatureExtractor::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.type_.Destroy();
}

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

void FasterRcnnFeatureExtractor::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.FasterRcnnFeatureExtractor)
  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) {
    _impl_.type_.ClearNonDefaultToEmpty();
  }
  if (cached_has_bits & 0x00000006u) {
    _impl_.batch_norm_trainable_ = false;
    _impl_.first_stage_features_stride_ = 16;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* FasterRcnnFeatureExtractor::_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.FasterRcnnFeatureExtractor.type");
          #endif  // !NDEBUG
        } else
          goto handle_unusual;
        continue;
      // optional int32 first_stage_features_stride = 2 [default = 16];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_first_stage_features_stride(&has_bits);
          _impl_.first_stage_features_stride_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool batch_norm_trainable = 3 [default = false];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_batch_norm_trainable(&has_bits);
          _impl_.batch_norm_trainable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&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* FasterRcnnFeatureExtractor::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.FasterRcnnFeatureExtractor)
  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.FasterRcnnFeatureExtractor.type");
    target = stream->WriteStringMaybeAliased(
        1, this->_internal_type(), target);
  }

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

  // optional bool batch_norm_trainable = 3 [default = false];
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_batch_norm_trainable(), 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.FasterRcnnFeatureExtractor)
  return target;
}

size_t FasterRcnnFeatureExtractor::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.FasterRcnnFeatureExtractor)
  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 string type = 1;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_type());
    }

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

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

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

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


void FasterRcnnFeatureExtractor::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<FasterRcnnFeatureExtractor*>(&to_msg);
  auto& from = static_cast<const FasterRcnnFeatureExtractor&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.FasterRcnnFeatureExtractor)
  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->_internal_set_type(from._internal_type());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.batch_norm_trainable_ = from._impl_.batch_norm_trainable_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.first_stage_features_stride_ = from._impl_.first_stage_features_stride_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void FasterRcnnFeatureExtractor::InternalSwap(FasterRcnnFeatureExtractor* 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
  );
  swap(_impl_.batch_norm_trainable_, other->_impl_.batch_norm_trainable_);
  swap(_impl_.first_stage_features_stride_, other->_impl_.first_stage_features_stride_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FasterRcnnFeatureExtractor::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2ffaster_5frcnn_2eproto[1]);
}

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

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