You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

PostProcessing.cs 27 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: object_detection/protos/post_processing.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Tensorflow.Models.ObjectDetection.Protos {
  12. /// <summary>Holder for reflection information generated from object_detection/protos/post_processing.proto</summary>
  13. public static partial class PostProcessingReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for object_detection/protos/post_processing.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static PostProcessingReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "Ci1vYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9wb3N0X3Byb2Nlc3NpbmcucHJv",
  24. "dG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zGilvYmplY3RfZGV0ZWN0aW9u",
  25. "L3Byb3Rvcy9jYWxpYnJhdGlvbi5wcm90byL+AQoWQmF0Y2hOb25NYXhTdXBw",
  26. "cmVzc2lvbhIXCg9zY29yZV90aHJlc2hvbGQYASABKAISFQoNaW91X3RocmVz",
  27. "aG9sZBgCIAEoAhIgChhtYXhfZGV0ZWN0aW9uc19wZXJfY2xhc3MYAyABKAUS",
  28. "HAoUbWF4X3RvdGFsX2RldGVjdGlvbnMYBSABKAUSGQoRdXNlX3N0YXRpY19z",
  29. "aGFwZXMYBiABKAgSHgoWdXNlX2NsYXNzX2Fnbm9zdGljX25tcxgHIAEoCBIh",
  30. "ChltYXhfY2xhc3Nlc19wZXJfZGV0ZWN0aW9uGAggASgFEhYKDnNvZnRfbm1z",
  31. "X3NpZ21hGAkgASgCIswCCg5Qb3N0UHJvY2Vzc2luZxJSChliYXRjaF9ub25f",
  32. "bWF4X3N1cHByZXNzaW9uGAEgASgLMi8ub2JqZWN0X2RldGVjdGlvbi5wcm90",
  33. "b3MuQmF0Y2hOb25NYXhTdXBwcmVzc2lvbhJPCg9zY29yZV9jb252ZXJ0ZXIY",
  34. "AiABKA4yNi5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5Qb3N0UHJvY2Vzc2lu",
  35. "Zy5TY29yZUNvbnZlcnRlchITCgtsb2dpdF9zY2FsZRgDIAEoAhJGChJjYWxp",
  36. "YnJhdGlvbl9jb25maWcYBCABKAsyKi5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv",
  37. "cy5DYWxpYnJhdGlvbkNvbmZpZyI4Cg5TY29yZUNvbnZlcnRlchIMCghJREVO",
  38. "VElUWRAAEgsKB1NJR01PSUQQARILCgdTT0ZUTUFYEAJiBnByb3RvMw=="));
  39. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  40. new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor, },
  41. new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
  42. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression), global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression.Parser, new[]{ "ScoreThreshold", "IouThreshold", "MaxDetectionsPerClass", "MaxTotalDetections", "UseStaticShapes", "UseClassAgnosticNms", "MaxClassesPerDetection", "SoftNmsSigma" }, null, null, null),
  43. new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing), global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Parser, new[]{ "BatchNonMaxSuppression", "ScoreConverter", "LogitScale", "CalibrationConfig" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter) }, null)
  44. }));
  45. }
  46. #endregion
  47. }
  48. #region Messages
  49. /// <summary>
  50. /// Configuration proto for non-max-suppression operation on a batch of
  51. /// detections.
  52. /// </summary>
  53. public sealed partial class BatchNonMaxSuppression : pb::IMessage<BatchNonMaxSuppression> {
  54. private static readonly pb::MessageParser<BatchNonMaxSuppression> _parser = new pb::MessageParser<BatchNonMaxSuppression>(() => new BatchNonMaxSuppression());
  55. private pb::UnknownFieldSet _unknownFields;
  56. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  57. public static pb::MessageParser<BatchNonMaxSuppression> Parser { get { return _parser; } }
  58. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  59. public static pbr::MessageDescriptor Descriptor {
  60. get { return global::Tensorflow.Models.ObjectDetection.Protos.PostProcessingReflection.Descriptor.MessageTypes[0]; }
  61. }
  62. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  63. pbr::MessageDescriptor pb::IMessage.Descriptor {
  64. get { return Descriptor; }
  65. }
  66. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  67. public BatchNonMaxSuppression() {
  68. OnConstruction();
  69. }
  70. partial void OnConstruction();
  71. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  72. public BatchNonMaxSuppression(BatchNonMaxSuppression other) : this() {
  73. scoreThreshold_ = other.scoreThreshold_;
  74. iouThreshold_ = other.iouThreshold_;
  75. maxDetectionsPerClass_ = other.maxDetectionsPerClass_;
  76. maxTotalDetections_ = other.maxTotalDetections_;
  77. useStaticShapes_ = other.useStaticShapes_;
  78. useClassAgnosticNms_ = other.useClassAgnosticNms_;
  79. maxClassesPerDetection_ = other.maxClassesPerDetection_;
  80. softNmsSigma_ = other.softNmsSigma_;
  81. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  82. }
  83. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  84. public BatchNonMaxSuppression Clone() {
  85. return new BatchNonMaxSuppression(this);
  86. }
  87. /// <summary>Field number for the "score_threshold" field.</summary>
  88. public const int ScoreThresholdFieldNumber = 1;
  89. private float scoreThreshold_;
  90. /// <summary>
  91. /// Scalar threshold for score (low scoring boxes are removed).
  92. /// </summary>
  93. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  94. public float ScoreThreshold {
  95. get { return scoreThreshold_; }
  96. set {
  97. scoreThreshold_ = value;
  98. }
  99. }
  100. /// <summary>Field number for the "iou_threshold" field.</summary>
  101. public const int IouThresholdFieldNumber = 2;
  102. private float iouThreshold_;
  103. /// <summary>
  104. /// Scalar threshold for IOU (boxes that have high IOU overlap
  105. /// with previously selected boxes are removed).
  106. /// </summary>
  107. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  108. public float IouThreshold {
  109. get { return iouThreshold_; }
  110. set {
  111. iouThreshold_ = value;
  112. }
  113. }
  114. /// <summary>Field number for the "max_detections_per_class" field.</summary>
  115. public const int MaxDetectionsPerClassFieldNumber = 3;
  116. private int maxDetectionsPerClass_;
  117. /// <summary>
  118. /// Maximum number of detections to retain per class.
  119. /// </summary>
  120. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  121. public int MaxDetectionsPerClass {
  122. get { return maxDetectionsPerClass_; }
  123. set {
  124. maxDetectionsPerClass_ = value;
  125. }
  126. }
  127. /// <summary>Field number for the "max_total_detections" field.</summary>
  128. public const int MaxTotalDetectionsFieldNumber = 5;
  129. private int maxTotalDetections_;
  130. /// <summary>
  131. /// Maximum number of detections to retain across all classes.
  132. /// </summary>
  133. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  134. public int MaxTotalDetections {
  135. get { return maxTotalDetections_; }
  136. set {
  137. maxTotalDetections_ = value;
  138. }
  139. }
  140. /// <summary>Field number for the "use_static_shapes" field.</summary>
  141. public const int UseStaticShapesFieldNumber = 6;
  142. private bool useStaticShapes_;
  143. /// <summary>
  144. /// Whether to use the implementation of NMS that guarantees static shapes.
  145. /// </summary>
  146. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  147. public bool UseStaticShapes {
  148. get { return useStaticShapes_; }
  149. set {
  150. useStaticShapes_ = value;
  151. }
  152. }
  153. /// <summary>Field number for the "use_class_agnostic_nms" field.</summary>
  154. public const int UseClassAgnosticNmsFieldNumber = 7;
  155. private bool useClassAgnosticNms_;
  156. /// <summary>
  157. /// Whether to use class agnostic NMS.
  158. /// Class-agnostic NMS function implements a class-agnostic version
  159. /// of Non Maximal Suppression where if max_classes_per_detection=k,
  160. /// 1) we keep the top-k scores for each detection and
  161. /// 2) during NMS, each detection only uses the highest class score for sorting.
  162. /// 3) Compared to regular NMS, the worst runtime of this version is O(N^2)
  163. /// instead of O(KN^2) where N is the number of detections and K the number of
  164. /// classes.
  165. /// </summary>
  166. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  167. public bool UseClassAgnosticNms {
  168. get { return useClassAgnosticNms_; }
  169. set {
  170. useClassAgnosticNms_ = value;
  171. }
  172. }
  173. /// <summary>Field number for the "max_classes_per_detection" field.</summary>
  174. public const int MaxClassesPerDetectionFieldNumber = 8;
  175. private int maxClassesPerDetection_;
  176. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  177. public int MaxClassesPerDetection {
  178. get { return maxClassesPerDetection_; }
  179. set {
  180. maxClassesPerDetection_ = value;
  181. }
  182. }
  183. /// <summary>Field number for the "soft_nms_sigma" field.</summary>
  184. public const int SoftNmsSigmaFieldNumber = 9;
  185. private float softNmsSigma_;
  186. /// <summary>
  187. /// Soft NMS sigma parameter; Bodla et al, https://arxiv.org/abs/1704.04503)
  188. /// </summary>
  189. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  190. public float SoftNmsSigma {
  191. get { return softNmsSigma_; }
  192. set {
  193. softNmsSigma_ = value;
  194. }
  195. }
  196. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  197. public override bool Equals(object other) {
  198. return Equals(other as BatchNonMaxSuppression);
  199. }
  200. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  201. public bool Equals(BatchNonMaxSuppression other) {
  202. if (ReferenceEquals(other, null)) {
  203. return false;
  204. }
  205. if (ReferenceEquals(other, this)) {
  206. return true;
  207. }
  208. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScoreThreshold, other.ScoreThreshold)) return false;
  209. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IouThreshold, other.IouThreshold)) return false;
  210. if (MaxDetectionsPerClass != other.MaxDetectionsPerClass) return false;
  211. if (MaxTotalDetections != other.MaxTotalDetections) return false;
  212. if (UseStaticShapes != other.UseStaticShapes) return false;
  213. if (UseClassAgnosticNms != other.UseClassAgnosticNms) return false;
  214. if (MaxClassesPerDetection != other.MaxClassesPerDetection) return false;
  215. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SoftNmsSigma, other.SoftNmsSigma)) return false;
  216. return Equals(_unknownFields, other._unknownFields);
  217. }
  218. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  219. public override int GetHashCode() {
  220. int hash = 1;
  221. if (ScoreThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScoreThreshold);
  222. if (IouThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IouThreshold);
  223. if (MaxDetectionsPerClass != 0) hash ^= MaxDetectionsPerClass.GetHashCode();
  224. if (MaxTotalDetections != 0) hash ^= MaxTotalDetections.GetHashCode();
  225. if (UseStaticShapes != false) hash ^= UseStaticShapes.GetHashCode();
  226. if (UseClassAgnosticNms != false) hash ^= UseClassAgnosticNms.GetHashCode();
  227. if (MaxClassesPerDetection != 0) hash ^= MaxClassesPerDetection.GetHashCode();
  228. if (SoftNmsSigma != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SoftNmsSigma);
  229. if (_unknownFields != null) {
  230. hash ^= _unknownFields.GetHashCode();
  231. }
  232. return hash;
  233. }
  234. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  235. public override string ToString() {
  236. return pb::JsonFormatter.ToDiagnosticString(this);
  237. }
  238. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  239. public void WriteTo(pb::CodedOutputStream output) {
  240. if (ScoreThreshold != 0F) {
  241. output.WriteRawTag(13);
  242. output.WriteFloat(ScoreThreshold);
  243. }
  244. if (IouThreshold != 0F) {
  245. output.WriteRawTag(21);
  246. output.WriteFloat(IouThreshold);
  247. }
  248. if (MaxDetectionsPerClass != 0) {
  249. output.WriteRawTag(24);
  250. output.WriteInt32(MaxDetectionsPerClass);
  251. }
  252. if (MaxTotalDetections != 0) {
  253. output.WriteRawTag(40);
  254. output.WriteInt32(MaxTotalDetections);
  255. }
  256. if (UseStaticShapes != false) {
  257. output.WriteRawTag(48);
  258. output.WriteBool(UseStaticShapes);
  259. }
  260. if (UseClassAgnosticNms != false) {
  261. output.WriteRawTag(56);
  262. output.WriteBool(UseClassAgnosticNms);
  263. }
  264. if (MaxClassesPerDetection != 0) {
  265. output.WriteRawTag(64);
  266. output.WriteInt32(MaxClassesPerDetection);
  267. }
  268. if (SoftNmsSigma != 0F) {
  269. output.WriteRawTag(77);
  270. output.WriteFloat(SoftNmsSigma);
  271. }
  272. if (_unknownFields != null) {
  273. _unknownFields.WriteTo(output);
  274. }
  275. }
  276. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  277. public int CalculateSize() {
  278. int size = 0;
  279. if (ScoreThreshold != 0F) {
  280. size += 1 + 4;
  281. }
  282. if (IouThreshold != 0F) {
  283. size += 1 + 4;
  284. }
  285. if (MaxDetectionsPerClass != 0) {
  286. size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxDetectionsPerClass);
  287. }
  288. if (MaxTotalDetections != 0) {
  289. size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxTotalDetections);
  290. }
  291. if (UseStaticShapes != false) {
  292. size += 1 + 1;
  293. }
  294. if (UseClassAgnosticNms != false) {
  295. size += 1 + 1;
  296. }
  297. if (MaxClassesPerDetection != 0) {
  298. size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxClassesPerDetection);
  299. }
  300. if (SoftNmsSigma != 0F) {
  301. size += 1 + 4;
  302. }
  303. if (_unknownFields != null) {
  304. size += _unknownFields.CalculateSize();
  305. }
  306. return size;
  307. }
  308. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  309. public void MergeFrom(BatchNonMaxSuppression other) {
  310. if (other == null) {
  311. return;
  312. }
  313. if (other.ScoreThreshold != 0F) {
  314. ScoreThreshold = other.ScoreThreshold;
  315. }
  316. if (other.IouThreshold != 0F) {
  317. IouThreshold = other.IouThreshold;
  318. }
  319. if (other.MaxDetectionsPerClass != 0) {
  320. MaxDetectionsPerClass = other.MaxDetectionsPerClass;
  321. }
  322. if (other.MaxTotalDetections != 0) {
  323. MaxTotalDetections = other.MaxTotalDetections;
  324. }
  325. if (other.UseStaticShapes != false) {
  326. UseStaticShapes = other.UseStaticShapes;
  327. }
  328. if (other.UseClassAgnosticNms != false) {
  329. UseClassAgnosticNms = other.UseClassAgnosticNms;
  330. }
  331. if (other.MaxClassesPerDetection != 0) {
  332. MaxClassesPerDetection = other.MaxClassesPerDetection;
  333. }
  334. if (other.SoftNmsSigma != 0F) {
  335. SoftNmsSigma = other.SoftNmsSigma;
  336. }
  337. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  338. }
  339. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  340. public void MergeFrom(pb::CodedInputStream input) {
  341. uint tag;
  342. while ((tag = input.ReadTag()) != 0) {
  343. switch(tag) {
  344. default:
  345. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  346. break;
  347. case 13: {
  348. ScoreThreshold = input.ReadFloat();
  349. break;
  350. }
  351. case 21: {
  352. IouThreshold = input.ReadFloat();
  353. break;
  354. }
  355. case 24: {
  356. MaxDetectionsPerClass = input.ReadInt32();
  357. break;
  358. }
  359. case 40: {
  360. MaxTotalDetections = input.ReadInt32();
  361. break;
  362. }
  363. case 48: {
  364. UseStaticShapes = input.ReadBool();
  365. break;
  366. }
  367. case 56: {
  368. UseClassAgnosticNms = input.ReadBool();
  369. break;
  370. }
  371. case 64: {
  372. MaxClassesPerDetection = input.ReadInt32();
  373. break;
  374. }
  375. case 77: {
  376. SoftNmsSigma = input.ReadFloat();
  377. break;
  378. }
  379. }
  380. }
  381. }
  382. }
  383. /// <summary>
  384. /// Configuration proto for post-processing predicted boxes and
  385. /// scores.
  386. /// </summary>
  387. public sealed partial class PostProcessing : pb::IMessage<PostProcessing> {
  388. private static readonly pb::MessageParser<PostProcessing> _parser = new pb::MessageParser<PostProcessing>(() => new PostProcessing());
  389. private pb::UnknownFieldSet _unknownFields;
  390. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  391. public static pb::MessageParser<PostProcessing> Parser { get { return _parser; } }
  392. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  393. public static pbr::MessageDescriptor Descriptor {
  394. get { return global::Tensorflow.Models.ObjectDetection.Protos.PostProcessingReflection.Descriptor.MessageTypes[1]; }
  395. }
  396. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  397. pbr::MessageDescriptor pb::IMessage.Descriptor {
  398. get { return Descriptor; }
  399. }
  400. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  401. public PostProcessing() {
  402. OnConstruction();
  403. }
  404. partial void OnConstruction();
  405. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  406. public PostProcessing(PostProcessing other) : this() {
  407. batchNonMaxSuppression_ = other.batchNonMaxSuppression_ != null ? other.batchNonMaxSuppression_.Clone() : null;
  408. scoreConverter_ = other.scoreConverter_;
  409. logitScale_ = other.logitScale_;
  410. calibrationConfig_ = other.calibrationConfig_ != null ? other.calibrationConfig_.Clone() : null;
  411. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  412. }
  413. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  414. public PostProcessing Clone() {
  415. return new PostProcessing(this);
  416. }
  417. /// <summary>Field number for the "batch_non_max_suppression" field.</summary>
  418. public const int BatchNonMaxSuppressionFieldNumber = 1;
  419. private global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression batchNonMaxSuppression_;
  420. /// <summary>
  421. /// Non max suppression parameters.
  422. /// </summary>
  423. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  424. public global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression BatchNonMaxSuppression {
  425. get { return batchNonMaxSuppression_; }
  426. set {
  427. batchNonMaxSuppression_ = value;
  428. }
  429. }
  430. /// <summary>Field number for the "score_converter" field.</summary>
  431. public const int ScoreConverterFieldNumber = 2;
  432. private global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter scoreConverter_ = 0;
  433. /// <summary>
  434. /// Score converter to use.
  435. /// </summary>
  436. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  437. public global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter ScoreConverter {
  438. get { return scoreConverter_; }
  439. set {
  440. scoreConverter_ = value;
  441. }
  442. }
  443. /// <summary>Field number for the "logit_scale" field.</summary>
  444. public const int LogitScaleFieldNumber = 3;
  445. private float logitScale_;
  446. /// <summary>
  447. /// Scale logit (input) value before conversion in post-processing step.
  448. /// Typically used for softmax distillation, though can be used to scale for
  449. /// other reasons.
  450. /// </summary>
  451. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  452. public float LogitScale {
  453. get { return logitScale_; }
  454. set {
  455. logitScale_ = value;
  456. }
  457. }
  458. /// <summary>Field number for the "calibration_config" field.</summary>
  459. public const int CalibrationConfigFieldNumber = 4;
  460. private global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig calibrationConfig_;
  461. /// <summary>
  462. /// Calibrate score outputs. Calibration is applied after score converter
  463. /// and before non max suppression.
  464. /// </summary>
  465. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  466. public global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig CalibrationConfig {
  467. get { return calibrationConfig_; }
  468. set {
  469. calibrationConfig_ = value;
  470. }
  471. }
  472. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  473. public override bool Equals(object other) {
  474. return Equals(other as PostProcessing);
  475. }
  476. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  477. public bool Equals(PostProcessing other) {
  478. if (ReferenceEquals(other, null)) {
  479. return false;
  480. }
  481. if (ReferenceEquals(other, this)) {
  482. return true;
  483. }
  484. if (!object.Equals(BatchNonMaxSuppression, other.BatchNonMaxSuppression)) return false;
  485. if (ScoreConverter != other.ScoreConverter) return false;
  486. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LogitScale, other.LogitScale)) return false;
  487. if (!object.Equals(CalibrationConfig, other.CalibrationConfig)) return false;
  488. return Equals(_unknownFields, other._unknownFields);
  489. }
  490. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  491. public override int GetHashCode() {
  492. int hash = 1;
  493. if (batchNonMaxSuppression_ != null) hash ^= BatchNonMaxSuppression.GetHashCode();
  494. if (ScoreConverter != 0) hash ^= ScoreConverter.GetHashCode();
  495. if (LogitScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LogitScale);
  496. if (calibrationConfig_ != null) hash ^= CalibrationConfig.GetHashCode();
  497. if (_unknownFields != null) {
  498. hash ^= _unknownFields.GetHashCode();
  499. }
  500. return hash;
  501. }
  502. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  503. public override string ToString() {
  504. return pb::JsonFormatter.ToDiagnosticString(this);
  505. }
  506. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  507. public void WriteTo(pb::CodedOutputStream output) {
  508. if (batchNonMaxSuppression_ != null) {
  509. output.WriteRawTag(10);
  510. output.WriteMessage(BatchNonMaxSuppression);
  511. }
  512. if (ScoreConverter != 0) {
  513. output.WriteRawTag(16);
  514. output.WriteEnum((int) ScoreConverter);
  515. }
  516. if (LogitScale != 0F) {
  517. output.WriteRawTag(29);
  518. output.WriteFloat(LogitScale);
  519. }
  520. if (calibrationConfig_ != null) {
  521. output.WriteRawTag(34);
  522. output.WriteMessage(CalibrationConfig);
  523. }
  524. if (_unknownFields != null) {
  525. _unknownFields.WriteTo(output);
  526. }
  527. }
  528. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  529. public int CalculateSize() {
  530. int size = 0;
  531. if (batchNonMaxSuppression_ != null) {
  532. size += 1 + pb::CodedOutputStream.ComputeMessageSize(BatchNonMaxSuppression);
  533. }
  534. if (ScoreConverter != 0) {
  535. size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ScoreConverter);
  536. }
  537. if (LogitScale != 0F) {
  538. size += 1 + 4;
  539. }
  540. if (calibrationConfig_ != null) {
  541. size += 1 + pb::CodedOutputStream.ComputeMessageSize(CalibrationConfig);
  542. }
  543. if (_unknownFields != null) {
  544. size += _unknownFields.CalculateSize();
  545. }
  546. return size;
  547. }
  548. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  549. public void MergeFrom(PostProcessing other) {
  550. if (other == null) {
  551. return;
  552. }
  553. if (other.batchNonMaxSuppression_ != null) {
  554. if (batchNonMaxSuppression_ == null) {
  555. batchNonMaxSuppression_ = new global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression();
  556. }
  557. BatchNonMaxSuppression.MergeFrom(other.BatchNonMaxSuppression);
  558. }
  559. if (other.ScoreConverter != 0) {
  560. ScoreConverter = other.ScoreConverter;
  561. }
  562. if (other.LogitScale != 0F) {
  563. LogitScale = other.LogitScale;
  564. }
  565. if (other.calibrationConfig_ != null) {
  566. if (calibrationConfig_ == null) {
  567. calibrationConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig();
  568. }
  569. CalibrationConfig.MergeFrom(other.CalibrationConfig);
  570. }
  571. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  572. }
  573. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  574. public void MergeFrom(pb::CodedInputStream input) {
  575. uint tag;
  576. while ((tag = input.ReadTag()) != 0) {
  577. switch(tag) {
  578. default:
  579. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  580. break;
  581. case 10: {
  582. if (batchNonMaxSuppression_ == null) {
  583. batchNonMaxSuppression_ = new global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression();
  584. }
  585. input.ReadMessage(batchNonMaxSuppression_);
  586. break;
  587. }
  588. case 16: {
  589. scoreConverter_ = (global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter) input.ReadEnum();
  590. break;
  591. }
  592. case 29: {
  593. LogitScale = input.ReadFloat();
  594. break;
  595. }
  596. case 34: {
  597. if (calibrationConfig_ == null) {
  598. calibrationConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig();
  599. }
  600. input.ReadMessage(calibrationConfig_);
  601. break;
  602. }
  603. }
  604. }
  605. }
  606. #region Nested types
  607. /// <summary>Container for nested types declared in the PostProcessing message type.</summary>
  608. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  609. public static partial class Types {
  610. /// <summary>
  611. /// Enum to specify how to convert the detection scores.
  612. /// </summary>
  613. public enum ScoreConverter {
  614. /// <summary>
  615. /// Input scores equals output scores.
  616. /// </summary>
  617. [pbr::OriginalName("IDENTITY")] Identity = 0,
  618. /// <summary>
  619. /// Applies a sigmoid on input scores.
  620. /// </summary>
  621. [pbr::OriginalName("SIGMOID")] Sigmoid = 1,
  622. /// <summary>
  623. /// Applies a softmax on input scores
  624. /// </summary>
  625. [pbr::OriginalName("SOFTMAX")] Softmax = 2,
  626. }
  627. }
  628. #endregion
  629. }
  630. #endregion
  631. }
  632. #endregion Designer generated code