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

#include "object_detection/protos/post_processing.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 BatchNonMaxSuppression::BatchNonMaxSuppression(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.score_threshold_)*/0
  , /*decltype(_impl_.use_static_shapes_)*/false
  , /*decltype(_impl_.use_class_agnostic_nms_)*/false
  , /*decltype(_impl_.soft_nms_sigma_)*/0
  , /*decltype(_impl_.iou_threshold_)*/0.6f
  , /*decltype(_impl_.max_detections_per_class_)*/100
  , /*decltype(_impl_.max_total_detections_)*/100
  , /*decltype(_impl_.max_classes_per_detection_)*/1} {}
struct BatchNonMaxSuppressionDefaultTypeInternal {
  PROTOBUF_CONSTEXPR BatchNonMaxSuppressionDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~BatchNonMaxSuppressionDefaultTypeInternal() {}
  union {
    BatchNonMaxSuppression _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 BatchNonMaxSuppressionDefaultTypeInternal _BatchNonMaxSuppression_default_instance_;
PROTOBUF_CONSTEXPR PostProcessing::PostProcessing(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.batch_non_max_suppression_)*/nullptr
  , /*decltype(_impl_.calibration_config_)*/nullptr
  , /*decltype(_impl_.score_converter_)*/0
  , /*decltype(_impl_.logit_scale_)*/1} {}
struct PostProcessingDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PostProcessingDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~PostProcessingDefaultTypeInternal() {}
  union {
    PostProcessing _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PostProcessingDefaultTypeInternal _PostProcessing_default_instance_;
}  // namespace protos
}  // namespace object_detection
static ::_pb::Metadata file_level_metadata_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto[2];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto[1];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto = nullptr;

const uint32_t TableStruct_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _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::BatchNonMaxSuppression, _impl_.score_threshold_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.iou_threshold_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.max_detections_per_class_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.max_total_detections_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.use_static_shapes_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.use_class_agnostic_nms_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.max_classes_per_detection_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::BatchNonMaxSuppression, _impl_.soft_nms_sigma_),
  0,
  4,
  5,
  6,
  1,
  2,
  7,
  3,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::PostProcessing, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::PostProcessing, _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::PostProcessing, _impl_.batch_non_max_suppression_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::PostProcessing, _impl_.score_converter_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::PostProcessing, _impl_.logit_scale_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::PostProcessing, _impl_.calibration_config_),
  0,
  2,
  3,
  1,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 14, -1, sizeof(::object_detection::protos::BatchNonMaxSuppression)},
  { 22, 32, -1, sizeof(::object_detection::protos::PostProcessing)},
};

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

const char descriptor_table_protodef_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n-object_detection/protos/post_processin"
  "g.proto\022\027object_detection.protos\032)object"
  "_detection/protos/calibration.proto\"\244\002\n\026"
  "BatchNonMaxSuppression\022\032\n\017score_threshol"
  "d\030\001 \001(\002:\0010\022\032\n\riou_threshold\030\002 \001(\002:\0030.6\022%"
  "\n\030max_detections_per_class\030\003 \001(\005:\003100\022!\n"
  "\024max_total_detections\030\005 \001(\005:\003100\022 \n\021use_"
  "static_shapes\030\006 \001(\010:\005false\022%\n\026use_class_"
  "agnostic_nms\030\007 \001(\010:\005false\022$\n\031max_classes"
  "_per_detection\030\010 \001(\005:\0011\022\031\n\016soft_nms_sigm"
  "a\030\t \001(\002:\0010\"\331\002\n\016PostProcessing\022R\n\031batch_n"
  "on_max_suppression\030\001 \001(\0132/.object_detect"
  "ion.protos.BatchNonMaxSuppression\022Y\n\017sco"
  "re_converter\030\002 \001(\01626.object_detection.pr"
  "otos.PostProcessing.ScoreConverter:\010IDEN"
  "TITY\022\026\n\013logit_scale\030\003 \001(\002:\0011\022F\n\022calibrat"
  "ion_config\030\004 \001(\0132*.object_detection.prot"
  "os.CalibrationConfig\"8\n\016ScoreConverter\022\014"
  "\n\010IDENTITY\020\000\022\013\n\007SIGMOID\020\001\022\013\n\007SOFTMAX\020\002"
  ;
static const ::_pbi::DescriptorTable* const descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_deps[1] = {
  &::descriptor_table_object_5fdetection_2fprotos_2fcalibration_2eproto,
};
static ::_pbi::once_flag descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto = {
    false, false, 758, descriptor_table_protodef_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto,
    "object_detection/protos/post_processing.proto",
    &descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_once, descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_deps, 1, 2,
    schemas, file_default_instances, TableStruct_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto::offsets,
    file_level_metadata_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto, file_level_enum_descriptors_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto,
    file_level_service_descriptors_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_getter() {
  return &descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto(&descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto);
namespace object_detection {
namespace protos {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PostProcessing_ScoreConverter_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto);
  return file_level_enum_descriptors_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto[0];
}
bool PostProcessing_ScoreConverter_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr PostProcessing_ScoreConverter PostProcessing::IDENTITY;
constexpr PostProcessing_ScoreConverter PostProcessing::SIGMOID;
constexpr PostProcessing_ScoreConverter PostProcessing::SOFTMAX;
constexpr PostProcessing_ScoreConverter PostProcessing::ScoreConverter_MIN;
constexpr PostProcessing_ScoreConverter PostProcessing::ScoreConverter_MAX;
constexpr int PostProcessing::ScoreConverter_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class BatchNonMaxSuppression::_Internal {
 public:
  using HasBits = decltype(std::declval<BatchNonMaxSuppression>()._impl_._has_bits_);
  static void set_has_score_threshold(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_iou_threshold(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_max_detections_per_class(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_max_total_detections(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_use_static_shapes(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_use_class_agnostic_nms(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_max_classes_per_detection(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_soft_nms_sigma(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
};

BatchNonMaxSuppression::BatchNonMaxSuppression(::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.BatchNonMaxSuppression)
}
BatchNonMaxSuppression::BatchNonMaxSuppression(const BatchNonMaxSuppression& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  BatchNonMaxSuppression* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.score_threshold_){}
    , decltype(_impl_.use_static_shapes_){}
    , decltype(_impl_.use_class_agnostic_nms_){}
    , decltype(_impl_.soft_nms_sigma_){}
    , decltype(_impl_.iou_threshold_){}
    , decltype(_impl_.max_detections_per_class_){}
    , decltype(_impl_.max_total_detections_){}
    , decltype(_impl_.max_classes_per_detection_){}};

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

inline void BatchNonMaxSuppression::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_.score_threshold_){0}
    , decltype(_impl_.use_static_shapes_){false}
    , decltype(_impl_.use_class_agnostic_nms_){false}
    , decltype(_impl_.soft_nms_sigma_){0}
    , decltype(_impl_.iou_threshold_){0.6f}
    , decltype(_impl_.max_detections_per_class_){100}
    , decltype(_impl_.max_total_detections_){100}
    , decltype(_impl_.max_classes_per_detection_){1}
  };
}

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

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

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

void BatchNonMaxSuppression::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.BatchNonMaxSuppression)
  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) {
    ::memset(&_impl_.score_threshold_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.soft_nms_sigma_) -
        reinterpret_cast<char*>(&_impl_.score_threshold_)) + sizeof(_impl_.soft_nms_sigma_));
    _impl_.iou_threshold_ = 0.6f;
    _impl_.max_detections_per_class_ = 100;
    _impl_.max_total_detections_ = 100;
    _impl_.max_classes_per_detection_ = 1;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* BatchNonMaxSuppression::_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 float score_threshold = 1 [default = 0];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _Internal::set_has_score_threshold(&has_bits);
          _impl_.score_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional float iou_threshold = 2 [default = 0.6];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 21)) {
          _Internal::set_has_iou_threshold(&has_bits);
          _impl_.iou_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_detections_per_class = 3 [default = 100];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          _Internal::set_has_max_detections_per_class(&has_bits);
          _impl_.max_detections_per_class_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_total_detections = 5 [default = 100];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_max_total_detections(&has_bits);
          _impl_.max_total_detections_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_static_shapes = 6 [default = false];
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          _Internal::set_has_use_static_shapes(&has_bits);
          _impl_.use_static_shapes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool use_class_agnostic_nms = 7 [default = false];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
          _Internal::set_has_use_class_agnostic_nms(&has_bits);
          _impl_.use_class_agnostic_nms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_classes_per_detection = 8 [default = 1];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_max_classes_per_detection(&has_bits);
          _impl_.max_classes_per_detection_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional float soft_nms_sigma = 9 [default = 0];
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 77)) {
          _Internal::set_has_soft_nms_sigma(&has_bits);
          _impl_.soft_nms_sigma_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } 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* BatchNonMaxSuppression::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.BatchNonMaxSuppression)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

  // optional float iou_threshold = 2 [default = 0.6];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(2, this->_internal_iou_threshold(), target);
  }

  // optional int32 max_detections_per_class = 3 [default = 100];
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_max_detections_per_class(), target);
  }

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

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

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

  // optional int32 max_classes_per_detection = 8 [default = 1];
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(8, this->_internal_max_classes_per_detection(), target);
  }

  // optional float soft_nms_sigma = 9 [default = 0];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(9, this->_internal_soft_nms_sigma(), 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.BatchNonMaxSuppression)
  return target;
}

size_t BatchNonMaxSuppression::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.BatchNonMaxSuppression)
  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 float score_threshold = 1 [default = 0];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 + 4;
    }

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

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

    // optional float soft_nms_sigma = 9 [default = 0];
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 + 4;
    }

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

    // optional int32 max_detections_per_class = 3 [default = 100];
    if (cached_has_bits & 0x00000020u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_max_detections_per_class());
    }

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

    // optional int32 max_classes_per_detection = 8 [default = 1];
    if (cached_has_bits & 0x00000080u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_max_classes_per_detection());
    }

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

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


void BatchNonMaxSuppression::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<BatchNonMaxSuppression*>(&to_msg);
  auto& from = static_cast<const BatchNonMaxSuppression&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.BatchNonMaxSuppression)
  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->_impl_.score_threshold_ = from._impl_.score_threshold_;
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.use_static_shapes_ = from._impl_.use_static_shapes_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.use_class_agnostic_nms_ = from._impl_.use_class_agnostic_nms_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.soft_nms_sigma_ = from._impl_.soft_nms_sigma_;
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_impl_.iou_threshold_ = from._impl_.iou_threshold_;
    }
    if (cached_has_bits & 0x00000020u) {
      _this->_impl_.max_detections_per_class_ = from._impl_.max_detections_per_class_;
    }
    if (cached_has_bits & 0x00000040u) {
      _this->_impl_.max_total_detections_ = from._impl_.max_total_detections_;
    }
    if (cached_has_bits & 0x00000080u) {
      _this->_impl_.max_classes_per_detection_ = from._impl_.max_classes_per_detection_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void BatchNonMaxSuppression::InternalSwap(BatchNonMaxSuppression* 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(BatchNonMaxSuppression, _impl_.soft_nms_sigma_)
      + sizeof(BatchNonMaxSuppression::_impl_.soft_nms_sigma_)
      - PROTOBUF_FIELD_OFFSET(BatchNonMaxSuppression, _impl_.score_threshold_)>(
          reinterpret_cast<char*>(&_impl_.score_threshold_),
          reinterpret_cast<char*>(&other->_impl_.score_threshold_));
  swap(_impl_.iou_threshold_, other->_impl_.iou_threshold_);
  swap(_impl_.max_detections_per_class_, other->_impl_.max_detections_per_class_);
  swap(_impl_.max_total_detections_, other->_impl_.max_total_detections_);
  swap(_impl_.max_classes_per_detection_, other->_impl_.max_classes_per_detection_);
}

::PROTOBUF_NAMESPACE_ID::Metadata BatchNonMaxSuppression::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto[0]);
}

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

class PostProcessing::_Internal {
 public:
  using HasBits = decltype(std::declval<PostProcessing>()._impl_._has_bits_);
  static const ::object_detection::protos::BatchNonMaxSuppression& batch_non_max_suppression(const PostProcessing* msg);
  static void set_has_batch_non_max_suppression(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_score_converter(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_logit_scale(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static const ::object_detection::protos::CalibrationConfig& calibration_config(const PostProcessing* msg);
  static void set_has_calibration_config(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

const ::object_detection::protos::BatchNonMaxSuppression&
PostProcessing::_Internal::batch_non_max_suppression(const PostProcessing* msg) {
  return *msg->_impl_.batch_non_max_suppression_;
}
const ::object_detection::protos::CalibrationConfig&
PostProcessing::_Internal::calibration_config(const PostProcessing* msg) {
  return *msg->_impl_.calibration_config_;
}
void PostProcessing::clear_calibration_config() {
  if (_impl_.calibration_config_ != nullptr) _impl_.calibration_config_->Clear();
  _impl_._has_bits_[0] &= ~0x00000002u;
}
PostProcessing::PostProcessing(::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.PostProcessing)
}
PostProcessing::PostProcessing(const PostProcessing& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  PostProcessing* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.batch_non_max_suppression_){nullptr}
    , decltype(_impl_.calibration_config_){nullptr}
    , decltype(_impl_.score_converter_){}
    , decltype(_impl_.logit_scale_){}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  if (from._internal_has_batch_non_max_suppression()) {
    _this->_impl_.batch_non_max_suppression_ = new ::object_detection::protos::BatchNonMaxSuppression(*from._impl_.batch_non_max_suppression_);
  }
  if (from._internal_has_calibration_config()) {
    _this->_impl_.calibration_config_ = new ::object_detection::protos::CalibrationConfig(*from._impl_.calibration_config_);
  }
  ::memcpy(&_impl_.score_converter_, &from._impl_.score_converter_,
    static_cast<size_t>(reinterpret_cast<char*>(&_impl_.logit_scale_) -
    reinterpret_cast<char*>(&_impl_.score_converter_)) + sizeof(_impl_.logit_scale_));
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.PostProcessing)
}

inline void PostProcessing::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_.batch_non_max_suppression_){nullptr}
    , decltype(_impl_.calibration_config_){nullptr}
    , decltype(_impl_.score_converter_){0}
    , decltype(_impl_.logit_scale_){1}
  };
}

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

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

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

void PostProcessing::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.PostProcessing)
  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 & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      GOOGLE_DCHECK(_impl_.batch_non_max_suppression_ != nullptr);
      _impl_.batch_non_max_suppression_->Clear();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(_impl_.calibration_config_ != nullptr);
      _impl_.calibration_config_->Clear();
    }
  }
  if (cached_has_bits & 0x0000000cu) {
    _impl_.score_converter_ = 0;
    _impl_.logit_scale_ = 1;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* PostProcessing::_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 .object_detection.protos.BatchNonMaxSuppression batch_non_max_suppression = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_batch_non_max_suppression(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.PostProcessing.ScoreConverter score_converter = 2 [default = IDENTITY];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::object_detection::protos::PostProcessing_ScoreConverter_IsValid(val))) {
            _internal_set_score_converter(static_cast<::object_detection::protos::PostProcessing_ScoreConverter>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional float logit_scale = 3 [default = 1];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
          _Internal::set_has_logit_scale(&has_bits);
          _impl_.logit_scale_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.CalibrationConfig calibration_config = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_calibration_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* PostProcessing::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.PostProcessing)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional .object_detection.protos.BatchNonMaxSuppression batch_non_max_suppression = 1;
  if (cached_has_bits & 0x00000001u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, _Internal::batch_non_max_suppression(this),
        _Internal::batch_non_max_suppression(this).GetCachedSize(), target, stream);
  }

  // optional .object_detection.protos.PostProcessing.ScoreConverter score_converter = 2 [default = IDENTITY];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      2, this->_internal_score_converter(), target);
  }

  // optional float logit_scale = 3 [default = 1];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(3, this->_internal_logit_scale(), target);
  }

  // optional .object_detection.protos.CalibrationConfig calibration_config = 4;
  if (cached_has_bits & 0x00000002u) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(4, _Internal::calibration_config(this),
        _Internal::calibration_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.PostProcessing)
  return target;
}

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

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

    // optional .object_detection.protos.PostProcessing.ScoreConverter score_converter = 2 [default = IDENTITY];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_score_converter());
    }

    // optional float logit_scale = 3 [default = 1];
    if (cached_has_bits & 0x00000008u) {
      total_size += 1 + 4;
    }

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

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


void PostProcessing::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) {
  auto* const _this = static_cast<PostProcessing*>(&to_msg);
  auto& from = static_cast<const PostProcessing&>(from_msg);
  // @@protoc_insertion_point(class_specific_merge_from_start:object_detection.protos.PostProcessing)
  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 & 0x0000000fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_internal_mutable_batch_non_max_suppression()->::object_detection::protos::BatchNonMaxSuppression::MergeFrom(
          from._internal_batch_non_max_suppression());
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_internal_mutable_calibration_config()->::object_detection::protos::CalibrationConfig::MergeFrom(
          from._internal_calibration_config());
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.score_converter_ = from._impl_.score_converter_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.logit_scale_ = from._impl_.logit_scale_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void PostProcessing::InternalSwap(PostProcessing* 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(PostProcessing, _impl_.score_converter_)
      + sizeof(PostProcessing::_impl_.score_converter_)
      - PROTOBUF_FIELD_OFFSET(PostProcessing, _impl_.batch_non_max_suppression_)>(
          reinterpret_cast<char*>(&_impl_.batch_non_max_suppression_),
          reinterpret_cast<char*>(&other->_impl_.batch_non_max_suppression_));
  swap(_impl_.logit_scale_, other->_impl_.logit_scale_);
}

::PROTOBUF_NAMESPACE_ID::Metadata PostProcessing::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fpost_5fprocessing_2eproto[1]);
}

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

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