File non_max_suppression_calculator.pb.cc
File List > calculators > util > non_max_suppression_calculator.pb.cc
Go to the documentation of this file
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mediapipe/calculators/util/non_max_suppression_calculator.proto
#include "mediapipe/calculators/util/non_max_suppression_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 NonMaxSuppressionCalculatorOptions::NonMaxSuppressionCalculatorOptions(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: return_empty_detections_(false)
, algorithm_(0)
, min_score_threshold_(-1)
, num_detection_streams_(1)
, max_num_detections_(-1)
, min_suppression_threshold_(1)
, overlap_type_(1)
{}
struct NonMaxSuppressionCalculatorOptionsDefaultTypeInternal {
constexpr NonMaxSuppressionCalculatorOptionsDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~NonMaxSuppressionCalculatorOptionsDefaultTypeInternal() {}
union {
NonMaxSuppressionCalculatorOptions _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT NonMaxSuppressionCalculatorOptionsDefaultTypeInternal _NonMaxSuppressionCalculatorOptions_default_instance_;
} // namespace mediapipe
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto[1];
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto[2];
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto = nullptr;
const uint32_t TableStruct_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, _has_bits_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, num_detection_streams_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, max_num_detections_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, min_score_threshold_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, min_suppression_threshold_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, overlap_type_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, return_empty_detections_),
PROTOBUF_FIELD_OFFSET(::mediapipe::NonMaxSuppressionCalculatorOptions, algorithm_),
3,
4,
2,
5,
6,
0,
1,
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, 13, -1, sizeof(::mediapipe::NonMaxSuppressionCalculatorOptions)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::mediapipe::_NonMaxSuppressionCalculatorOptions_default_instance_),
};
const char descriptor_table_protodef_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\?mediapipe/calculators/util/non_max_sup"
"pression_calculator.proto\022\tmediapipe\032$me"
"diapipe/framework/calculator.proto\"\365\004\n\"N"
"onMaxSuppressionCalculatorOptions\022 \n\025num"
"_detection_streams\030\001 \001(\005:\0011\022\036\n\022max_num_d"
"etections\030\002 \001(\005:\002-1\022\037\n\023min_score_thresho"
"ld\030\006 \001(\002:\002-1\022$\n\031min_suppression_threshol"
"d\030\003 \001(\002:\0011\022X\n\014overlap_type\030\004 \001(\01629.media"
"pipe.NonMaxSuppressionCalculatorOptions."
"OverlapType:\007JACCARD\022\037\n\027return_empty_det"
"ections\030\005 \001(\010\022V\n\talgorithm\030\007 \001(\0162:.media"
"pipe.NonMaxSuppressionCalculatorOptions."
"NmsAlgorithm:\007DEFAULT\"k\n\013OverlapType\022\034\n\030"
"UNSPECIFIED_OVERLAP_TYPE\020\000\022\013\n\007JACCARD\020\001\022"
"\024\n\020MODIFIED_JACCARD\020\002\022\033\n\027INTERSECTION_OV"
"ER_UNION\020\003\")\n\014NmsAlgorithm\022\013\n\007DEFAULT\020\000\022"
"\014\n\010WEIGHTED\020\0012[\n\003ext\022\034.mediapipe.Calcula"
"torOptions\030\274\250\264\032 \001(\0132-.mediapipe.NonMaxSu"
"ppressionCalculatorOptions"
;
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_deps[1] = {
&::descriptor_table_mediapipe_2fframework_2fcalculator_2eproto,
};
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto = {
false, false, 746, descriptor_table_protodef_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto, "mediapipe/calculators/util/non_max_suppression_calculator.proto",
&descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_once, descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_deps, 1, 1,
schemas, file_default_instances, TableStruct_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto::offsets,
file_level_metadata_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto, file_level_enum_descriptors_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto, file_level_service_descriptors_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_getter() {
return &descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto;
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto(&descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto);
namespace mediapipe {
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NonMaxSuppressionCalculatorOptions_OverlapType_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto);
return file_level_enum_descriptors_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto[0];
}
bool NonMaxSuppressionCalculatorOptions_OverlapType_IsValid(int value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr NonMaxSuppressionCalculatorOptions_OverlapType NonMaxSuppressionCalculatorOptions::UNSPECIFIED_OVERLAP_TYPE;
constexpr NonMaxSuppressionCalculatorOptions_OverlapType NonMaxSuppressionCalculatorOptions::JACCARD;
constexpr NonMaxSuppressionCalculatorOptions_OverlapType NonMaxSuppressionCalculatorOptions::MODIFIED_JACCARD;
constexpr NonMaxSuppressionCalculatorOptions_OverlapType NonMaxSuppressionCalculatorOptions::INTERSECTION_OVER_UNION;
constexpr NonMaxSuppressionCalculatorOptions_OverlapType NonMaxSuppressionCalculatorOptions::OverlapType_MIN;
constexpr NonMaxSuppressionCalculatorOptions_OverlapType NonMaxSuppressionCalculatorOptions::OverlapType_MAX;
constexpr int NonMaxSuppressionCalculatorOptions::OverlapType_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* NonMaxSuppressionCalculatorOptions_NmsAlgorithm_descriptor() {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto);
return file_level_enum_descriptors_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto[1];
}
bool NonMaxSuppressionCalculatorOptions_NmsAlgorithm_IsValid(int value) {
switch (value) {
case 0:
case 1:
return true;
default:
return false;
}
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr NonMaxSuppressionCalculatorOptions_NmsAlgorithm NonMaxSuppressionCalculatorOptions::DEFAULT;
constexpr NonMaxSuppressionCalculatorOptions_NmsAlgorithm NonMaxSuppressionCalculatorOptions::WEIGHTED;
constexpr NonMaxSuppressionCalculatorOptions_NmsAlgorithm NonMaxSuppressionCalculatorOptions::NmsAlgorithm_MIN;
constexpr NonMaxSuppressionCalculatorOptions_NmsAlgorithm NonMaxSuppressionCalculatorOptions::NmsAlgorithm_MAX;
constexpr int NonMaxSuppressionCalculatorOptions::NmsAlgorithm_ARRAYSIZE;
#endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
// ===================================================================
class NonMaxSuppressionCalculatorOptions::_Internal {
public:
using HasBits = decltype(std::declval<NonMaxSuppressionCalculatorOptions>()._has_bits_);
static void set_has_num_detection_streams(HasBits* has_bits) {
(*has_bits)[0] |= 8u;
}
static void set_has_max_num_detections(HasBits* has_bits) {
(*has_bits)[0] |= 16u;
}
static void set_has_min_score_threshold(HasBits* has_bits) {
(*has_bits)[0] |= 4u;
}
static void set_has_min_suppression_threshold(HasBits* has_bits) {
(*has_bits)[0] |= 32u;
}
static void set_has_overlap_type(HasBits* has_bits) {
(*has_bits)[0] |= 64u;
}
static void set_has_return_empty_detections(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
static void set_has_algorithm(HasBits* has_bits) {
(*has_bits)[0] |= 2u;
}
};
NonMaxSuppressionCalculatorOptions::NonMaxSuppressionCalculatorOptions(::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.NonMaxSuppressionCalculatorOptions)
}
NonMaxSuppressionCalculatorOptions::NonMaxSuppressionCalculatorOptions(const NonMaxSuppressionCalculatorOptions& from)
: ::PROTOBUF_NAMESPACE_ID::Message(),
_has_bits_(from._has_bits_) {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::memcpy(&return_empty_detections_, &from.return_empty_detections_,
static_cast<size_t>(reinterpret_cast<char*>(&overlap_type_) -
reinterpret_cast<char*>(&return_empty_detections_)) + sizeof(overlap_type_));
// @@protoc_insertion_point(copy_constructor:mediapipe.NonMaxSuppressionCalculatorOptions)
}
inline void NonMaxSuppressionCalculatorOptions::SharedCtor() {
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
reinterpret_cast<char*>(&return_empty_detections_) - reinterpret_cast<char*>(this)),
0, static_cast<size_t>(reinterpret_cast<char*>(&algorithm_) -
reinterpret_cast<char*>(&return_empty_detections_)) + sizeof(algorithm_));
min_score_threshold_ = -1;
num_detection_streams_ = 1;
max_num_detections_ = -1;
min_suppression_threshold_ = 1;
overlap_type_ = 1;
}
NonMaxSuppressionCalculatorOptions::~NonMaxSuppressionCalculatorOptions() {
// @@protoc_insertion_point(destructor:mediapipe.NonMaxSuppressionCalculatorOptions)
if (GetArenaForAllocation() != nullptr) return;
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
inline void NonMaxSuppressionCalculatorOptions::SharedDtor() {
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
}
void NonMaxSuppressionCalculatorOptions::ArenaDtor(void* object) {
NonMaxSuppressionCalculatorOptions* _this = reinterpret_cast< NonMaxSuppressionCalculatorOptions* >(object);
(void)_this;
}
void NonMaxSuppressionCalculatorOptions::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void NonMaxSuppressionCalculatorOptions::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void NonMaxSuppressionCalculatorOptions::Clear() {
// @@protoc_insertion_point(message_clear_start:mediapipe.NonMaxSuppressionCalculatorOptions)
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 & 0x0000007fu) {
::memset(&return_empty_detections_, 0, static_cast<size_t>(
reinterpret_cast<char*>(&algorithm_) -
reinterpret_cast<char*>(&return_empty_detections_)) + sizeof(algorithm_));
min_score_threshold_ = -1;
num_detection_streams_ = 1;
max_num_detections_ = -1;
min_suppression_threshold_ = 1;
overlap_type_ = 1;
}
_has_bits_.Clear();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* NonMaxSuppressionCalculatorOptions::_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 num_detection_streams = 1 [default = 1];
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
_Internal::set_has_num_detection_streams(&has_bits);
num_detection_streams_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional int32 max_num_detections = 2 [default = -1];
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
_Internal::set_has_max_num_detections(&has_bits);
max_num_detections_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional float min_suppression_threshold = 3 [default = 1];
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 29)) {
_Internal::set_has_min_suppression_threshold(&has_bits);
min_suppression_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
ptr += sizeof(float);
} else
goto handle_unusual;
continue;
// optional .mediapipe.NonMaxSuppressionCalculatorOptions.OverlapType overlap_type = 4 [default = JACCARD];
case 4:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::mediapipe::NonMaxSuppressionCalculatorOptions_OverlapType_IsValid(val))) {
_internal_set_overlap_type(static_cast<::mediapipe::NonMaxSuppressionCalculatorOptions_OverlapType>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
}
} else
goto handle_unusual;
continue;
// optional bool return_empty_detections = 5;
case 5:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
_Internal::set_has_return_empty_detections(&has_bits);
return_empty_detections_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
} else
goto handle_unusual;
continue;
// optional float min_score_threshold = 6 [default = -1];
case 6:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 53)) {
_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 .mediapipe.NonMaxSuppressionCalculatorOptions.NmsAlgorithm algorithm = 7 [default = DEFAULT];
case 7:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
if (PROTOBUF_PREDICT_TRUE(::mediapipe::NonMaxSuppressionCalculatorOptions_NmsAlgorithm_IsValid(val))) {
_internal_set_algorithm(static_cast<::mediapipe::NonMaxSuppressionCalculatorOptions_NmsAlgorithm>(val));
} else {
::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
}
} 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* NonMaxSuppressionCalculatorOptions::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:mediapipe.NonMaxSuppressionCalculatorOptions)
uint32_t cached_has_bits = 0;
(void) cached_has_bits;
cached_has_bits = _has_bits_[0];
// optional int32 num_detection_streams = 1 [default = 1];
if (cached_has_bits & 0x00000008u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_num_detection_streams(), target);
}
// optional int32 max_num_detections = 2 [default = -1];
if (cached_has_bits & 0x00000010u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_max_num_detections(), target);
}
// optional float min_suppression_threshold = 3 [default = 1];
if (cached_has_bits & 0x00000020u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(3, this->_internal_min_suppression_threshold(), target);
}
// optional .mediapipe.NonMaxSuppressionCalculatorOptions.OverlapType overlap_type = 4 [default = JACCARD];
if (cached_has_bits & 0x00000040u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
4, this->_internal_overlap_type(), target);
}
// optional bool return_empty_detections = 5;
if (cached_has_bits & 0x00000001u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_return_empty_detections(), target);
}
// optional float min_score_threshold = 6 [default = -1];
if (cached_has_bits & 0x00000004u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteFloatToArray(6, this->_internal_min_score_threshold(), target);
}
// optional .mediapipe.NonMaxSuppressionCalculatorOptions.NmsAlgorithm algorithm = 7 [default = DEFAULT];
if (cached_has_bits & 0x00000002u) {
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
7, this->_internal_algorithm(), 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.NonMaxSuppressionCalculatorOptions)
return target;
}
size_t NonMaxSuppressionCalculatorOptions::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:mediapipe.NonMaxSuppressionCalculatorOptions)
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 & 0x0000007fu) {
// optional bool return_empty_detections = 5;
if (cached_has_bits & 0x00000001u) {
total_size += 1 + 1;
}
// optional .mediapipe.NonMaxSuppressionCalculatorOptions.NmsAlgorithm algorithm = 7 [default = DEFAULT];
if (cached_has_bits & 0x00000002u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_algorithm());
}
// optional float min_score_threshold = 6 [default = -1];
if (cached_has_bits & 0x00000004u) {
total_size += 1 + 4;
}
// optional int32 num_detection_streams = 1 [default = 1];
if (cached_has_bits & 0x00000008u) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_num_detection_streams());
}
// optional int32 max_num_detections = 2 [default = -1];
if (cached_has_bits & 0x00000010u) {
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32SizePlusOne(this->_internal_max_num_detections());
}
// optional float min_suppression_threshold = 3 [default = 1];
if (cached_has_bits & 0x00000020u) {
total_size += 1 + 4;
}
// optional .mediapipe.NonMaxSuppressionCalculatorOptions.OverlapType overlap_type = 4 [default = JACCARD];
if (cached_has_bits & 0x00000040u) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_overlap_type());
}
}
return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData NonMaxSuppressionCalculatorOptions::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
NonMaxSuppressionCalculatorOptions::MergeImpl
};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*NonMaxSuppressionCalculatorOptions::GetClassData() const { return &_class_data_; }
void NonMaxSuppressionCalculatorOptions::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to,
const ::PROTOBUF_NAMESPACE_ID::Message& from) {
static_cast<NonMaxSuppressionCalculatorOptions *>(to)->MergeFrom(
static_cast<const NonMaxSuppressionCalculatorOptions &>(from));
}
void NonMaxSuppressionCalculatorOptions::MergeFrom(const NonMaxSuppressionCalculatorOptions& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:mediapipe.NonMaxSuppressionCalculatorOptions)
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 & 0x0000007fu) {
if (cached_has_bits & 0x00000001u) {
return_empty_detections_ = from.return_empty_detections_;
}
if (cached_has_bits & 0x00000002u) {
algorithm_ = from.algorithm_;
}
if (cached_has_bits & 0x00000004u) {
min_score_threshold_ = from.min_score_threshold_;
}
if (cached_has_bits & 0x00000008u) {
num_detection_streams_ = from.num_detection_streams_;
}
if (cached_has_bits & 0x00000010u) {
max_num_detections_ = from.max_num_detections_;
}
if (cached_has_bits & 0x00000020u) {
min_suppression_threshold_ = from.min_suppression_threshold_;
}
if (cached_has_bits & 0x00000040u) {
overlap_type_ = from.overlap_type_;
}
_has_bits_[0] |= cached_has_bits;
}
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
void NonMaxSuppressionCalculatorOptions::CopyFrom(const NonMaxSuppressionCalculatorOptions& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:mediapipe.NonMaxSuppressionCalculatorOptions)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool NonMaxSuppressionCalculatorOptions::IsInitialized() const {
return true;
}
void NonMaxSuppressionCalculatorOptions::InternalSwap(NonMaxSuppressionCalculatorOptions* other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_has_bits_[0], other->_has_bits_[0]);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(NonMaxSuppressionCalculatorOptions, algorithm_)
+ sizeof(NonMaxSuppressionCalculatorOptions::algorithm_)
- PROTOBUF_FIELD_OFFSET(NonMaxSuppressionCalculatorOptions, return_empty_detections_)>(
reinterpret_cast<char*>(&return_empty_detections_),
reinterpret_cast<char*>(&other->return_empty_detections_));
swap(min_score_threshold_, other->min_score_threshold_);
swap(num_detection_streams_, other->num_detection_streams_);
swap(max_num_detections_, other->max_num_detections_);
swap(min_suppression_threshold_, other->min_suppression_threshold_);
swap(overlap_type_, other->overlap_type_);
}
::PROTOBUF_NAMESPACE_ID::Metadata NonMaxSuppressionCalculatorOptions::GetMetadata() const {
return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
&descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_getter, &descriptor_table_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto_once,
file_level_metadata_mediapipe_2fcalculators_2futil_2fnon_5fmax_5fsuppression_5fcalculator_2eproto[0]);
}
#if !defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912)
const int NonMaxSuppressionCalculatorOptions::kExtFieldNumber;
#endif
PROTOBUF_ATTRIBUTE_INIT_PRIORITY ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::mediapipe::CalculatorOptions,
::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::mediapipe::NonMaxSuppressionCalculatorOptions >, 11, false >
NonMaxSuppressionCalculatorOptions::ext(kExtFieldNumber, ::mediapipe::NonMaxSuppressionCalculatorOptions::default_instance());
// @@protoc_insertion_point(namespace_scope)
} // namespace mediapipe
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::mediapipe::NonMaxSuppressionCalculatorOptions* Arena::CreateMaybeMessage< ::mediapipe::NonMaxSuppressionCalculatorOptions >(Arena* arena) {
return Arena::CreateMessageInternal< ::mediapipe::NonMaxSuppressionCalculatorOptions >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>