tesseract v5.3.3.20231005
tfnetwork.pb.cc
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: tfnetwork.proto
3
4#include "tfnetwork.pb.h"
5
6#include <algorithm>
7
8#include <google/protobuf/descriptor.h>
9#include <google/protobuf/generated_message_reflection.h>
10#include <google/protobuf/io/coded_stream.h>
11#include <google/protobuf/reflection_ops.h>
12#include <google/protobuf/stubs/common.h>
13#include <google/protobuf/stubs/port.h>
14#include <google/protobuf/wire_format.h>
15#include <google/protobuf/wire_format_lite_inl.h>
16// This is a temporary google only hack
17#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
18# include "third_party/protobuf/version.h"
19#endif
20// @@protoc_insertion_point(includes)
21
23extern PROTOBUF_INTERNAL_EXPORT_protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto ::google::
24 protobuf::internal::SCCInfo<3>
26} // namespace protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto
27namespace tesseract {
29public:
30 ::google::protobuf::internal::ExplicitlyConstructed<TFNetworkModel> _instance;
32} // namespace tesseract
34static void InitDefaultsTFNetworkModel() {
35 GOOGLE_PROTOBUF_VERIFY_VERSION;
36
37 {
40 ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
41 }
43}
44
45::google::protobuf::internal::SCCInfo<1> scc_info_TFNetworkModel = {
46 {ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1,
47 InitDefaultsTFNetworkModel},
48 {
50 }};
51
53 ::google::protobuf::internal::InitSCC(&scc_info_TFNetworkModel.base);
54}
55
56::google::protobuf::Metadata file_level_metadata[1];
57
59 protodesc_cold) = {
60 ~0u, // no _has_bits_
61 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel,
62 _internal_metadata_),
63 ~0u, // no _extensions_
64 ~0u, // no _oneof_case_
65 ~0u, // no _weak_field_map_
66 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, graph_),
67 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, global_step_),
68 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, spec_),
69 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, depth_),
70 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, x_size_),
71 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, y_size_),
72 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, batch_size_),
73 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, num_classes_),
74 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, using_ctc_),
75 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_input_),
76 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_widths_),
77 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, image_heights_),
78 GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tesseract::TFNetworkModel, output_layer_),
79};
80static const ::google::protobuf::internal::MigrationSchema
81 schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
82 {0, -1, sizeof(::tesseract::TFNetworkModel)},
83};
84
85static ::google::protobuf::Message const *const file_default_instances[] = {
86 reinterpret_cast<const ::google::protobuf::Message *>(
88};
89
92 AssignDescriptors("tfnetwork.proto", schemas, file_default_instances, TableStruct::offsets,
93 file_level_metadata, NULL, NULL);
94}
95
97 static ::google::protobuf::internal::once_flag once;
98 ::google::protobuf::internal::call_once(once, protobuf_AssignDescriptors);
99}
100
101void protobuf_RegisterTypes(const ::std::string &) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
102void protobuf_RegisterTypes(const ::std::string &) {
104 ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 1);
105}
106
108 InitDefaults();
109 static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
110 "\n\017tfnetwork.proto\022\ttesseract\032%tensorflow"
111 "/core/framework/graph.proto\"\233\002\n\016TFNetwor"
112 "kModel\022#\n\005graph\030\001 \001(\0132\024.tensorflow.Graph"
113 "Def\022\023\n\013global_step\030\002 \001(\003\022\014\n\004spec\030\003 \001(\t\022\r"
114 "\n\005depth\030\004 \001(\005\022\016\n\006x_size\030\005 \001(\005\022\016\n\006y_size\030"
115 "\006 \001(\005\022\022\n\nbatch_size\030\010 \001(\005\022\023\n\013num_classes"
116 "\030\t \001(\005\022\021\n\tusing_ctc\030\n \001(\010\022\023\n\013image_input"
117 "\030\013 \001(\t\022\024\n\014image_widths\030\014 \001(\t\022\025\n\rimage_he"
118 "ights\030\r \001(\t\022\024\n\014output_layer\030\016 \001(\tb\006proto"
119 "3"};
120 ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(descriptor, 361);
121 ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile("tfnetwork.proto",
124}
125
127 static ::google::protobuf::internal::once_flag once;
128 ::google::protobuf::internal::call_once(once, AddDescriptorsImpl);
129}
130// Force AddDescriptors() to be called at dynamic initialization time.
134 }
136} // namespace protobuf_tfnetwork_2eproto
137namespace tesseract {
138
139// ===================================================================
140
143 const_cast<::tensorflow::GraphDef *>(::tensorflow::GraphDef::internal_default_instance());
144}
146 if (GetArenaNoVirtual() == NULL && graph_ != NULL) {
147 delete graph_;
148 }
149 graph_ = NULL;
150}
151#if !defined(_MSC_VER) || _MSC_VER >= 1900
165#endif // !defined(_MSC_VER) || _MSC_VER >= 1900
166
167TFNetworkModel::TFNetworkModel() : ::google::protobuf::Message(), _internal_metadata_(NULL) {
168 ::google::protobuf::internal::InitSCC(&protobuf_tfnetwork_2eproto::scc_info_TFNetworkModel.base);
169 SharedCtor();
170 // @@protoc_insertion_point(constructor:tesseract.TFNetworkModel)
171}
173 : ::google::protobuf::Message(), _internal_metadata_(NULL) {
174 _internal_metadata_.MergeFrom(from._internal_metadata_);
175 spec_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
176 if (from.spec().size() > 0) {
177 spec_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
178 from.spec_);
179 }
180 image_input_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
181 if (from.image_input().size() > 0) {
182 image_input_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
183 from.image_input_);
184 }
185 image_widths_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
186 if (from.image_widths().size() > 0) {
187 image_widths_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
188 from.image_widths_);
189 }
190 image_heights_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
191 if (from.image_heights().size() > 0) {
192 image_heights_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
193 from.image_heights_);
194 }
195 output_layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
196 if (from.output_layer().size() > 0) {
197 output_layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
198 from.output_layer_);
199 }
200 if (from.has_graph()) {
201 graph_ = new ::tensorflow::GraphDef(*from.graph_);
202 } else {
203 graph_ = NULL;
204 }
205 ::memcpy(&global_step_, &from.global_step_,
206 static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
207 reinterpret_cast<char *>(&global_step_)) +
208 sizeof(using_ctc_));
209 // @@protoc_insertion_point(copy_constructor:tesseract.TFNetworkModel)
210}
211
212void TFNetworkModel::SharedCtor() {
213 spec_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
214 image_input_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
215 image_widths_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
216 image_heights_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
217 output_layer_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
218 ::memset(&graph_, 0,
219 static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
220 reinterpret_cast<char *>(&graph_)) +
221 sizeof(using_ctc_));
222}
223
225 // @@protoc_insertion_point(destructor:tesseract.TFNetworkModel)
226 SharedDtor();
227}
228
229void TFNetworkModel::SharedDtor() {
230 spec_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
231 image_input_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
232 image_widths_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
233 image_heights_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
234 output_layer_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
235 if (this != internal_default_instance())
236 delete graph_;
237}
238
239void TFNetworkModel::SetCachedSize(int size) const {
240 _cached_size_.Set(size);
241}
242const ::google::protobuf::Descriptor *TFNetworkModel::descriptor() {
245}
246
248 ::google::protobuf::internal::InitSCC(&protobuf_tfnetwork_2eproto::scc_info_TFNetworkModel.base);
250}
251
253 // @@protoc_insertion_point(message_clear_start:tesseract.TFNetworkModel)
254 ::google::protobuf::uint32 cached_has_bits = 0;
255 // Prevent compiler warnings about cached_has_bits being unused
256 (void)cached_has_bits;
257
258 spec_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
259 image_input_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
260 image_widths_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
261 image_heights_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
262 output_layer_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
263 if (GetArenaNoVirtual() == NULL && graph_ != NULL) {
264 delete graph_;
265 }
266 graph_ = NULL;
267 ::memset(&global_step_, 0,
268 static_cast<size_t>(reinterpret_cast<char *>(&using_ctc_) -
269 reinterpret_cast<char *>(&global_step_)) +
270 sizeof(using_ctc_));
271 _internal_metadata_.Clear();
272}
273
274bool TFNetworkModel::MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream *input) {
275#define DO_(EXPRESSION) \
276 if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) \
277 goto failure
278 ::google::protobuf::uint32 tag;
279 // @@protoc_insertion_point(parse_start:tesseract.TFNetworkModel)
280 for (;;) {
281 ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
282 tag = p.first;
283 if (!p.second)
284 goto handle_unusual;
285 switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
286 // .tensorflow.GraphDef graph = 1;
287 case 1: {
288 if (static_cast<::google::protobuf::uint8>(tag) ==
289 static_cast<::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
290 DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(input, mutable_graph()));
291 } else {
292 goto handle_unusual;
293 }
294 break;
295 }
296
297 // int64 global_step = 2;
298 case 2: {
299 if (static_cast<::google::protobuf::uint8>(tag) ==
300 static_cast<::google::protobuf::uint8>(16u /* 16 & 0xFF */)) {
301 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
302 ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>(
303 input, &global_step_)));
304 } else {
305 goto handle_unusual;
306 }
307 break;
308 }
309
310 // string spec = 3;
311 case 3: {
312 if (static_cast<::google::protobuf::uint8>(tag) ==
313 static_cast<::google::protobuf::uint8>(26u /* 26 & 0xFF */)) {
314 DO_(::google::protobuf::internal::WireFormatLite::ReadString(input,
315 this->mutable_spec()));
316 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
317 this->spec().data(), static_cast<int>(this->spec().length()),
318 ::google::protobuf::internal::WireFormatLite::PARSE,
319 "tesseract.TFNetworkModel.spec"));
320 } else {
321 goto handle_unusual;
322 }
323 break;
324 }
325
326 // int32 depth = 4;
327 case 4: {
328 if (static_cast<::google::protobuf::uint8>(tag) ==
329 static_cast<::google::protobuf::uint8>(32u /* 32 & 0xFF */)) {
330 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
331 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
332 input, &depth_)));
333 } else {
334 goto handle_unusual;
335 }
336 break;
337 }
338
339 // int32 x_size = 5;
340 case 5: {
341 if (static_cast<::google::protobuf::uint8>(tag) ==
342 static_cast<::google::protobuf::uint8>(40u /* 40 & 0xFF */)) {
343 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
344 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
345 input, &x_size_)));
346 } else {
347 goto handle_unusual;
348 }
349 break;
350 }
351
352 // int32 y_size = 6;
353 case 6: {
354 if (static_cast<::google::protobuf::uint8>(tag) ==
355 static_cast<::google::protobuf::uint8>(48u /* 48 & 0xFF */)) {
356 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
357 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
358 input, &y_size_)));
359 } else {
360 goto handle_unusual;
361 }
362 break;
363 }
364
365 // int32 batch_size = 8;
366 case 8: {
367 if (static_cast<::google::protobuf::uint8>(tag) ==
368 static_cast<::google::protobuf::uint8>(64u /* 64 & 0xFF */)) {
369 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
370 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
371 input, &batch_size_)));
372 } else {
373 goto handle_unusual;
374 }
375 break;
376 }
377
378 // int32 num_classes = 9;
379 case 9: {
380 if (static_cast<::google::protobuf::uint8>(tag) ==
381 static_cast<::google::protobuf::uint8>(72u /* 72 & 0xFF */)) {
382 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
383 ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
384 input, &num_classes_)));
385 } else {
386 goto handle_unusual;
387 }
388 break;
389 }
390
391 // bool using_ctc = 10;
392 case 10: {
393 if (static_cast<::google::protobuf::uint8>(tag) ==
394 static_cast<::google::protobuf::uint8>(80u /* 80 & 0xFF */)) {
395 DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
396 bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(input, &using_ctc_)));
397 } else {
398 goto handle_unusual;
399 }
400 break;
401 }
402
403 // string image_input = 11;
404 case 11: {
405 if (static_cast<::google::protobuf::uint8>(tag) ==
406 static_cast<::google::protobuf::uint8>(90u /* 90 & 0xFF */)) {
407 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
408 input, this->mutable_image_input()));
409 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
410 this->image_input().data(), static_cast<int>(this->image_input().length()),
411 ::google::protobuf::internal::WireFormatLite::PARSE,
412 "tesseract.TFNetworkModel.image_input"));
413 } else {
414 goto handle_unusual;
415 }
416 break;
417 }
418
419 // string image_widths = 12;
420 case 12: {
421 if (static_cast<::google::protobuf::uint8>(tag) ==
422 static_cast<::google::protobuf::uint8>(98u /* 98 & 0xFF */)) {
423 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
424 input, this->mutable_image_widths()));
425 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
426 this->image_widths().data(), static_cast<int>(this->image_widths().length()),
427 ::google::protobuf::internal::WireFormatLite::PARSE,
428 "tesseract.TFNetworkModel.image_widths"));
429 } else {
430 goto handle_unusual;
431 }
432 break;
433 }
434
435 // string image_heights = 13;
436 case 13: {
437 if (static_cast<::google::protobuf::uint8>(tag) ==
438 static_cast<::google::protobuf::uint8>(106u /* 106 & 0xFF */)) {
439 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
440 input, this->mutable_image_heights()));
441 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
442 this->image_heights().data(), static_cast<int>(this->image_heights().length()),
443 ::google::protobuf::internal::WireFormatLite::PARSE,
444 "tesseract.TFNetworkModel.image_heights"));
445 } else {
446 goto handle_unusual;
447 }
448 break;
449 }
450
451 // string output_layer = 14;
452 case 14: {
453 if (static_cast<::google::protobuf::uint8>(tag) ==
454 static_cast<::google::protobuf::uint8>(114u /* 114 & 0xFF */)) {
455 DO_(::google::protobuf::internal::WireFormatLite::ReadString(
456 input, this->mutable_output_layer()));
457 DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
458 this->output_layer().data(), static_cast<int>(this->output_layer().length()),
459 ::google::protobuf::internal::WireFormatLite::PARSE,
460 "tesseract.TFNetworkModel.output_layer"));
461 } else {
462 goto handle_unusual;
463 }
464 break;
465 }
466
467 default: {
468 handle_unusual:
469 if (tag == 0) {
470 goto success;
471 }
472 DO_(::google::protobuf::internal::WireFormat::SkipField(
473 input, tag, _internal_metadata_.mutable_unknown_fields()));
474 break;
475 }
476 }
477 }
478success:
479 // @@protoc_insertion_point(parse_success:tesseract.TFNetworkModel)
480 return true;
481failure:
482 // @@protoc_insertion_point(parse_failure:tesseract.TFNetworkModel)
483 return false;
484#undef DO_
485}
486
488 ::google::protobuf::io::CodedOutputStream *output) const {
489 // @@protoc_insertion_point(serialize_start:tesseract.TFNetworkModel)
490 ::google::protobuf::uint32 cached_has_bits = 0;
491 (void)cached_has_bits;
492
493 // .tensorflow.GraphDef graph = 1;
494 if (this->has_graph()) {
495 ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
496 1, this->_internal_graph(), output);
497 }
498
499 // int64 global_step = 2;
500 if (this->global_step() != 0) {
501 ::google::protobuf::internal::WireFormatLite::WriteInt64(2, this->global_step(), output);
502 }
503
504 // string spec = 3;
505 if (this->spec().size() > 0) {
506 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
507 this->spec().data(), static_cast<int>(this->spec().length()),
508 ::google::protobuf::internal::WireFormatLite::SERIALIZE, "tesseract.TFNetworkModel.spec");
509 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(3, this->spec(), output);
510 }
511
512 // int32 depth = 4;
513 if (this->depth() != 0) {
514 ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->depth(), output);
515 }
516
517 // int32 x_size = 5;
518 if (this->x_size() != 0) {
519 ::google::protobuf::internal::WireFormatLite::WriteInt32(5, this->x_size(), output);
520 }
521
522 // int32 y_size = 6;
523 if (this->y_size() != 0) {
524 ::google::protobuf::internal::WireFormatLite::WriteInt32(6, this->y_size(), output);
525 }
526
527 // int32 batch_size = 8;
528 if (this->batch_size() != 0) {
529 ::google::protobuf::internal::WireFormatLite::WriteInt32(8, this->batch_size(), output);
530 }
531
532 // int32 num_classes = 9;
533 if (this->num_classes() != 0) {
534 ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->num_classes(), output);
535 }
536
537 // bool using_ctc = 10;
538 if (this->using_ctc() != 0) {
539 ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->using_ctc(), output);
540 }
541
542 // string image_input = 11;
543 if (this->image_input().size() > 0) {
544 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
545 this->image_input().data(), static_cast<int>(this->image_input().length()),
546 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
547 "tesseract.TFNetworkModel.image_input");
548 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(11, this->image_input(),
549 output);
550 }
551
552 // string image_widths = 12;
553 if (this->image_widths().size() > 0) {
554 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
555 this->image_widths().data(), static_cast<int>(this->image_widths().length()),
556 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
557 "tesseract.TFNetworkModel.image_widths");
558 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(12, this->image_widths(),
559 output);
560 }
561
562 // string image_heights = 13;
563 if (this->image_heights().size() > 0) {
564 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
565 this->image_heights().data(), static_cast<int>(this->image_heights().length()),
566 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
567 "tesseract.TFNetworkModel.image_heights");
568 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(13, this->image_heights(),
569 output);
570 }
571
572 // string output_layer = 14;
573 if (this->output_layer().size() > 0) {
574 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
575 this->output_layer().data(), static_cast<int>(this->output_layer().length()),
576 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
577 "tesseract.TFNetworkModel.output_layer");
578 ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(14, this->output_layer(),
579 output);
580 }
581
582 if ((_internal_metadata_.have_unknown_fields() &&
583 ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
584 ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
585 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
586 ? _internal_metadata_.unknown_fields()
587 : _internal_metadata_.default_instance()),
588 output);
589 }
590 // @@protoc_insertion_point(serialize_end:tesseract.TFNetworkModel)
591}
592
594 bool deterministic, ::google::protobuf::uint8 *target) const {
595 (void)deterministic; // Unused
596 // @@protoc_insertion_point(serialize_to_array_start:tesseract.TFNetworkModel)
597 ::google::protobuf::uint32 cached_has_bits = 0;
598 (void)cached_has_bits;
599
600 // .tensorflow.GraphDef graph = 1;
601 if (this->has_graph()) {
602 target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessageToArray(
603 1, this->_internal_graph(), deterministic, target);
604 }
605
606 // int64 global_step = 2;
607 if (this->global_step() != 0) {
608 target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(2, this->global_step(),
609 target);
610 }
611
612 // string spec = 3;
613 if (this->spec().size() > 0) {
614 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
615 this->spec().data(), static_cast<int>(this->spec().length()),
616 ::google::protobuf::internal::WireFormatLite::SERIALIZE, "tesseract.TFNetworkModel.spec");
617 target =
618 ::google::protobuf::internal::WireFormatLite::WriteStringToArray(3, this->spec(), target);
619 }
620
621 // int32 depth = 4;
622 if (this->depth() != 0) {
623 target =
624 ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->depth(), target);
625 }
626
627 // int32 x_size = 5;
628 if (this->x_size() != 0) {
629 target =
630 ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(5, this->x_size(), target);
631 }
632
633 // int32 y_size = 6;
634 if (this->y_size() != 0) {
635 target =
636 ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(6, this->y_size(), target);
637 }
638
639 // int32 batch_size = 8;
640 if (this->batch_size() != 0) {
641 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(8, this->batch_size(),
642 target);
643 }
644
645 // int32 num_classes = 9;
646 if (this->num_classes() != 0) {
647 target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->num_classes(),
648 target);
649 }
650
651 // bool using_ctc = 10;
652 if (this->using_ctc() != 0) {
653 target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->using_ctc(),
654 target);
655 }
656
657 // string image_input = 11;
658 if (this->image_input().size() > 0) {
659 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
660 this->image_input().data(), static_cast<int>(this->image_input().length()),
661 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
662 "tesseract.TFNetworkModel.image_input");
663 target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
664 11, this->image_input(), target);
665 }
666
667 // string image_widths = 12;
668 if (this->image_widths().size() > 0) {
669 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
670 this->image_widths().data(), static_cast<int>(this->image_widths().length()),
671 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
672 "tesseract.TFNetworkModel.image_widths");
673 target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
674 12, this->image_widths(), target);
675 }
676
677 // string image_heights = 13;
678 if (this->image_heights().size() > 0) {
679 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
680 this->image_heights().data(), static_cast<int>(this->image_heights().length()),
681 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
682 "tesseract.TFNetworkModel.image_heights");
683 target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
684 13, this->image_heights(), target);
685 }
686
687 // string output_layer = 14;
688 if (this->output_layer().size() > 0) {
689 ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
690 this->output_layer().data(), static_cast<int>(this->output_layer().length()),
691 ::google::protobuf::internal::WireFormatLite::SERIALIZE,
692 "tesseract.TFNetworkModel.output_layer");
693 target = ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
694 14, this->output_layer(), target);
695 }
696
697 if ((_internal_metadata_.have_unknown_fields() &&
698 ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
699 target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
700 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
701 ? _internal_metadata_.unknown_fields()
702 : _internal_metadata_.default_instance()),
703 target);
704 }
705 // @@protoc_insertion_point(serialize_to_array_end:tesseract.TFNetworkModel)
706 return target;
707}
708
710 // @@protoc_insertion_point(message_byte_size_start:tesseract.TFNetworkModel)
711 size_t total_size = 0;
712
713 if ((_internal_metadata_.have_unknown_fields() &&
714 ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
715 total_size += ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
716 (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()
717 ? _internal_metadata_.unknown_fields()
718 : _internal_metadata_.default_instance()));
719 }
720 // string spec = 3;
721 if (this->spec().size() > 0) {
722 total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->spec());
723 }
724
725 // string image_input = 11;
726 if (this->image_input().size() > 0) {
727 total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_input());
728 }
729
730 // string image_widths = 12;
731 if (this->image_widths().size() > 0) {
732 total_size +=
733 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_widths());
734 }
735
736 // string image_heights = 13;
737 if (this->image_heights().size() > 0) {
738 total_size +=
739 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->image_heights());
740 }
741
742 // string output_layer = 14;
743 if (this->output_layer().size() > 0) {
744 total_size +=
745 1 + ::google::protobuf::internal::WireFormatLite::StringSize(this->output_layer());
746 }
747
748 // .tensorflow.GraphDef graph = 1;
749 if (this->has_graph()) {
750 total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*graph_);
751 }
752
753 // int64 global_step = 2;
754 if (this->global_step() != 0) {
755 total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int64Size(this->global_step());
756 }
757
758 // int32 depth = 4;
759 if (this->depth() != 0) {
760 total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->depth());
761 }
762
763 // int32 x_size = 5;
764 if (this->x_size() != 0) {
765 total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->x_size());
766 }
767
768 // int32 y_size = 6;
769 if (this->y_size() != 0) {
770 total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->y_size());
771 }
772
773 // int32 batch_size = 8;
774 if (this->batch_size() != 0) {
775 total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->batch_size());
776 }
777
778 // int32 num_classes = 9;
779 if (this->num_classes() != 0) {
780 total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size(this->num_classes());
781 }
782
783 // bool using_ctc = 10;
784 if (this->using_ctc() != 0) {
785 total_size += 1 + 1;
786 }
787
788 int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
789 SetCachedSize(cached_size);
790 return total_size;
791}
792
793void TFNetworkModel::MergeFrom(const ::google::protobuf::Message &from) {
794 // @@protoc_insertion_point(generalized_merge_from_start:tesseract.TFNetworkModel)
795 GOOGLE_DCHECK_NE(&from, this);
796 const TFNetworkModel *source =
797 ::google::protobuf::internal::DynamicCastToGenerated<const TFNetworkModel>(&from);
798 if (source == NULL) {
799 // @@protoc_insertion_point(generalized_merge_from_cast_fail:tesseract.TFNetworkModel)
800 ::google::protobuf::internal::ReflectionOps::Merge(from, this);
801 } else {
802 // @@protoc_insertion_point(generalized_merge_from_cast_success:tesseract.TFNetworkModel)
803 MergeFrom(*source);
804 }
805}
806
808 // @@protoc_insertion_point(class_specific_merge_from_start:tesseract.TFNetworkModel)
809 GOOGLE_DCHECK_NE(&from, this);
810 _internal_metadata_.MergeFrom(from._internal_metadata_);
811 ::google::protobuf::uint32 cached_has_bits = 0;
812 (void)cached_has_bits;
813
814 if (from.spec().size() > 0) {
815 spec_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
816 from.spec_);
817 }
818 if (from.image_input().size() > 0) {
819 image_input_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
820 from.image_input_);
821 }
822 if (from.image_widths().size() > 0) {
823 image_widths_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
824 from.image_widths_);
825 }
826 if (from.image_heights().size() > 0) {
827 image_heights_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
828 from.image_heights_);
829 }
830 if (from.output_layer().size() > 0) {
831 output_layer_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
832 from.output_layer_);
833 }
834 if (from.has_graph()) {
835 mutable_graph()->::tensorflow::GraphDef::MergeFrom(from.graph());
836 }
837 if (from.global_step() != 0) {
839 }
840 if (from.depth() != 0) {
841 set_depth(from.depth());
842 }
843 if (from.x_size() != 0) {
844 set_x_size(from.x_size());
845 }
846 if (from.y_size() != 0) {
847 set_y_size(from.y_size());
848 }
849 if (from.batch_size() != 0) {
851 }
852 if (from.num_classes() != 0) {
854 }
855 if (from.using_ctc() != 0) {
856 set_using_ctc(from.using_ctc());
857 }
858}
859
860void TFNetworkModel::CopyFrom(const ::google::protobuf::Message &from) {
861 // @@protoc_insertion_point(generalized_copy_from_start:tesseract.TFNetworkModel)
862 if (&from == this)
863 return;
864 Clear();
865 MergeFrom(from);
866}
867
869 // @@protoc_insertion_point(class_specific_copy_from_start:tesseract.TFNetworkModel)
870 if (&from == this)
871 return;
872 Clear();
873 MergeFrom(from);
874}
875
877 return true;
878}
879
881 if (other == this)
882 return;
883 InternalSwap(other);
884}
885void TFNetworkModel::InternalSwap(TFNetworkModel *other) {
886 using std::swap;
887 spec_.Swap(&other->spec_, &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
888 GetArenaNoVirtual());
889 image_input_.Swap(&other->image_input_,
890 &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
891 GetArenaNoVirtual());
892 image_widths_.Swap(&other->image_widths_,
893 &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
894 GetArenaNoVirtual());
895 image_heights_.Swap(&other->image_heights_,
896 &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
897 GetArenaNoVirtual());
898 output_layer_.Swap(&other->output_layer_,
899 &::google::protobuf::internal::GetEmptyStringAlreadyInited(),
900 GetArenaNoVirtual());
901 swap(graph_, other->graph_);
902 swap(global_step_, other->global_step_);
903 swap(depth_, other->depth_);
904 swap(x_size_, other->x_size_);
905 swap(y_size_, other->y_size_);
906 swap(batch_size_, other->batch_size_);
907 swap(num_classes_, other->num_classes_);
908 swap(using_ctc_, other->using_ctc_);
909 _internal_metadata_.Swap(&other->_internal_metadata_);
910}
911
912::google::protobuf::Metadata TFNetworkModel::GetMetadata() const {
915}
916
917// @@protoc_insertion_point(namespace_scope)
918} // namespace tesseract
919namespace google {
920namespace protobuf {
921template <>
922GOOGLE_PROTOBUF_ATTRIBUTE_NOINLINE ::tesseract::TFNetworkModel *
923Arena::CreateMaybeMessage<::tesseract::TFNetworkModel>(Arena *arena) {
924 return Arena::CreateInternal<::tesseract::TFNetworkModel>(arena);
925}
926} // namespace protobuf
927} // namespace google
928
929// @@protoc_insertion_point(global_scope)
#define DO_(EXPRESSION)
const char * p
class tesseract::TFNetworkModelDefaultTypeInternal _TFNetworkModel_default_instance_
Definition: tfnetwork.pb.h:52
PROTOBUF_INTERNAL_EXPORT_protobuf_tensorflow_2fcore_2fframework_2fgraph_2eproto ::google::protobuf::internal::SCCInfo< 3 > scc_info_GraphDef
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold)
::google::protobuf::internal::SCCInfo< 1 > scc_info_TFNetworkModel
Definition: tfnetwork.pb.cc:45
void protobuf_RegisterTypes(const ::std::string &) GOOGLE_PROTOBUF_ATTRIBUTE_COLD
struct protobuf_tfnetwork_2eproto::StaticDescriptorInitializer static_descriptor_initializer
::google::protobuf::Metadata file_level_metadata[1]
Definition: tfnetwork.pb.cc:56
::google::protobuf::internal::ExplicitlyConstructed< TFNetworkModel > _instance
Definition: tfnetwork.pb.cc:30
static const ::google::protobuf::uint32 offsets[]
Definition: tfnetwork.pb.h:45
static const ::google::protobuf::Descriptor * descriptor()
static const int kYSizeFieldNumber
Definition: tfnetwork.pb.h:258
bool IsInitialized() const final
static const TFNetworkModel * internal_default_instance()
Definition: tfnetwork.pb.h:98
const ::std::string & image_heights() const
Definition: tfnetwork.pb.h:597
const ::std::string & output_layer() const
Definition: tfnetwork.pb.h:648
void set_x_size(::google::protobuf::int32 value)
Definition: tfnetwork.pb.h:438
static const int kUsingCtcFieldNumber
Definition: tfnetwork.pb.h:276
::google::protobuf::Metadata GetMetadata() const final
static const int kBatchSizeFieldNumber
Definition: tfnetwork.pb.h:264
static void InitAsDefaultInstance()
::std::string * mutable_spec()
Definition: tfnetwork.pb.h:400
::tensorflow::GraphDef * mutable_graph()
Definition: tfnetwork.pb.h:330
void set_y_size(::google::protobuf::int32 value)
Definition: tfnetwork.pb.h:451
static const int kOutputLayerFieldNumber
Definition: tfnetwork.pb.h:212
static constexpr int kIndexInFileMessages
Definition: tfnetwork.pb.h:101
static const int kImageHeightsFieldNumber
Definition: tfnetwork.pb.h:198
::google::protobuf::uint8 * InternalSerializeWithCachedSizesToArray(bool deterministic, ::google::protobuf::uint8 *target) const final
void Swap(TFNetworkModel *other)
void set_using_ctc(bool value)
Definition: tfnetwork.pb.h:490
::std::string * mutable_output_layer()
Definition: tfnetwork.pb.h:675
friend void swap(TFNetworkModel &a, TFNetworkModel &b)
Definition: tfnetwork.pb.h:104
const ::tensorflow::GraphDef & graph() const
Definition: tfnetwork.pb.h:316
::google::protobuf::int64 global_step() const
Definition: tfnetwork.pb.h:360
::google::protobuf::int32 x_size() const
Definition: tfnetwork.pb.h:434
void SerializeWithCachedSizes(::google::protobuf::io::CodedOutputStream *output) const final
const ::std::string & image_input() const
Definition: tfnetwork.pb.h:499
static const int kXSizeFieldNumber
Definition: tfnetwork.pb.h:252
static const int kGraphFieldNumber
Definition: tfnetwork.pb.h:227
static const int kDepthFieldNumber
Definition: tfnetwork.pb.h:246
static const TFNetworkModel & default_instance()
void set_num_classes(::google::protobuf::int32 value)
Definition: tfnetwork.pb.h:477
void CopyFrom(const ::google::protobuf::Message &from) final
static const int kNumClassesFieldNumber
Definition: tfnetwork.pb.h:270
::google::protobuf::int32 num_classes() const
Definition: tfnetwork.pb.h:473
void set_depth(::google::protobuf::int32 value)
Definition: tfnetwork.pb.h:425
::google::protobuf::int32 depth() const
Definition: tfnetwork.pb.h:421
static const int kImageWidthsFieldNumber
Definition: tfnetwork.pb.h:184
static const int kGlobalStepFieldNumber
Definition: tfnetwork.pb.h:240
const ::std::string & image_widths() const
Definition: tfnetwork.pb.h:548
void set_global_step(::google::protobuf::int64 value)
Definition: tfnetwork.pb.h:364
::std::string * mutable_image_widths()
Definition: tfnetwork.pb.h:575
void MergeFrom(const ::google::protobuf::Message &from) final
static const int kSpecFieldNumber
Definition: tfnetwork.pb.h:156
::std::string * mutable_image_heights()
Definition: tfnetwork.pb.h:624
const ::std::string & spec() const
Definition: tfnetwork.pb.h:373
::google::protobuf::int32 batch_size() const
Definition: tfnetwork.pb.h:460
static const int kImageInputFieldNumber
Definition: tfnetwork.pb.h:170
size_t ByteSizeLong() const final
bool MergePartialFromCodedStream(::google::protobuf::io::CodedInputStream *input) final
::google::protobuf::int32 y_size() const
Definition: tfnetwork.pb.h:447
::std::string * mutable_image_input()
Definition: tfnetwork.pb.h:526
void set_batch_size(::google::protobuf::int32 value)
Definition: tfnetwork.pb.h:464