Skip to content

File tensors_to_classification_calculator.pb.cc

File List > calculators > tensor > tensors_to_classification_calculator.pb.cc

Go to the documentation of this file

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: mediapipe/calculators/tensor/tensors_to_classification_calculator.proto

#include "mediapipe/calculators/tensor/tensors_to_classification_calculator.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 mediapipe {
constexpr TensorsToClassificationCalculatorOptions_LabelMap_Entry::TensorsToClassificationCalculatorOptions_LabelMap_Entry(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : label_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , id_(0){}
struct TensorsToClassificationCalculatorOptions_LabelMap_EntryDefaultTypeInternal {
  constexpr TensorsToClassificationCalculatorOptions_LabelMap_EntryDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~TensorsToClassificationCalculatorOptions_LabelMap_EntryDefaultTypeInternal() {}
  union {
    TensorsToClassificationCalculatorOptions_LabelMap_Entry _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorsToClassificationCalculatorOptions_LabelMap_EntryDefaultTypeInternal _TensorsToClassificationCalculatorOptions_LabelMap_Entry_default_instance_;
constexpr TensorsToClassificationCalculatorOptions_LabelMap::TensorsToClassificationCalculatorOptions_LabelMap(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : entries_(){}
struct TensorsToClassificationCalculatorOptions_LabelMapDefaultTypeInternal {
  constexpr TensorsToClassificationCalculatorOptions_LabelMapDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~TensorsToClassificationCalculatorOptions_LabelMapDefaultTypeInternal() {}
  union {
    TensorsToClassificationCalculatorOptions_LabelMap _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorsToClassificationCalculatorOptions_LabelMapDefaultTypeInternal _TensorsToClassificationCalculatorOptions_LabelMap_default_instance_;
constexpr TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized){}
struct TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUseDefaultTypeInternal {
  constexpr TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUseDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUseDefaultTypeInternal() {}
  union {
    TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUseDefaultTypeInternal _TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse_default_instance_;
constexpr TensorsToClassificationCalculatorOptions::TensorsToClassificationCalculatorOptions(
  ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
  : label_items_(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{})
  , ignore_classes_()
  , _ignore_classes_cached_byte_size_(0)
  , allow_classes_()
  , _allow_classes_cached_byte_size_(0)
  , label_map_path_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
  , label_map_(nullptr)
  , min_score_threshold_(0)
  , top_k_(0)
  , sort_by_descending_score_(false)
  , binary_classification_(false){}
struct TensorsToClassificationCalculatorOptionsDefaultTypeInternal {
  constexpr TensorsToClassificationCalculatorOptionsDefaultTypeInternal()
    : _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
  ~TensorsToClassificationCalculatorOptionsDefaultTypeInternal() {}
  union {
    TensorsToClassificationCalculatorOptions _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT TensorsToClassificationCalculatorOptionsDefaultTypeInternal _TensorsToClassificationCalculatorOptions_default_instance_;
}  // namespace mediapipe
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto[4];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto = nullptr;

const uint32_t TableStruct_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry, id_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry, label_),
  1,
  0,
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap, entries_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse, key_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse, value_),
  0,
  1,
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, _has_bits_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  ~0u,  // no _inlined_string_donated_
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, min_score_threshold_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, top_k_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, sort_by_descending_score_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, label_map_path_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, label_map_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, label_items_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, binary_classification_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, ignore_classes_),
  PROTOBUF_FIELD_OFFSET(::mediapipe::TensorsToClassificationCalculatorOptions, allow_classes_),
  2,
  3,
  4,
  0,
  1,
  ~0u,
  5,
  ~0u,
  ~0u,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, 8, -1, sizeof(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry)},
  { 10, -1, -1, sizeof(::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap)},
  { 17, 25, -1, sizeof(::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse)},
  { 27, 42, -1, sizeof(::mediapipe::TensorsToClassificationCalculatorOptions)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::mediapipe::_TensorsToClassificationCalculatorOptions_LabelMap_Entry_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::mediapipe::_TensorsToClassificationCalculatorOptions_LabelMap_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::mediapipe::_TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse_default_instance_),
  reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::mediapipe::_TensorsToClassificationCalculatorOptions_default_instance_),
};

const char descriptor_table_protodef_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  "\nGmediapipe/calculators/tensor/tensors_t"
  "o_classification_calculator.proto\022\tmedia"
  "pipe\032$mediapipe/framework/calculator.pro"
  "to\032\036mediapipe/util/label_map.proto\"\307\005\n(T"
  "ensorsToClassificationCalculatorOptions\022"
  "\033\n\023min_score_threshold\030\001 \001(\002\022\r\n\005top_k\030\002 "
  "\001(\005\022 \n\030sort_by_descending_score\030\t \001(\010\022\026\n"
  "\016label_map_path\030\003 \001(\t\022O\n\tlabel_map\030\005 \001(\013"
  "2<.mediapipe.TensorsToClassificationCalc"
  "ulatorOptions.LabelMap\022X\n\013label_items\030\006 "
  "\003(\0132C.mediapipe.TensorsToClassificationC"
  "alculatorOptions.LabelItemsEntry\022\035\n\025bina"
  "ry_classification\030\004 \001(\010\022\032\n\016ignore_classe"
  "s\030\007 \003(\005B\002\020\001\022\031\n\rallow_classes\030\010 \003(\005B\002\020\001\032\203"
  "\001\n\010LabelMap\022S\n\007entries\030\001 \003(\0132B.mediapipe"
  ".TensorsToClassificationCalculatorOption"
  "s.LabelMap.Entry\032\"\n\005Entry\022\n\n\002id\030\001 \001(\005\022\r\n"
  "\005label\030\002 \001(\t\032J\n\017LabelItemsEntry\022\013\n\003key\030\001"
  " \001(\003\022&\n\005value\030\002 \001(\0132\027.mediapipe.LabelMap"
  "Item:\0028\0012b\n\003ext\022\034.mediapipe.CalculatorOp"
  "tions\030\256\215\214\240\001 \001(\01323.mediapipe.TensorsToCla"
  "ssificationCalculatorOptions"
  ;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_deps[2] = {
  &::descriptor_table_mediapipe_2fframework_2fcalculator_2eproto,
  &::descriptor_table_mediapipe_2futil_2flabel_5fmap_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto = {
  false, false, 868, descriptor_table_protodef_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto, "mediapipe/calculators/tensor/tensors_to_classification_calculator.proto", 
  &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_once, descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_deps, 2, 4,
  schemas, file_default_instances, TableStruct_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto::offsets,
  file_level_metadata_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto, file_level_enum_descriptors_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto, file_level_service_descriptors_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_getter() {
  return &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto;
}

// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto(&descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto);
namespace mediapipe {

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

class TensorsToClassificationCalculatorOptions_LabelMap_Entry::_Internal {
 public:
  using HasBits = decltype(std::declval<TensorsToClassificationCalculatorOptions_LabelMap_Entry>()._has_bits_);
  static void set_has_id(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_label(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
};

TensorsToClassificationCalculatorOptions_LabelMap_Entry::TensorsToClassificationCalculatorOptions_LabelMap_Entry(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
}
TensorsToClassificationCalculatorOptions_LabelMap_Entry::TensorsToClassificationCalculatorOptions_LabelMap_Entry(const TensorsToClassificationCalculatorOptions_LabelMap_Entry& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    label_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_label()) {
    label_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_label(), 
      GetArenaForAllocation());
  }
  id_ = from.id_;
  // @@protoc_insertion_point(copy_constructor:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
}

inline void TensorsToClassificationCalculatorOptions_LabelMap_Entry::SharedCtor() {
label_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  label_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
id_ = 0;
}

TensorsToClassificationCalculatorOptions_LabelMap_Entry::~TensorsToClassificationCalculatorOptions_LabelMap_Entry() {
  // @@protoc_insertion_point(destructor:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void TensorsToClassificationCalculatorOptions_LabelMap_Entry::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  label_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void TensorsToClassificationCalculatorOptions_LabelMap_Entry::ArenaDtor(void* object) {
  TensorsToClassificationCalculatorOptions_LabelMap_Entry* _this = reinterpret_cast< TensorsToClassificationCalculatorOptions_LabelMap_Entry* >(object);
  (void)_this;
}
void TensorsToClassificationCalculatorOptions_LabelMap_Entry::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void TensorsToClassificationCalculatorOptions_LabelMap_Entry::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void TensorsToClassificationCalculatorOptions_LabelMap_Entry::Clear() {
// @@protoc_insertion_point(message_clear_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000001u) {
    label_.ClearNonDefaultToEmpty();
  }
  id_ = 0;
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TensorsToClassificationCalculatorOptions_LabelMap_Entry::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional int32 id = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_id(&has_bits);
          id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string label = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 18)) {
          auto str = _internal_mutable_label();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry.label");
          #endif  // !NDEBUG
          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:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* TensorsToClassificationCalculatorOptions_LabelMap_Entry::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // optional int32 id = 1;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_id(), target);
  }

  // optional string label = 2;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_label().data(), static_cast<int>(this->_internal_label().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry.label");
    target = stream->WriteStringMaybeAliased(
        2, this->_internal_label(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::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:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  return target;
}

size_t TensorsToClassificationCalculatorOptions_LabelMap_Entry::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  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 = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    // optional string label = 2;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_label());
    }

    // optional int32 id = 1;
    if (cached_has_bits & 0x00000002u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_id());
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

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

void TensorsToClassificationCalculatorOptions_LabelMap_Entry::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<TensorsToClassificationCalculatorOptions_LabelMap_Entry *>(to)->MergeFrom(
      static_cast<const TensorsToClassificationCalculatorOptions_LabelMap_Entry &>(from));
}


void TensorsToClassificationCalculatorOptions_LabelMap_Entry::MergeFrom(const TensorsToClassificationCalculatorOptions_LabelMap_Entry& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_label(from._internal_label());
    }
    if (cached_has_bits & 0x00000002u) {
      id_ = from.id_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void TensorsToClassificationCalculatorOptions_LabelMap_Entry::CopyFrom(const TensorsToClassificationCalculatorOptions_LabelMap_Entry& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void TensorsToClassificationCalculatorOptions_LabelMap_Entry::InternalSwap(TensorsToClassificationCalculatorOptions_LabelMap_Entry* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &label_, lhs_arena,
      &other->label_, rhs_arena
  );
  swap(id_, other->id_);
}

::PROTOBUF_NAMESPACE_ID::Metadata TensorsToClassificationCalculatorOptions_LabelMap_Entry::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_getter, &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_once,
      file_level_metadata_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto[0]);
}

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

class TensorsToClassificationCalculatorOptions_LabelMap::_Internal {
 public:
};

TensorsToClassificationCalculatorOptions_LabelMap::TensorsToClassificationCalculatorOptions_LabelMap(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  entries_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
}
TensorsToClassificationCalculatorOptions_LabelMap::TensorsToClassificationCalculatorOptions_LabelMap(const TensorsToClassificationCalculatorOptions_LabelMap& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      entries_(from.entries_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  // @@protoc_insertion_point(copy_constructor:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
}

inline void TensorsToClassificationCalculatorOptions_LabelMap::SharedCtor() {
}

TensorsToClassificationCalculatorOptions_LabelMap::~TensorsToClassificationCalculatorOptions_LabelMap() {
  // @@protoc_insertion_point(destructor:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

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

void TensorsToClassificationCalculatorOptions_LabelMap::ArenaDtor(void* object) {
  TensorsToClassificationCalculatorOptions_LabelMap* _this = reinterpret_cast< TensorsToClassificationCalculatorOptions_LabelMap* >(object);
  (void)_this;
}
void TensorsToClassificationCalculatorOptions_LabelMap::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void TensorsToClassificationCalculatorOptions_LabelMap::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void TensorsToClassificationCalculatorOptions_LabelMap::Clear() {
// @@protoc_insertion_point(message_clear_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

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

const char* TensorsToClassificationCalculatorOptions_LabelMap::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // repeated .mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry entries = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 10)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(_internal_add_entries(), ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(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* TensorsToClassificationCalculatorOptions_LabelMap::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  // repeated .mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry entries = 1;
  for (unsigned int i = 0,
      n = static_cast<unsigned int>(this->_internal_entries_size()); i < n; i++) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(1, this->_internal_entries(i), target, stream);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::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:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  return target;
}

size_t TensorsToClassificationCalculatorOptions_LabelMap::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  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 .mediapipe.TensorsToClassificationCalculatorOptions.LabelMap.Entry entries = 1;
  total_size += 1UL * this->_internal_entries_size();
  for (const auto& msg : this->entries_) {
    total_size +=
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
  }

  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

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

void TensorsToClassificationCalculatorOptions_LabelMap::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<TensorsToClassificationCalculatorOptions_LabelMap *>(to)->MergeFrom(
      static_cast<const TensorsToClassificationCalculatorOptions_LabelMap &>(from));
}


void TensorsToClassificationCalculatorOptions_LabelMap::MergeFrom(const TensorsToClassificationCalculatorOptions_LabelMap& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  entries_.MergeFrom(from.entries_);
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void TensorsToClassificationCalculatorOptions_LabelMap::CopyFrom(const TensorsToClassificationCalculatorOptions_LabelMap& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:mediapipe.TensorsToClassificationCalculatorOptions.LabelMap)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

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

void TensorsToClassificationCalculatorOptions_LabelMap::InternalSwap(TensorsToClassificationCalculatorOptions_LabelMap* other) {
  using std::swap;
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  entries_.InternalSwap(&other->entries_);
}

::PROTOBUF_NAMESPACE_ID::Metadata TensorsToClassificationCalculatorOptions_LabelMap::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_getter, &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_once,
      file_level_metadata_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto[1]);
}

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

TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse() {}
TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
    : SuperType(arena) {}
void TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::MergeFrom(const TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse& other) {
  MergeFromInternal(other);
}
::PROTOBUF_NAMESPACE_ID::Metadata TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_getter, &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_once,
      file_level_metadata_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto[2]);
}

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

class TensorsToClassificationCalculatorOptions::_Internal {
 public:
  using HasBits = decltype(std::declval<TensorsToClassificationCalculatorOptions>()._has_bits_);
  static void set_has_min_score_threshold(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static void set_has_top_k(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_sort_by_descending_score(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_label_map_path(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static const ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap& label_map(const TensorsToClassificationCalculatorOptions* msg);
  static void set_has_label_map(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_binary_classification(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
};

const ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap&
TensorsToClassificationCalculatorOptions::_Internal::label_map(const TensorsToClassificationCalculatorOptions* msg) {
  return *msg->label_map_;
}
void TensorsToClassificationCalculatorOptions::clear_label_items() {
  label_items_.Clear();
}
TensorsToClassificationCalculatorOptions::TensorsToClassificationCalculatorOptions(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned),
  label_items_(arena),
  ignore_classes_(arena),
  allow_classes_(arena) {
  SharedCtor();
  if (!is_message_owned) {
    RegisterArenaDtor(arena);
  }
  // @@protoc_insertion_point(arena_constructor:mediapipe.TensorsToClassificationCalculatorOptions)
}
TensorsToClassificationCalculatorOptions::TensorsToClassificationCalculatorOptions(const TensorsToClassificationCalculatorOptions& from)
  : ::PROTOBUF_NAMESPACE_ID::Message(),
      _has_bits_(from._has_bits_),
      ignore_classes_(from.ignore_classes_),
      allow_classes_(from.allow_classes_) {
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
  label_items_.MergeFrom(from.label_items_);
  label_map_path_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    label_map_path_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_label_map_path()) {
    label_map_path_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_label_map_path(), 
      GetArenaForAllocation());
  }
  if (from._internal_has_label_map()) {
    label_map_ = new ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap(*from.label_map_);
  } else {
    label_map_ = nullptr;
  }
  ::memcpy(&min_score_threshold_, &from.min_score_threshold_,
    static_cast<size_t>(reinterpret_cast<char*>(&binary_classification_) -
    reinterpret_cast<char*>(&min_score_threshold_)) + sizeof(binary_classification_));
  // @@protoc_insertion_point(copy_constructor:mediapipe.TensorsToClassificationCalculatorOptions)
}

inline void TensorsToClassificationCalculatorOptions::SharedCtor() {
label_map_path_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  label_map_path_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&label_map_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&binary_classification_) -
    reinterpret_cast<char*>(&label_map_)) + sizeof(binary_classification_));
}

TensorsToClassificationCalculatorOptions::~TensorsToClassificationCalculatorOptions() {
  // @@protoc_insertion_point(destructor:mediapipe.TensorsToClassificationCalculatorOptions)
  if (GetArenaForAllocation() != nullptr) return;
  SharedDtor();
  _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void TensorsToClassificationCalculatorOptions::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  label_map_path_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete label_map_;
}

void TensorsToClassificationCalculatorOptions::ArenaDtor(void* object) {
  TensorsToClassificationCalculatorOptions* _this = reinterpret_cast< TensorsToClassificationCalculatorOptions* >(object);
  (void)_this;
  _this->label_items_. ~MapField();
}
inline void TensorsToClassificationCalculatorOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena) {
  if (arena != nullptr) {
    arena->OwnCustomDestructor(this, &TensorsToClassificationCalculatorOptions::ArenaDtor);
  }
}
void TensorsToClassificationCalculatorOptions::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

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

  label_items_.Clear();
  ignore_classes_.Clear();
  allow_classes_.Clear();
  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000003u) {
    if (cached_has_bits & 0x00000001u) {
      label_map_path_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      GOOGLE_DCHECK(label_map_ != nullptr);
      label_map_->Clear();
    }
  }
  if (cached_has_bits & 0x0000003cu) {
    ::memset(&min_score_threshold_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&binary_classification_) -
        reinterpret_cast<char*>(&min_score_threshold_)) + sizeof(binary_classification_));
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* TensorsToClassificationCalculatorOptions::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // optional float min_score_threshold = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 13)) {
          _Internal::set_has_min_score_threshold(&has_bits);
          min_score_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
          ptr += sizeof(float);
        } else
          goto handle_unusual;
        continue;
      // optional int32 top_k = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_top_k(&has_bits);
          top_k_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string label_map_path = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_label_map_path();
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
          #ifndef NDEBUG
          ::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "mediapipe.TensorsToClassificationCalculatorOptions.label_map_path");
          #endif  // !NDEBUG
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool binary_classification = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_binary_classification(&has_bits);
          binary_classification_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .mediapipe.TensorsToClassificationCalculatorOptions.LabelMap label_map = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          ptr = ctx->ParseMessage(_internal_mutable_label_map(), ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // map<int64, .mediapipe.LabelMapItem> label_items = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 50)) {
          ptr -= 1;
          do {
            ptr += 1;
            ptr = ctx->ParseMessage(&label_items_, ptr);
            CHK_(ptr);
            if (!ctx->DataAvailable(ptr)) break;
          } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<50>(ptr));
        } else
          goto handle_unusual;
        continue;
      // repeated int32 ignore_classes = 7 [packed = true];
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_ignore_classes(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 56) {
          _internal_add_ignore_classes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // repeated int32 allow_classes = 8 [packed = true];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 66)) {
          ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_allow_classes(), ptr, ctx);
          CHK_(ptr);
        } else if (static_cast<uint8_t>(tag) == 64) {
          _internal_add_allow_classes(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool sort_by_descending_score = 9;
      case 9:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 72)) {
          _Internal::set_has_sort_by_descending_score(&has_bits);
          sort_by_descending_score_ = ::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:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

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

  cached_has_bits = _has_bits_[0];
  // optional float min_score_threshold = 1;
  if (cached_has_bits & 0x00000004u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(1, this->_internal_min_score_threshold(), target);
  }

  // optional int32 top_k = 2;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_top_k(), target);
  }

  // optional string label_map_path = 3;
  if (cached_has_bits & 0x00000001u) {
    ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::VerifyUTF8StringNamedField(
      this->_internal_label_map_path().data(), static_cast<int>(this->_internal_label_map_path().length()),
      ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SERIALIZE,
      "mediapipe.TensorsToClassificationCalculatorOptions.label_map_path");
    target = stream->WriteStringMaybeAliased(
        3, this->_internal_label_map_path(), target);
  }

  // optional bool binary_classification = 4;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_binary_classification(), target);
  }

  // optional .mediapipe.TensorsToClassificationCalculatorOptions.LabelMap label_map = 5;
  if (cached_has_bits & 0x00000002u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      InternalWriteMessage(
        5, _Internal::label_map(this), target, stream);
  }

  // map<int64, .mediapipe.LabelMapItem> label_items = 6;
  if (!this->_internal_label_items().empty()) {
    typedef ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::mediapipe::LabelMapItem >::const_pointer
        ConstPtr;
    typedef ::PROTOBUF_NAMESPACE_ID::internal::SortItem< int64_t, ConstPtr > SortItem;
    typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByFirstField<SortItem> Less;

    if (stream->IsSerializationDeterministic() &&
        this->_internal_label_items().size() > 1) {
      ::std::unique_ptr<SortItem[]> items(
          new SortItem[this->_internal_label_items().size()]);
      typedef ::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::mediapipe::LabelMapItem >::size_type size_type;
      size_type n = 0;
      for (::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::mediapipe::LabelMapItem >::const_iterator
          it = this->_internal_label_items().begin();
          it != this->_internal_label_items().end(); ++it, ++n) {
        items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
      }
      ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
      for (size_type i = 0; i < n; i++) {
        target = TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::Funcs::InternalSerialize(6, items[static_cast<ptrdiff_t>(i)].second->first, items[static_cast<ptrdiff_t>(i)].second->second, target, stream);
      }
    } else {
      for (::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::mediapipe::LabelMapItem >::const_iterator
          it = this->_internal_label_items().begin();
          it != this->_internal_label_items().end(); ++it) {
        target = TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::Funcs::InternalSerialize(6, it->first, it->second, target, stream);
      }
    }
  }

  // repeated int32 ignore_classes = 7 [packed = true];
  {
    int byte_size = _ignore_classes_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          7, _internal_ignore_classes(), byte_size, target);
    }
  }

  // repeated int32 allow_classes = 8 [packed = true];
  {
    int byte_size = _allow_classes_cached_byte_size_.load(std::memory_order_relaxed);
    if (byte_size > 0) {
      target = stream->WriteInt32Packed(
          8, _internal_allow_classes(), byte_size, target);
    }
  }

  // optional bool sort_by_descending_score = 9;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->_internal_sort_by_descending_score(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = ::PROTOBUF_NAMESPACE_ID::internal::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:mediapipe.TensorsToClassificationCalculatorOptions)
  return target;
}

size_t TensorsToClassificationCalculatorOptions::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:mediapipe.TensorsToClassificationCalculatorOptions)
  size_t total_size = 0;

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

  // map<int64, .mediapipe.LabelMapItem> label_items = 6;
  total_size += 1 *
      ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_label_items_size());
  for (::PROTOBUF_NAMESPACE_ID::Map< int64_t, ::mediapipe::LabelMapItem >::const_iterator
      it = this->_internal_label_items().begin();
      it != this->_internal_label_items().end(); ++it) {
    total_size += TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  }

  // repeated int32 ignore_classes = 7 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->ignore_classes_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _ignore_classes_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  // repeated int32 allow_classes = 8 [packed = true];
  {
    size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
      Int32Size(this->allow_classes_);
    if (data_size > 0) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size(
            static_cast<int32_t>(data_size));
    }
    int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size);
    _allow_classes_cached_byte_size_.store(cached_size,
                                    std::memory_order_relaxed);
    total_size += data_size;
  }

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    // optional string label_map_path = 3;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_label_map_path());
    }

    // optional .mediapipe.TensorsToClassificationCalculatorOptions.LabelMap label_map = 5;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
          *label_map_);
    }

    // optional float min_score_threshold = 1;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 + 4;
    }

    // optional int32 top_k = 2;
    if (cached_has_bits & 0x00000008u) {
      total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_top_k());
    }

    // optional bool sort_by_descending_score = 9;
    if (cached_has_bits & 0x00000010u) {
      total_size += 1 + 1;
    }

    // optional bool binary_classification = 4;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 + 1;
    }

  }
  return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

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

void TensorsToClassificationCalculatorOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
                      const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  static_cast<TensorsToClassificationCalculatorOptions *>(to)->MergeFrom(
      static_cast<const TensorsToClassificationCalculatorOptions &>(from));
}


void TensorsToClassificationCalculatorOptions::MergeFrom(const TensorsToClassificationCalculatorOptions& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:mediapipe.TensorsToClassificationCalculatorOptions)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  label_items_.MergeFrom(from.label_items_);
  ignore_classes_.MergeFrom(from.ignore_classes_);
  allow_classes_.MergeFrom(from.allow_classes_);
  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x0000003fu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_label_map_path(from._internal_label_map_path());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_mutable_label_map()->::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap::MergeFrom(from._internal_label_map());
    }
    if (cached_has_bits & 0x00000004u) {
      min_score_threshold_ = from.min_score_threshold_;
    }
    if (cached_has_bits & 0x00000008u) {
      top_k_ = from.top_k_;
    }
    if (cached_has_bits & 0x00000010u) {
      sort_by_descending_score_ = from.sort_by_descending_score_;
    }
    if (cached_has_bits & 0x00000020u) {
      binary_classification_ = from.binary_classification_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

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

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

void TensorsToClassificationCalculatorOptions::InternalSwap(TensorsToClassificationCalculatorOptions* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  label_items_.InternalSwap(&other->label_items_);
  ignore_classes_.InternalSwap(&other->ignore_classes_);
  allow_classes_.InternalSwap(&other->allow_classes_);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      &label_map_path_, lhs_arena,
      &other->label_map_path_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(TensorsToClassificationCalculatorOptions, binary_classification_)
      + sizeof(TensorsToClassificationCalculatorOptions::binary_classification_)
      - PROTOBUF_FIELD_OFFSET(TensorsToClassificationCalculatorOptions, label_map_)>(
          reinterpret_cast<char*>(&label_map_),
          reinterpret_cast<char*>(&other->label_map_));
}

::PROTOBUF_NAMESPACE_ID::Metadata TensorsToClassificationCalculatorOptions::GetMetadata() const {
  return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
      &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_getter, &descriptor_table_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto_once,
      file_level_metadata_mediapipe_2fcalculators_2ftensor_2ftensors_5fto_5fclassification_5fcalculator_2eproto[3]);
}
#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)
const int TensorsToClassificationCalculatorOptions::kExtFieldNumber;
#endif
PROTOBUF_ATTRIBUTE_INIT_PRIORITY ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::mediapipe::CalculatorOptions,
    ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::mediapipe::TensorsToClassificationCalculatorOptions >, 11, false >
  TensorsToClassificationCalculatorOptions::ext(kExtFieldNumber, ::mediapipe::TensorsToClassificationCalculatorOptions::default_instance());

// @@protoc_insertion_point(namespace_scope)
}  // namespace mediapipe
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry* Arena::CreateMaybeMessage< ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry >(Arena* arena) {
  return Arena::CreateMessageInternal< ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap_Entry >(arena);
}
template<> PROTOBUF_NOINLINE ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap* Arena::CreateMaybeMessage< ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap >(Arena* arena) {
  return Arena::CreateMessageInternal< ::mediapipe::TensorsToClassificationCalculatorOptions_LabelMap >(arena);
}
template<> PROTOBUF_NOINLINE ::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse* Arena::CreateMaybeMessage< ::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse >(Arena* arena) {
  return Arena::CreateMessageInternal< ::mediapipe::TensorsToClassificationCalculatorOptions_LabelItemsEntry_DoNotUse >(arena);
}
template<> PROTOBUF_NOINLINE ::mediapipe::TensorsToClassificationCalculatorOptions* Arena::CreateMaybeMessage< ::mediapipe::TensorsToClassificationCalculatorOptions >(Arena* arena) {
  return Arena::CreateMessageInternal< ::mediapipe::TensorsToClassificationCalculatorOptions >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

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