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

#include "object_detection/protos/image_resizer.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 ImageResizer::ImageResizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_.image_resizer_oneof_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_._oneof_case_)*/{}} {}
struct ImageResizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ImageResizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ImageResizerDefaultTypeInternal() {}
  union {
    ImageResizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ImageResizerDefaultTypeInternal _ImageResizer_default_instance_;
PROTOBUF_CONSTEXPR IdentityResizer::IdentityResizer(
    ::_pbi::ConstantInitialized) {}
struct IdentityResizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR IdentityResizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~IdentityResizerDefaultTypeInternal() {}
  union {
    IdentityResizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IdentityResizerDefaultTypeInternal _IdentityResizer_default_instance_;
PROTOBUF_CONSTEXPR KeepAspectRatioResizer::KeepAspectRatioResizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.per_channel_pad_value_)*/{}
  , /*decltype(_impl_.resize_method_)*/0
  , /*decltype(_impl_.pad_to_max_dimension_)*/false
  , /*decltype(_impl_.convert_to_grayscale_)*/false
  , /*decltype(_impl_.min_dimension_)*/600
  , /*decltype(_impl_.max_dimension_)*/1024} {}
struct KeepAspectRatioResizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR KeepAspectRatioResizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~KeepAspectRatioResizerDefaultTypeInternal() {}
  union {
    KeepAspectRatioResizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 KeepAspectRatioResizerDefaultTypeInternal _KeepAspectRatioResizer_default_instance_;
PROTOBUF_CONSTEXPR FixedShapeResizer::FixedShapeResizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.resize_method_)*/0
  , /*decltype(_impl_.convert_to_grayscale_)*/false
  , /*decltype(_impl_.height_)*/300
  , /*decltype(_impl_.width_)*/300} {}
struct FixedShapeResizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR FixedShapeResizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~FixedShapeResizerDefaultTypeInternal() {}
  union {
    FixedShapeResizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 FixedShapeResizerDefaultTypeInternal _FixedShapeResizer_default_instance_;
PROTOBUF_CONSTEXPR ConditionalShapeResizer::ConditionalShapeResizer(
    ::_pbi::ConstantInitialized): _impl_{
    /*decltype(_impl_._has_bits_)*/{}
  , /*decltype(_impl_._cached_size_)*/{}
  , /*decltype(_impl_.resize_method_)*/0
  , /*decltype(_impl_.convert_to_grayscale_)*/false
  , /*decltype(_impl_.condition_)*/1
  , /*decltype(_impl_.size_threshold_)*/300} {}
struct ConditionalShapeResizerDefaultTypeInternal {
  PROTOBUF_CONSTEXPR ConditionalShapeResizerDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~ConditionalShapeResizerDefaultTypeInternal() {}
  union {
    ConditionalShapeResizer _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ConditionalShapeResizerDefaultTypeInternal _ConditionalShapeResizer_default_instance_;
}  // namespace protos
}  // namespace object_detection
static ::_pb::Metadata file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[5];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[2];
static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto = nullptr;

const uint32_t TableStruct_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ImageResizer, _internal_metadata_),
  ~0u,  // no _extensions_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ImageResizer, _impl_._oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  ::_pbi::kInvalidFieldOffsetTag,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ImageResizer, _impl_.image_resizer_oneof_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::IdentityResizer, _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::KeepAspectRatioResizer, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::KeepAspectRatioResizer, _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::KeepAspectRatioResizer, _impl_.min_dimension_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::KeepAspectRatioResizer, _impl_.max_dimension_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::KeepAspectRatioResizer, _impl_.resize_method_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::KeepAspectRatioResizer, _impl_.pad_to_max_dimension_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::KeepAspectRatioResizer, _impl_.convert_to_grayscale_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::KeepAspectRatioResizer, _impl_.per_channel_pad_value_),
  3,
  4,
  0,
  1,
  2,
  ~0u,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FixedShapeResizer, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FixedShapeResizer, _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::FixedShapeResizer, _impl_.height_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FixedShapeResizer, _impl_.width_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FixedShapeResizer, _impl_.resize_method_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::FixedShapeResizer, _impl_.convert_to_grayscale_),
  2,
  3,
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ConditionalShapeResizer, _impl_._has_bits_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ConditionalShapeResizer, _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::ConditionalShapeResizer, _impl_.condition_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ConditionalShapeResizer, _impl_.size_threshold_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ConditionalShapeResizer, _impl_.resize_method_),
  PROTOBUF_FIELD_OFFSET(::object_detection::protos::ConditionalShapeResizer, _impl_.convert_to_grayscale_),
  2,
  3,
  0,
  1,
};
static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, -1, sizeof(::object_detection::protos::ImageResizer)},
  { 11, -1, -1, sizeof(::object_detection::protos::IdentityResizer)},
  { 17, 29, -1, sizeof(::object_detection::protos::KeepAspectRatioResizer)},
  { 35, 45, -1, sizeof(::object_detection::protos::FixedShapeResizer)},
  { 49, 59, -1, sizeof(::object_detection::protos::ConditionalShapeResizer)},
};

static const ::_pb::Message* const file_default_instances[] = {
  &::object_detection::protos::_ImageResizer_default_instance_._instance,
  &::object_detection::protos::_IdentityResizer_default_instance_._instance,
  &::object_detection::protos::_KeepAspectRatioResizer_default_instance_._instance,
  &::object_detection::protos::_FixedShapeResizer_default_instance_._instance,
  &::object_detection::protos::_ConditionalShapeResizer_default_instance_._instance,
};

const char descriptor_table_protodef_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\n+object_detection/protos/image_resizer."
  "proto\022\027object_detection.protos\"\343\002\n\014Image"
  "Resizer\022T\n\031keep_aspect_ratio_resizer\030\001 \001"
  "(\0132/.object_detection.protos.KeepAspectR"
  "atioResizerH\000\022I\n\023fixed_shape_resizer\030\002 \001"
  "(\0132*.object_detection.protos.FixedShapeR"
  "esizerH\000\022D\n\020identity_resizer\030\003 \001(\0132(.obj"
  "ect_detection.protos.IdentityResizerH\000\022U"
  "\n\031conditional_shape_resizer\030\004 \001(\01320.obje"
  "ct_detection.protos.ConditionalShapeResi"
  "zerH\000B\025\n\023image_resizer_oneof\"\021\n\017Identity"
  "Resizer\"\200\002\n\026KeepAspectRatioResizer\022\032\n\rmi"
  "n_dimension\030\001 \001(\005:\003600\022\033\n\rmax_dimension\030"
  "\002 \001(\005:\0041024\022D\n\rresize_method\030\003 \001(\0162#.obj"
  "ect_detection.protos.ResizeType:\010BILINEA"
  "R\022#\n\024pad_to_max_dimension\030\004 \001(\010:\005false\022#"
  "\n\024convert_to_grayscale\030\005 \001(\010:\005false\022\035\n\025p"
  "er_channel_pad_value\030\006 \003(\002\"\247\001\n\021FixedShap"
  "eResizer\022\023\n\006height\030\001 \001(\005:\003300\022\022\n\005width\030\002"
  " \001(\005:\003300\022D\n\rresize_method\030\003 \001(\0162#.objec"
  "t_detection.protos.ResizeType:\010BILINEAR\022"
  "#\n\024convert_to_grayscale\030\004 \001(\010:\005false\"\271\002\n"
  "\027ConditionalShapeResizer\022\\\n\tcondition\030\001 "
  "\001(\0162@.object_detection.protos.Conditiona"
  "lShapeResizer.ResizeCondition:\007GREATER\022\033"
  "\n\016size_threshold\030\002 \001(\005:\003300\022D\n\rresize_me"
  "thod\030\003 \001(\0162#.object_detection.protos.Res"
  "izeType:\010BILINEAR\022#\n\024convert_to_grayscal"
  "e\030\004 \001(\010:\005false\"8\n\017ResizeCondition\022\013\n\007INV"
  "ALID\020\000\022\013\n\007GREATER\020\001\022\013\n\007SMALLER\020\002*G\n\nResi"
  "zeType\022\014\n\010BILINEAR\020\000\022\024\n\020NEAREST_NEIGHBOR"
  "\020\001\022\013\n\007BICUBIC\020\002\022\010\n\004AREA\020\003"
  ;
static ::_pbi::once_flag descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto = {
    false, false, 1265, descriptor_table_protodef_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto,
    "object_detection/protos/image_resizer.proto",
    &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once, nullptr, 0, 5,
    schemas, file_default_instances, TableStruct_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto::offsets,
    file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto, file_level_enum_descriptors_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto,
    file_level_service_descriptors_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_getter() {
  return &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto(&descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto);
namespace object_detection {
namespace protos {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ConditionalShapeResizer_ResizeCondition_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto);
  return file_level_enum_descriptors_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[0];
}
bool ConditionalShapeResizer_ResizeCondition_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 ConditionalShapeResizer_ResizeCondition ConditionalShapeResizer::INVALID;
constexpr ConditionalShapeResizer_ResizeCondition ConditionalShapeResizer::GREATER;
constexpr ConditionalShapeResizer_ResizeCondition ConditionalShapeResizer::SMALLER;
constexpr ConditionalShapeResizer_ResizeCondition ConditionalShapeResizer::ResizeCondition_MIN;
constexpr ConditionalShapeResizer_ResizeCondition ConditionalShapeResizer::ResizeCondition_MAX;
constexpr int ConditionalShapeResizer::ResizeCondition_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ResizeType_descriptor() {
  ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto);
  return file_level_enum_descriptors_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[1];
}
bool ResizeType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
    case 3:
      return true;
    default:
      return false;
  }
}


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

class ImageResizer::_Internal {
 public:
  static const ::object_detection::protos::KeepAspectRatioResizer& keep_aspect_ratio_resizer(const ImageResizer* msg);
  static const ::object_detection::protos::FixedShapeResizer& fixed_shape_resizer(const ImageResizer* msg);
  static const ::object_detection::protos::IdentityResizer& identity_resizer(const ImageResizer* msg);
  static const ::object_detection::protos::ConditionalShapeResizer& conditional_shape_resizer(const ImageResizer* msg);
};

const ::object_detection::protos::KeepAspectRatioResizer&
ImageResizer::_Internal::keep_aspect_ratio_resizer(const ImageResizer* msg) {
  return *msg->_impl_.image_resizer_oneof_.keep_aspect_ratio_resizer_;
}
const ::object_detection::protos::FixedShapeResizer&
ImageResizer::_Internal::fixed_shape_resizer(const ImageResizer* msg) {
  return *msg->_impl_.image_resizer_oneof_.fixed_shape_resizer_;
}
const ::object_detection::protos::IdentityResizer&
ImageResizer::_Internal::identity_resizer(const ImageResizer* msg) {
  return *msg->_impl_.image_resizer_oneof_.identity_resizer_;
}
const ::object_detection::protos::ConditionalShapeResizer&
ImageResizer::_Internal::conditional_shape_resizer(const ImageResizer* msg) {
  return *msg->_impl_.image_resizer_oneof_.conditional_shape_resizer_;
}
void ImageResizer::set_allocated_keep_aspect_ratio_resizer(::object_detection::protos::KeepAspectRatioResizer* keep_aspect_ratio_resizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_image_resizer_oneof();
  if (keep_aspect_ratio_resizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(keep_aspect_ratio_resizer);
    if (message_arena != submessage_arena) {
      keep_aspect_ratio_resizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, keep_aspect_ratio_resizer, submessage_arena);
    }
    set_has_keep_aspect_ratio_resizer();
    _impl_.image_resizer_oneof_.keep_aspect_ratio_resizer_ = keep_aspect_ratio_resizer;
  }
  // @@protoc_insertion_point(field_set_allocated:object_detection.protos.ImageResizer.keep_aspect_ratio_resizer)
}
void ImageResizer::set_allocated_fixed_shape_resizer(::object_detection::protos::FixedShapeResizer* fixed_shape_resizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_image_resizer_oneof();
  if (fixed_shape_resizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(fixed_shape_resizer);
    if (message_arena != submessage_arena) {
      fixed_shape_resizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, fixed_shape_resizer, submessage_arena);
    }
    set_has_fixed_shape_resizer();
    _impl_.image_resizer_oneof_.fixed_shape_resizer_ = fixed_shape_resizer;
  }
  // @@protoc_insertion_point(field_set_allocated:object_detection.protos.ImageResizer.fixed_shape_resizer)
}
void ImageResizer::set_allocated_identity_resizer(::object_detection::protos::IdentityResizer* identity_resizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_image_resizer_oneof();
  if (identity_resizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(identity_resizer);
    if (message_arena != submessage_arena) {
      identity_resizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, identity_resizer, submessage_arena);
    }
    set_has_identity_resizer();
    _impl_.image_resizer_oneof_.identity_resizer_ = identity_resizer;
  }
  // @@protoc_insertion_point(field_set_allocated:object_detection.protos.ImageResizer.identity_resizer)
}
void ImageResizer::set_allocated_conditional_shape_resizer(::object_detection::protos::ConditionalShapeResizer* conditional_shape_resizer) {
  ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
  clear_image_resizer_oneof();
  if (conditional_shape_resizer) {
    ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
      ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(conditional_shape_resizer);
    if (message_arena != submessage_arena) {
      conditional_shape_resizer = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
          message_arena, conditional_shape_resizer, submessage_arena);
    }
    set_has_conditional_shape_resizer();
    _impl_.image_resizer_oneof_.conditional_shape_resizer_ = conditional_shape_resizer;
  }
  // @@protoc_insertion_point(field_set_allocated:object_detection.protos.ImageResizer.conditional_shape_resizer)
}
ImageResizer::ImageResizer(::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.ImageResizer)
}
ImageResizer::ImageResizer(const ImageResizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  ImageResizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_.image_resizer_oneof_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}};

  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  clear_has_image_resizer_oneof();
  switch (from.image_resizer_oneof_case()) {
    case kKeepAspectRatioResizer: {
      _this->_internal_mutable_keep_aspect_ratio_resizer()->::object_detection::protos::KeepAspectRatioResizer::MergeFrom(
          from._internal_keep_aspect_ratio_resizer());
      break;
    }
    case kFixedShapeResizer: {
      _this->_internal_mutable_fixed_shape_resizer()->::object_detection::protos::FixedShapeResizer::MergeFrom(
          from._internal_fixed_shape_resizer());
      break;
    }
    case kIdentityResizer: {
      _this->_internal_mutable_identity_resizer()->::object_detection::protos::IdentityResizer::MergeFrom(
          from._internal_identity_resizer());
      break;
    }
    case kConditionalShapeResizer: {
      _this->_internal_mutable_conditional_shape_resizer()->::object_detection::protos::ConditionalShapeResizer::MergeFrom(
          from._internal_conditional_shape_resizer());
      break;
    }
    case IMAGE_RESIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.ImageResizer)
}

inline void ImageResizer::SharedCtor(
    ::_pb::Arena* arena, bool is_message_owned) {
  (void)arena;
  (void)is_message_owned;
  new (&_impl_) Impl_{
      decltype(_impl_.image_resizer_oneof_){}
    , /*decltype(_impl_._cached_size_)*/{}
    , /*decltype(_impl_._oneof_case_)*/{}
  };
  clear_has_image_resizer_oneof();
}

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

inline void ImageResizer::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  if (has_image_resizer_oneof()) {
    clear_image_resizer_oneof();
  }
}

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

void ImageResizer::clear_image_resizer_oneof() {
// @@protoc_insertion_point(one_of_clear_start:object_detection.protos.ImageResizer)
  switch (image_resizer_oneof_case()) {
    case kKeepAspectRatioResizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.image_resizer_oneof_.keep_aspect_ratio_resizer_;
      }
      break;
    }
    case kFixedShapeResizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.image_resizer_oneof_.fixed_shape_resizer_;
      }
      break;
    }
    case kIdentityResizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.image_resizer_oneof_.identity_resizer_;
      }
      break;
    }
    case kConditionalShapeResizer: {
      if (GetArenaForAllocation() == nullptr) {
        delete _impl_.image_resizer_oneof_.conditional_shape_resizer_;
      }
      break;
    }
    case IMAGE_RESIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  _impl_._oneof_case_[0] = IMAGE_RESIZER_ONEOF_NOT_SET;
}


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

  clear_image_resizer_oneof();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* ImageResizer::_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) {
      // .object_detection.protos.KeepAspectRatioResizer keep_aspect_ratio_resizer = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr = ctx->ParseMessage(_internal_mutable_keep_aspect_ratio_resizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .object_detection.protos.FixedShapeResizer fixed_shape_resizer = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          ptr = ctx->ParseMessage(_internal_mutable_fixed_shape_resizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .object_detection.protos.IdentityResizer identity_resizer = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          ptr = ctx->ParseMessage(_internal_mutable_identity_resizer(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // .object_detection.protos.ConditionalShapeResizer conditional_shape_resizer = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
          ptr = ctx->ParseMessage(_internal_mutable_conditional_shape_resizer(), 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* ImageResizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.ImageResizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  switch (image_resizer_oneof_case()) {
    case kKeepAspectRatioResizer: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(1, _Internal::keep_aspect_ratio_resizer(this),
          _Internal::keep_aspect_ratio_resizer(this).GetCachedSize(), target, stream);
      break;
    }
    case kFixedShapeResizer: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(2, _Internal::fixed_shape_resizer(this),
          _Internal::fixed_shape_resizer(this).GetCachedSize(), target, stream);
      break;
    }
    case kIdentityResizer: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(3, _Internal::identity_resizer(this),
          _Internal::identity_resizer(this).GetCachedSize(), target, stream);
      break;
    }
    case kConditionalShapeResizer: {
      target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
        InternalWriteMessage(4, _Internal::conditional_shape_resizer(this),
          _Internal::conditional_shape_resizer(this).GetCachedSize(), target, stream);
      break;
    }
    default: ;
  }
  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.ImageResizer)
  return target;
}

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

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

  switch (image_resizer_oneof_case()) {
    // .object_detection.protos.KeepAspectRatioResizer keep_aspect_ratio_resizer = 1;
    case kKeepAspectRatioResizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.image_resizer_oneof_.keep_aspect_ratio_resizer_);
      break;
    }
    // .object_detection.protos.FixedShapeResizer fixed_shape_resizer = 2;
    case kFixedShapeResizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.image_resizer_oneof_.fixed_shape_resizer_);
      break;
    }
    // .object_detection.protos.IdentityResizer identity_resizer = 3;
    case kIdentityResizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.image_resizer_oneof_.identity_resizer_);
      break;
    }
    // .object_detection.protos.ConditionalShapeResizer conditional_shape_resizer = 4;
    case kConditionalShapeResizer: {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *_impl_.image_resizer_oneof_.conditional_shape_resizer_);
      break;
    }
    case IMAGE_RESIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}

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


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

  switch (from.image_resizer_oneof_case()) {
    case kKeepAspectRatioResizer: {
      _this->_internal_mutable_keep_aspect_ratio_resizer()->::object_detection::protos::KeepAspectRatioResizer::MergeFrom(
          from._internal_keep_aspect_ratio_resizer());
      break;
    }
    case kFixedShapeResizer: {
      _this->_internal_mutable_fixed_shape_resizer()->::object_detection::protos::FixedShapeResizer::MergeFrom(
          from._internal_fixed_shape_resizer());
      break;
    }
    case kIdentityResizer: {
      _this->_internal_mutable_identity_resizer()->::object_detection::protos::IdentityResizer::MergeFrom(
          from._internal_identity_resizer());
      break;
    }
    case kConditionalShapeResizer: {
      _this->_internal_mutable_conditional_shape_resizer()->::object_detection::protos::ConditionalShapeResizer::MergeFrom(
          from._internal_conditional_shape_resizer());
      break;
    }
    case IMAGE_RESIZER_ONEOF_NOT_SET: {
      break;
    }
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void ImageResizer::InternalSwap(ImageResizer* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_.image_resizer_oneof_, other->_impl_.image_resizer_oneof_);
  swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
}

::PROTOBUF_NAMESPACE_ID::Metadata ImageResizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[0]);
}

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

class IdentityResizer::_Internal {
 public:
};

IdentityResizer::IdentityResizer(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) {
  // @@protoc_insertion_point(arena_constructor:object_detection.protos.IdentityResizer)
}
IdentityResizer::IdentityResizer(const IdentityResizer& from)
  : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() {
  IdentityResizer* const _this = this; (void)_this;
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:object_detection.protos.IdentityResizer)
}





const ::PROTOBUF_NAMESPACE_ID::Message::ClassData IdentityResizer::_class_data_ = {
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl,
    ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl,
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*IdentityResizer::GetClassData() const { return &_class_data_; }







::PROTOBUF_NAMESPACE_ID::Metadata IdentityResizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[1]);
}

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

class KeepAspectRatioResizer::_Internal {
 public:
  using HasBits = decltype(std::declval<KeepAspectRatioResizer>()._impl_._has_bits_);
  static void set_has_min_dimension(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_max_dimension(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_resize_method(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_pad_to_max_dimension(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_convert_to_grayscale(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
};

KeepAspectRatioResizer::KeepAspectRatioResizer(::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.KeepAspectRatioResizer)
}
KeepAspectRatioResizer::KeepAspectRatioResizer(const KeepAspectRatioResizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  KeepAspectRatioResizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.per_channel_pad_value_){from._impl_.per_channel_pad_value_}
    , decltype(_impl_.resize_method_){}
    , decltype(_impl_.pad_to_max_dimension_){}
    , decltype(_impl_.convert_to_grayscale_){}
    , decltype(_impl_.min_dimension_){}
    , decltype(_impl_.max_dimension_){}};

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

inline void KeepAspectRatioResizer::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_.per_channel_pad_value_){arena}
    , decltype(_impl_.resize_method_){0}
    , decltype(_impl_.pad_to_max_dimension_){false}
    , decltype(_impl_.convert_to_grayscale_){false}
    , decltype(_impl_.min_dimension_){600}
    , decltype(_impl_.max_dimension_){1024}
  };
}

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

inline void KeepAspectRatioResizer::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  _impl_.per_channel_pad_value_.~RepeatedField();
}

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

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

  _impl_.per_channel_pad_value_.Clear();
  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    ::memset(&_impl_.resize_method_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.convert_to_grayscale_) -
        reinterpret_cast<char*>(&_impl_.resize_method_)) + sizeof(_impl_.convert_to_grayscale_));
    _impl_.min_dimension_ = 600;
    _impl_.max_dimension_ = 1024;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* KeepAspectRatioResizer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 min_dimension = 1 [default = 600];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_min_dimension(&has_bits);
          _impl_.min_dimension_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 max_dimension = 2 [default = 1024];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_max_dimension(&has_bits);
          _impl_.max_dimension_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::object_detection::protos::ResizeType_IsValid(val))) {
            _internal_set_resize_method(static_cast<::object_detection::protos::ResizeType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional bool pad_to_max_dimension = 4 [default = false];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_pad_to_max_dimension(&has_bits);
          _impl_.pad_to_max_dimension_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool convert_to_grayscale = 5 [default = false];
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
          _Internal::set_has_convert_to_grayscale(&has_bits);
          _impl_.convert_to_grayscale_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated float per_channel_pad_value = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
          ptr -= 1;
          do {
            ptr += 1;
            _internal_add_per_channel_pad_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr));
            ptr += sizeof(float);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<53>(ptr));
        } else if (static_cast<uint8_t>(tag) == 50) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFloatParser(_internal_mutable_per_channel_pad_value(), ptr, ctx);
          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* KeepAspectRatioResizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.KeepAspectRatioResizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional int32 min_dimension = 1 [default = 600];
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_min_dimension(), target);
  }

  // optional int32 max_dimension = 2 [default = 1024];
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_max_dimension(), target);
  }

  // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      3, this->_internal_resize_method(), target);
  }

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

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

  // repeated float per_channel_pad_value = 6;
  for (int i = 0, n = this->_internal_per_channel_pad_value_size(); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteFloatToArray(6, this->_internal_per_channel_pad_value(i), 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.KeepAspectRatioResizer)
  return target;
}

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

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

  // repeated float per_channel_pad_value = 6;
  {
    unsigned int count = static_cast<unsigned int>(this->_internal_per_channel_pad_value_size());
    size_t data_size = 4UL * count;
    total_size += 1 *
                  ::_pbi::FromIntSize(this->_internal_per_channel_pad_value_size());
    total_size += data_size;
  }

  cached_has_bits = _impl_._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_resize_method());
    }

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

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

    // optional int32 min_dimension = 1 [default = 600];
    if (cached_has_bits & 0x00000008u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_min_dimension());
    }

    // optional int32 max_dimension = 2 [default = 1024];
    if (cached_has_bits & 0x00000010u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_max_dimension());
    }

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

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


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

  _this->_impl_.per_channel_pad_value_.MergeFrom(from._impl_.per_channel_pad_value_);
  cached_has_bits = from._impl_._has_bits_[0];
  if (cached_has_bits & 0x0000001fu) {
    if (cached_has_bits & 0x00000001u) {
      _this->_impl_.resize_method_ = from._impl_.resize_method_;
    }
    if (cached_has_bits & 0x00000002u) {
      _this->_impl_.pad_to_max_dimension_ = from._impl_.pad_to_max_dimension_;
    }
    if (cached_has_bits & 0x00000004u) {
      _this->_impl_.convert_to_grayscale_ = from._impl_.convert_to_grayscale_;
    }
    if (cached_has_bits & 0x00000008u) {
      _this->_impl_.min_dimension_ = from._impl_.min_dimension_;
    }
    if (cached_has_bits & 0x00000010u) {
      _this->_impl_.max_dimension_ = from._impl_.max_dimension_;
    }
    _this->_impl_._has_bits_[0] |= cached_has_bits;
  }
  _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void KeepAspectRatioResizer::InternalSwap(KeepAspectRatioResizer* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
  _impl_.per_channel_pad_value_.InternalSwap(&other->_impl_.per_channel_pad_value_);
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(KeepAspectRatioResizer, _impl_.convert_to_grayscale_)
      + sizeof(KeepAspectRatioResizer::_impl_.convert_to_grayscale_)
      - PROTOBUF_FIELD_OFFSET(KeepAspectRatioResizer, _impl_.resize_method_)>(
          reinterpret_cast<char*>(&_impl_.resize_method_),
          reinterpret_cast<char*>(&other->_impl_.resize_method_));
  swap(_impl_.min_dimension_, other->_impl_.min_dimension_);
  swap(_impl_.max_dimension_, other->_impl_.max_dimension_);
}

::PROTOBUF_NAMESPACE_ID::Metadata KeepAspectRatioResizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[2]);
}

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

class FixedShapeResizer::_Internal {
 public:
  using HasBits = decltype(std::declval<FixedShapeResizer>()._impl_._has_bits_);
  static void set_has_height(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_width(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_resize_method(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_convert_to_grayscale(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

FixedShapeResizer::FixedShapeResizer(::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.FixedShapeResizer)
}
FixedShapeResizer::FixedShapeResizer(const FixedShapeResizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  FixedShapeResizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.resize_method_){}
    , decltype(_impl_.convert_to_grayscale_){}
    , decltype(_impl_.height_){}
    , decltype(_impl_.width_){}};

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

inline void FixedShapeResizer::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_.resize_method_){0}
    , decltype(_impl_.convert_to_grayscale_){false}
    , decltype(_impl_.height_){300}
    , decltype(_impl_.width_){300}
  };
}

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

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

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

void FixedShapeResizer::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.FixedShapeResizer)
  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) {
    ::memset(&_impl_.resize_method_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.convert_to_grayscale_) -
        reinterpret_cast<char*>(&_impl_.resize_method_)) + sizeof(_impl_.convert_to_grayscale_));
    _impl_.height_ = 300;
    _impl_.width_ = 300;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* FixedShapeResizer::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 height = 1 [default = 300];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_height(&has_bits);
          _impl_.height_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 width = 2 [default = 300];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_width(&has_bits);
          _impl_.width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::object_detection::protos::ResizeType_IsValid(val))) {
            _internal_set_resize_method(static_cast<::object_detection::protos::ResizeType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional bool convert_to_grayscale = 4 [default = false];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_convert_to_grayscale(&has_bits);
          _impl_.convert_to_grayscale_ = ::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* FixedShapeResizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.FixedShapeResizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

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

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

  // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      3, this->_internal_resize_method(), target);
  }

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

size_t FixedShapeResizer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.FixedShapeResizer)
  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.ResizeType resize_method = 3 [default = BILINEAR];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_resize_method());
    }

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

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

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

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

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


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

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

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

void FixedShapeResizer::InternalSwap(FixedShapeResizer* 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(FixedShapeResizer, _impl_.convert_to_grayscale_)
      + sizeof(FixedShapeResizer::_impl_.convert_to_grayscale_)
      - PROTOBUF_FIELD_OFFSET(FixedShapeResizer, _impl_.resize_method_)>(
          reinterpret_cast<char*>(&_impl_.resize_method_),
          reinterpret_cast<char*>(&other->_impl_.resize_method_));
  swap(_impl_.height_, other->_impl_.height_);
  swap(_impl_.width_, other->_impl_.width_);
}

::PROTOBUF_NAMESPACE_ID::Metadata FixedShapeResizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[3]);
}

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

class ConditionalShapeResizer::_Internal {
 public:
  using HasBits = decltype(std::declval<ConditionalShapeResizer>()._impl_._has_bits_);
  static void set_has_condition(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_size_threshold(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_resize_method(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_convert_to_grayscale(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
};

ConditionalShapeResizer::ConditionalShapeResizer(::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.ConditionalShapeResizer)
}
ConditionalShapeResizer::ConditionalShapeResizer(const ConditionalShapeResizer& from)
  : ::PROTOBUF_NAMESPACE_ID::Message() {
  ConditionalShapeResizer* const _this = this; (void)_this;
  new (&_impl_) Impl_{
      decltype(_impl_._has_bits_){from._impl_._has_bits_}
    , /*decltype(_impl_._cached_size_)*/{}
    , decltype(_impl_.resize_method_){}
    , decltype(_impl_.convert_to_grayscale_){}
    , decltype(_impl_.condition_){}
    , decltype(_impl_.size_threshold_){}};

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

inline void ConditionalShapeResizer::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_.resize_method_){0}
    , decltype(_impl_.convert_to_grayscale_){false}
    , decltype(_impl_.condition_){1}
    , decltype(_impl_.size_threshold_){300}
  };
}

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

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

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

void ConditionalShapeResizer::Clear() {
// @@protoc_insertion_point(message_clear_start:object_detection.protos.ConditionalShapeResizer)
  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) {
    ::memset(&_impl_.resize_method_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&_impl_.convert_to_grayscale_) -
        reinterpret_cast<char*>(&_impl_.resize_method_)) + sizeof(_impl_.convert_to_grayscale_));
    _impl_.condition_ = 1;
    _impl_.size_threshold_ = 300;
  }
  _impl_._has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* ConditionalShapeResizer::_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.ConditionalShapeResizer.ResizeCondition condition = 1 [default = GREATER];
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::object_detection::protos::ConditionalShapeResizer_ResizeCondition_IsValid(val))) {
            _internal_set_condition(static_cast<::object_detection::protos::ConditionalShapeResizer_ResizeCondition>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional int32 size_threshold = 2 [default = 300];
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_size_threshold(&has_bits);
          _impl_.size_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::object_detection::protos::ResizeType_IsValid(val))) {
            _internal_set_resize_method(static_cast<::object_detection::protos::ResizeType>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional bool convert_to_grayscale = 4 [default = false];
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_convert_to_grayscale(&has_bits);
          _impl_.convert_to_grayscale_ = ::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* ConditionalShapeResizer::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:object_detection.protos.ConditionalShapeResizer)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _impl_._has_bits_[0];
  // optional .object_detection.protos.ConditionalShapeResizer.ResizeCondition condition = 1 [default = GREATER];
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      1, this->_internal_condition(), target);
  }

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

  // optional .object_detection.protos.ResizeType resize_method = 3 [default = BILINEAR];
  if (cached_has_bits & 0x00000001u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      3, this->_internal_resize_method(), target);
  }

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

size_t ConditionalShapeResizer::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:object_detection.protos.ConditionalShapeResizer)
  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.ResizeType resize_method = 3 [default = BILINEAR];
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_resize_method());
    }

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

    // optional .object_detection.protos.ConditionalShapeResizer.ResizeCondition condition = 1 [default = GREATER];
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_condition());
    }

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

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

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


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

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

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

void ConditionalShapeResizer::InternalSwap(ConditionalShapeResizer* 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(ConditionalShapeResizer, _impl_.convert_to_grayscale_)
      + sizeof(ConditionalShapeResizer::_impl_.convert_to_grayscale_)
      - PROTOBUF_FIELD_OFFSET(ConditionalShapeResizer, _impl_.resize_method_)>(
          reinterpret_cast<char*>(&_impl_.resize_method_),
          reinterpret_cast<char*>(&other->_impl_.resize_method_));
  swap(_impl_.condition_, other->_impl_.condition_);
  swap(_impl_.size_threshold_, other->_impl_.size_threshold_);
}

::PROTOBUF_NAMESPACE_ID::Metadata ConditionalShapeResizer::GetMetadata() const {
  return ::_pbi::AssignDescriptors(
      &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_getter, &descriptor_table_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto_once,
      file_level_metadata_object_5fdetection_2fprotos_2fimage_5fresizer_2eproto[4]);
}

// @@protoc_insertion_point(namespace_scope)
}  // namespace protos
}  // namespace object_detection
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::object_detection::protos::ImageResizer*
Arena::CreateMaybeMessage< ::object_detection::protos::ImageResizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::ImageResizer >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::IdentityResizer*
Arena::CreateMaybeMessage< ::object_detection::protos::IdentityResizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::IdentityResizer >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::KeepAspectRatioResizer*
Arena::CreateMaybeMessage< ::object_detection::protos::KeepAspectRatioResizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::KeepAspectRatioResizer >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::FixedShapeResizer*
Arena::CreateMaybeMessage< ::object_detection::protos::FixedShapeResizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::FixedShapeResizer >(arena);
}
template<> PROTOBUF_NOINLINE ::object_detection::protos::ConditionalShapeResizer*
Arena::CreateMaybeMessage< ::object_detection::protos::ConditionalShapeResizer >(Arena* arena) {
  return Arena::CreateMessageInternal< ::object_detection::protos::ConditionalShapeResizer >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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