diff --git a/TensorFlow.NET.sln b/TensorFlow.NET.sln
index ca14ecbd..d941de2f 100644
--- a/TensorFlow.NET.sln
+++ b/TensorFlow.NET.sln
@@ -21,6 +21,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowDatasets", "src\T
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Examples.GPU", "test\TensorFlowNET.Examples\TensorFlowNET.Examples.GPU.csproj", "{6F6B3382-8F87-4CD9-BF87-C81D5405685A}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Models", "src\TensorFlowNET.Models\TensorFlowNET.Models.csproj", "{D03F94CF-B283-4730-B177-21A57641061F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -63,6 +65,10 @@ Global
{6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F6B3382-8F87-4CD9-BF87-C81D5405685A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D03F94CF-B283-4730-B177-21A57641061F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D03F94CF-B283-4730-B177-21A57641061F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D03F94CF-B283-4730-B177-21A57641061F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D03F94CF-B283-4730-B177-21A57641061F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs
new file mode 100644
index 00000000..8a0e255c
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs
@@ -0,0 +1,343 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/anchor_generator.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/anchor_generator.proto
+ public static partial class AnchorGeneratorReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/anchor_generator.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static AnchorGeneratorReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "Ci5vYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9hbmNob3JfZ2VuZXJhdG9yLnBy",
+ "b3RvEhdvYmplY3RfZGV0ZWN0aW9uLnByb3Rvcxo8b2JqZWN0X2RldGVjdGlv",
+ "bi9wcm90b3MvZmxleGlibGVfZ3JpZF9hbmNob3JfZ2VuZXJhdG9yLnByb3Rv",
+ "GjNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9ncmlkX2FuY2hvcl9nZW5lcmF0",
+ "b3IucHJvdG8aOW9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL211bHRpc2NhbGVf",
+ "YW5jaG9yX2dlbmVyYXRvci5wcm90bxoyb2JqZWN0X2RldGVjdGlvbi9wcm90",
+ "b3Mvc3NkX2FuY2hvcl9nZW5lcmF0b3IucHJvdG8iggMKD0FuY2hvckdlbmVy",
+ "YXRvchJNChVncmlkX2FuY2hvcl9nZW5lcmF0b3IYASABKAsyLC5vYmplY3Rf",
+ "ZGV0ZWN0aW9uLnByb3Rvcy5HcmlkQW5jaG9yR2VuZXJhdG9ySAASSwoUc3Nk",
+ "X2FuY2hvcl9nZW5lcmF0b3IYAiABKAsyKy5vYmplY3RfZGV0ZWN0aW9uLnBy",
+ "b3Rvcy5Tc2RBbmNob3JHZW5lcmF0b3JIABJZChttdWx0aXNjYWxlX2FuY2hv",
+ "cl9nZW5lcmF0b3IYAyABKAsyMi5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5N",
+ "dWx0aXNjYWxlQW5jaG9yR2VuZXJhdG9ySAASXgoeZmxleGlibGVfZ3JpZF9h",
+ "bmNob3JfZ2VuZXJhdG9yGAQgASgLMjQub2JqZWN0X2RldGVjdGlvbi5wcm90",
+ "b3MuRmxleGlibGVHcmlkQW5jaG9yR2VuZXJhdG9ySABCGAoWYW5jaG9yX2dl",
+ "bmVyYXRvcl9vbmVvZmIGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGeneratorReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGeneratorReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGeneratorReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGeneratorReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator), global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator.Parser, new[]{ "GridAnchorGenerator", "SsdAnchorGenerator", "MultiscaleAnchorGenerator", "FlexibleGridAnchorGenerator" }, new[]{ "AnchorGeneratorOneof" }, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for the anchor generator to use in the object detection
+ /// pipeline. See core/anchor_generator.py for details.
+ ///
+ public sealed partial class AnchorGenerator : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AnchorGenerator());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.AnchorGeneratorReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGenerator() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGenerator(AnchorGenerator other) : this() {
+ switch (other.AnchorGeneratorOneofCase) {
+ case AnchorGeneratorOneofOneofCase.GridAnchorGenerator:
+ GridAnchorGenerator = other.GridAnchorGenerator.Clone();
+ break;
+ case AnchorGeneratorOneofOneofCase.SsdAnchorGenerator:
+ SsdAnchorGenerator = other.SsdAnchorGenerator.Clone();
+ break;
+ case AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator:
+ MultiscaleAnchorGenerator = other.MultiscaleAnchorGenerator.Clone();
+ break;
+ case AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator:
+ FlexibleGridAnchorGenerator = other.FlexibleGridAnchorGenerator.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGenerator Clone() {
+ return new AnchorGenerator(this);
+ }
+
+ /// Field number for the "grid_anchor_generator" field.
+ public const int GridAnchorGeneratorFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator GridAnchorGenerator {
+ get { return anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.GridAnchorGenerator ? (global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator) anchorGeneratorOneof_ : null; }
+ set {
+ anchorGeneratorOneof_ = value;
+ anchorGeneratorOneofCase_ = value == null ? AnchorGeneratorOneofOneofCase.None : AnchorGeneratorOneofOneofCase.GridAnchorGenerator;
+ }
+ }
+
+ /// Field number for the "ssd_anchor_generator" field.
+ public const int SsdAnchorGeneratorFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator SsdAnchorGenerator {
+ get { return anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.SsdAnchorGenerator ? (global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator) anchorGeneratorOneof_ : null; }
+ set {
+ anchorGeneratorOneof_ = value;
+ anchorGeneratorOneofCase_ = value == null ? AnchorGeneratorOneofOneofCase.None : AnchorGeneratorOneofOneofCase.SsdAnchorGenerator;
+ }
+ }
+
+ /// Field number for the "multiscale_anchor_generator" field.
+ public const int MultiscaleAnchorGeneratorFieldNumber = 3;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator MultiscaleAnchorGenerator {
+ get { return anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator ? (global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator) anchorGeneratorOneof_ : null; }
+ set {
+ anchorGeneratorOneof_ = value;
+ anchorGeneratorOneofCase_ = value == null ? AnchorGeneratorOneofOneofCase.None : AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator;
+ }
+ }
+
+ /// Field number for the "flexible_grid_anchor_generator" field.
+ public const int FlexibleGridAnchorGeneratorFieldNumber = 4;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator FlexibleGridAnchorGenerator {
+ get { return anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator ? (global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator) anchorGeneratorOneof_ : null; }
+ set {
+ anchorGeneratorOneof_ = value;
+ anchorGeneratorOneofCase_ = value == null ? AnchorGeneratorOneofOneofCase.None : AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator;
+ }
+ }
+
+ private object anchorGeneratorOneof_;
+ /// Enum of possible cases for the "anchor_generator_oneof" oneof.
+ public enum AnchorGeneratorOneofOneofCase {
+ None = 0,
+ GridAnchorGenerator = 1,
+ SsdAnchorGenerator = 2,
+ MultiscaleAnchorGenerator = 3,
+ FlexibleGridAnchorGenerator = 4,
+ }
+ private AnchorGeneratorOneofOneofCase anchorGeneratorOneofCase_ = AnchorGeneratorOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGeneratorOneofOneofCase AnchorGeneratorOneofCase {
+ get { return anchorGeneratorOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearAnchorGeneratorOneof() {
+ anchorGeneratorOneofCase_ = AnchorGeneratorOneofOneofCase.None;
+ anchorGeneratorOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as AnchorGenerator);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(AnchorGenerator other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(GridAnchorGenerator, other.GridAnchorGenerator)) return false;
+ if (!object.Equals(SsdAnchorGenerator, other.SsdAnchorGenerator)) return false;
+ if (!object.Equals(MultiscaleAnchorGenerator, other.MultiscaleAnchorGenerator)) return false;
+ if (!object.Equals(FlexibleGridAnchorGenerator, other.FlexibleGridAnchorGenerator)) return false;
+ if (AnchorGeneratorOneofCase != other.AnchorGeneratorOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.GridAnchorGenerator) hash ^= GridAnchorGenerator.GetHashCode();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.SsdAnchorGenerator) hash ^= SsdAnchorGenerator.GetHashCode();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator) hash ^= MultiscaleAnchorGenerator.GetHashCode();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator) hash ^= FlexibleGridAnchorGenerator.GetHashCode();
+ hash ^= (int) anchorGeneratorOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.GridAnchorGenerator) {
+ output.WriteRawTag(10);
+ output.WriteMessage(GridAnchorGenerator);
+ }
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.SsdAnchorGenerator) {
+ output.WriteRawTag(18);
+ output.WriteMessage(SsdAnchorGenerator);
+ }
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator) {
+ output.WriteRawTag(26);
+ output.WriteMessage(MultiscaleAnchorGenerator);
+ }
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator) {
+ output.WriteRawTag(34);
+ output.WriteMessage(FlexibleGridAnchorGenerator);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.GridAnchorGenerator) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(GridAnchorGenerator);
+ }
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.SsdAnchorGenerator) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(SsdAnchorGenerator);
+ }
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(MultiscaleAnchorGenerator);
+ }
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FlexibleGridAnchorGenerator);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(AnchorGenerator other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.AnchorGeneratorOneofCase) {
+ case AnchorGeneratorOneofOneofCase.GridAnchorGenerator:
+ if (GridAnchorGenerator == null) {
+ GridAnchorGenerator = new global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator();
+ }
+ GridAnchorGenerator.MergeFrom(other.GridAnchorGenerator);
+ break;
+ case AnchorGeneratorOneofOneofCase.SsdAnchorGenerator:
+ if (SsdAnchorGenerator == null) {
+ SsdAnchorGenerator = new global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator();
+ }
+ SsdAnchorGenerator.MergeFrom(other.SsdAnchorGenerator);
+ break;
+ case AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator:
+ if (MultiscaleAnchorGenerator == null) {
+ MultiscaleAnchorGenerator = new global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator();
+ }
+ MultiscaleAnchorGenerator.MergeFrom(other.MultiscaleAnchorGenerator);
+ break;
+ case AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator:
+ if (FlexibleGridAnchorGenerator == null) {
+ FlexibleGridAnchorGenerator = new global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator();
+ }
+ FlexibleGridAnchorGenerator.MergeFrom(other.FlexibleGridAnchorGenerator);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.GridAnchorGenerator) {
+ subBuilder.MergeFrom(GridAnchorGenerator);
+ }
+ input.ReadMessage(subBuilder);
+ GridAnchorGenerator = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.SsdAnchorGenerator) {
+ subBuilder.MergeFrom(SsdAnchorGenerator);
+ }
+ input.ReadMessage(subBuilder);
+ SsdAnchorGenerator = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.MultiscaleAnchorGenerator) {
+ subBuilder.MergeFrom(MultiscaleAnchorGenerator);
+ }
+ input.ReadMessage(subBuilder);
+ MultiscaleAnchorGenerator = subBuilder;
+ break;
+ }
+ case 34: {
+ global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator();
+ if (anchorGeneratorOneofCase_ == AnchorGeneratorOneofOneofCase.FlexibleGridAnchorGenerator) {
+ subBuilder.MergeFrom(FlexibleGridAnchorGenerator);
+ }
+ input.ReadMessage(subBuilder);
+ FlexibleGridAnchorGenerator = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs
new file mode 100644
index 00000000..c967c034
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs
@@ -0,0 +1,343 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/argmax_matcher.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/argmax_matcher.proto
+ public static partial class ArgmaxMatcherReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/argmax_matcher.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static ArgmaxMatcherReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CixvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9hcmdtYXhfbWF0Y2hlci5wcm90",
+ "bxIXb2JqZWN0X2RldGVjdGlvbi5wcm90b3MixwEKDUFyZ01heE1hdGNoZXIS",
+ "GQoRbWF0Y2hlZF90aHJlc2hvbGQYASABKAISGwoTdW5tYXRjaGVkX3RocmVz",
+ "aG9sZBgCIAEoAhIZChFpZ25vcmVfdGhyZXNob2xkcxgDIAEoCBImCh5uZWdh",
+ "dGl2ZXNfbG93ZXJfdGhhbl91bm1hdGNoZWQYBCABKAgSIAoYZm9yY2VfbWF0",
+ "Y2hfZm9yX2VhY2hfcm93GAUgASgIEhkKEXVzZV9tYXRtdWxfZ2F0aGVyGAYg",
+ "ASgIYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ArgMaxMatcher), global::Tensorflow.Models.ObjectDetection.Protos.ArgMaxMatcher.Parser, new[]{ "MatchedThreshold", "UnmatchedThreshold", "IgnoreThresholds", "NegativesLowerThanUnmatched", "ForceMatchForEachRow", "UseMatmulGather" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for ArgMaxMatcher. See
+ /// matchers/argmax_matcher.py for details.
+ ///
+ public sealed partial class ArgMaxMatcher : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ArgMaxMatcher());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ArgmaxMatcherReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ArgMaxMatcher() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ArgMaxMatcher(ArgMaxMatcher other) : this() {
+ matchedThreshold_ = other.matchedThreshold_;
+ unmatchedThreshold_ = other.unmatchedThreshold_;
+ ignoreThresholds_ = other.ignoreThresholds_;
+ negativesLowerThanUnmatched_ = other.negativesLowerThanUnmatched_;
+ forceMatchForEachRow_ = other.forceMatchForEachRow_;
+ useMatmulGather_ = other.useMatmulGather_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ArgMaxMatcher Clone() {
+ return new ArgMaxMatcher(this);
+ }
+
+ /// Field number for the "matched_threshold" field.
+ public const int MatchedThresholdFieldNumber = 1;
+ private float matchedThreshold_;
+ ///
+ /// Threshold for positive matches.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float MatchedThreshold {
+ get { return matchedThreshold_; }
+ set {
+ matchedThreshold_ = value;
+ }
+ }
+
+ /// Field number for the "unmatched_threshold" field.
+ public const int UnmatchedThresholdFieldNumber = 2;
+ private float unmatchedThreshold_;
+ ///
+ /// Threshold for negative matches.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float UnmatchedThreshold {
+ get { return unmatchedThreshold_; }
+ set {
+ unmatchedThreshold_ = value;
+ }
+ }
+
+ /// Field number for the "ignore_thresholds" field.
+ public const int IgnoreThresholdsFieldNumber = 3;
+ private bool ignoreThresholds_;
+ ///
+ /// Whether to construct ArgMaxMatcher without thresholds.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool IgnoreThresholds {
+ get { return ignoreThresholds_; }
+ set {
+ ignoreThresholds_ = value;
+ }
+ }
+
+ /// Field number for the "negatives_lower_than_unmatched" field.
+ public const int NegativesLowerThanUnmatchedFieldNumber = 4;
+ private bool negativesLowerThanUnmatched_;
+ ///
+ /// If True then negative matches are the ones below the unmatched_threshold,
+ /// whereas ignored matches are in between the matched and umatched
+ /// threshold. If False, then negative matches are in between the matched
+ /// and unmatched threshold, and everything lower than unmatched is ignored.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool NegativesLowerThanUnmatched {
+ get { return negativesLowerThanUnmatched_; }
+ set {
+ negativesLowerThanUnmatched_ = value;
+ }
+ }
+
+ /// Field number for the "force_match_for_each_row" field.
+ public const int ForceMatchForEachRowFieldNumber = 5;
+ private bool forceMatchForEachRow_;
+ ///
+ /// Whether to ensure each row is matched to at least one column.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ForceMatchForEachRow {
+ get { return forceMatchForEachRow_; }
+ set {
+ forceMatchForEachRow_ = value;
+ }
+ }
+
+ /// Field number for the "use_matmul_gather" field.
+ public const int UseMatmulGatherFieldNumber = 6;
+ private bool useMatmulGather_;
+ ///
+ /// Force constructed match objects to use matrix multiplication based gather
+ /// instead of standard tf.gather
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseMatmulGather {
+ get { return useMatmulGather_; }
+ set {
+ useMatmulGather_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ArgMaxMatcher);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ArgMaxMatcher other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MatchedThreshold, other.MatchedThreshold)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(UnmatchedThreshold, other.UnmatchedThreshold)) return false;
+ if (IgnoreThresholds != other.IgnoreThresholds) return false;
+ if (NegativesLowerThanUnmatched != other.NegativesLowerThanUnmatched) return false;
+ if (ForceMatchForEachRow != other.ForceMatchForEachRow) return false;
+ if (UseMatmulGather != other.UseMatmulGather) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (MatchedThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MatchedThreshold);
+ if (UnmatchedThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(UnmatchedThreshold);
+ if (IgnoreThresholds != false) hash ^= IgnoreThresholds.GetHashCode();
+ if (NegativesLowerThanUnmatched != false) hash ^= NegativesLowerThanUnmatched.GetHashCode();
+ if (ForceMatchForEachRow != false) hash ^= ForceMatchForEachRow.GetHashCode();
+ if (UseMatmulGather != false) hash ^= UseMatmulGather.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (MatchedThreshold != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(MatchedThreshold);
+ }
+ if (UnmatchedThreshold != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(UnmatchedThreshold);
+ }
+ if (IgnoreThresholds != false) {
+ output.WriteRawTag(24);
+ output.WriteBool(IgnoreThresholds);
+ }
+ if (NegativesLowerThanUnmatched != false) {
+ output.WriteRawTag(32);
+ output.WriteBool(NegativesLowerThanUnmatched);
+ }
+ if (ForceMatchForEachRow != false) {
+ output.WriteRawTag(40);
+ output.WriteBool(ForceMatchForEachRow);
+ }
+ if (UseMatmulGather != false) {
+ output.WriteRawTag(48);
+ output.WriteBool(UseMatmulGather);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (MatchedThreshold != 0F) {
+ size += 1 + 4;
+ }
+ if (UnmatchedThreshold != 0F) {
+ size += 1 + 4;
+ }
+ if (IgnoreThresholds != false) {
+ size += 1 + 1;
+ }
+ if (NegativesLowerThanUnmatched != false) {
+ size += 1 + 1;
+ }
+ if (ForceMatchForEachRow != false) {
+ size += 1 + 1;
+ }
+ if (UseMatmulGather != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ArgMaxMatcher other) {
+ if (other == null) {
+ return;
+ }
+ if (other.MatchedThreshold != 0F) {
+ MatchedThreshold = other.MatchedThreshold;
+ }
+ if (other.UnmatchedThreshold != 0F) {
+ UnmatchedThreshold = other.UnmatchedThreshold;
+ }
+ if (other.IgnoreThresholds != false) {
+ IgnoreThresholds = other.IgnoreThresholds;
+ }
+ if (other.NegativesLowerThanUnmatched != false) {
+ NegativesLowerThanUnmatched = other.NegativesLowerThanUnmatched;
+ }
+ if (other.ForceMatchForEachRow != false) {
+ ForceMatchForEachRow = other.ForceMatchForEachRow;
+ }
+ if (other.UseMatmulGather != false) {
+ UseMatmulGather = other.UseMatmulGather;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ MatchedThreshold = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ UnmatchedThreshold = input.ReadFloat();
+ break;
+ }
+ case 24: {
+ IgnoreThresholds = input.ReadBool();
+ break;
+ }
+ case 32: {
+ NegativesLowerThanUnmatched = input.ReadBool();
+ break;
+ }
+ case 40: {
+ ForceMatchForEachRow = input.ReadBool();
+ break;
+ }
+ case 48: {
+ UseMatmulGather = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs
new file mode 100644
index 00000000..5ead27f5
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs
@@ -0,0 +1,181 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/bipartite_matcher.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/bipartite_matcher.proto
+ public static partial class BipartiteMatcherReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/bipartite_matcher.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static BipartiteMatcherReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "Ci9vYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9iaXBhcnRpdGVfbWF0Y2hlci5w",
+ "cm90bxIXb2JqZWN0X2RldGVjdGlvbi5wcm90b3MiLQoQQmlwYXJ0aXRlTWF0",
+ "Y2hlchIZChF1c2VfbWF0bXVsX2dhdGhlchgGIAEoCGIGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher), global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher.Parser, new[]{ "UseMatmulGather" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for bipartite matcher. See
+ /// matchers/bipartite_matcher.py for details.
+ ///
+ public sealed partial class BipartiteMatcher : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BipartiteMatcher());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcherReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BipartiteMatcher() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BipartiteMatcher(BipartiteMatcher other) : this() {
+ useMatmulGather_ = other.useMatmulGather_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BipartiteMatcher Clone() {
+ return new BipartiteMatcher(this);
+ }
+
+ /// Field number for the "use_matmul_gather" field.
+ public const int UseMatmulGatherFieldNumber = 6;
+ private bool useMatmulGather_;
+ ///
+ /// Force constructed match objects to use matrix multiplication based gather
+ /// instead of standard tf.gather
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseMatmulGather {
+ get { return useMatmulGather_; }
+ set {
+ useMatmulGather_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as BipartiteMatcher);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(BipartiteMatcher other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (UseMatmulGather != other.UseMatmulGather) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (UseMatmulGather != false) hash ^= UseMatmulGather.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (UseMatmulGather != false) {
+ output.WriteRawTag(48);
+ output.WriteBool(UseMatmulGather);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (UseMatmulGather != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(BipartiteMatcher other) {
+ if (other == null) {
+ return;
+ }
+ if (other.UseMatmulGather != false) {
+ UseMatmulGather = other.UseMatmulGather;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 48: {
+ UseMatmulGather = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs
new file mode 100644
index 00000000..d13d3326
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs
@@ -0,0 +1,341 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/box_coder.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/box_coder.proto
+ public static partial class BoxCoderReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/box_coder.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static BoxCoderReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CidvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9ib3hfY29kZXIucHJvdG8SF29i",
+ "amVjdF9kZXRlY3Rpb24ucHJvdG9zGjNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rv",
+ "cy9mYXN0ZXJfcmNubl9ib3hfY29kZXIucHJvdG8aMG9iamVjdF9kZXRlY3Rp",
+ "b24vcHJvdG9zL2tleXBvaW50X2JveF9jb2Rlci5wcm90bxozb2JqZWN0X2Rl",
+ "dGVjdGlvbi9wcm90b3MvbWVhbl9zdGRkZXZfYm94X2NvZGVyLnByb3RvGi5v",
+ "YmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9zcXVhcmVfYm94X2NvZGVyLnByb3Rv",
+ "IscCCghCb3hDb2RlchJMChVmYXN0ZXJfcmNubl9ib3hfY29kZXIYASABKAsy",
+ "Ky5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5GYXN0ZXJSY25uQm94Q29kZXJI",
+ "ABJMChVtZWFuX3N0ZGRldl9ib3hfY29kZXIYAiABKAsyKy5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5NZWFuU3RkZGV2Qm94Q29kZXJIABJDChBzcXVhcmVf",
+ "Ym94X2NvZGVyGAMgASgLMicub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuU3F1",
+ "YXJlQm94Q29kZXJIABJHChJrZXlwb2ludF9ib3hfY29kZXIYBCABKAsyKS5v",
+ "YmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5LZXlwb2ludEJveENvZGVySABCEQoP",
+ "Ym94X2NvZGVyX29uZW9mYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoderReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoderReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoderReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoderReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BoxCoder), global::Tensorflow.Models.ObjectDetection.Protos.BoxCoder.Parser, new[]{ "FasterRcnnBoxCoder", "MeanStddevBoxCoder", "SquareBoxCoder", "KeypointBoxCoder" }, new[]{ "BoxCoderOneof" }, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for the box coder to be used in the object detection
+ /// pipeline. See core/box_coder.py for details.
+ ///
+ public sealed partial class BoxCoder : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxCoder());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BoxCoderReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxCoder() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxCoder(BoxCoder other) : this() {
+ switch (other.BoxCoderOneofCase) {
+ case BoxCoderOneofOneofCase.FasterRcnnBoxCoder:
+ FasterRcnnBoxCoder = other.FasterRcnnBoxCoder.Clone();
+ break;
+ case BoxCoderOneofOneofCase.MeanStddevBoxCoder:
+ MeanStddevBoxCoder = other.MeanStddevBoxCoder.Clone();
+ break;
+ case BoxCoderOneofOneofCase.SquareBoxCoder:
+ SquareBoxCoder = other.SquareBoxCoder.Clone();
+ break;
+ case BoxCoderOneofOneofCase.KeypointBoxCoder:
+ KeypointBoxCoder = other.KeypointBoxCoder.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxCoder Clone() {
+ return new BoxCoder(this);
+ }
+
+ /// Field number for the "faster_rcnn_box_coder" field.
+ public const int FasterRcnnBoxCoderFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder FasterRcnnBoxCoder {
+ get { return boxCoderOneofCase_ == BoxCoderOneofOneofCase.FasterRcnnBoxCoder ? (global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder) boxCoderOneof_ : null; }
+ set {
+ boxCoderOneof_ = value;
+ boxCoderOneofCase_ = value == null ? BoxCoderOneofOneofCase.None : BoxCoderOneofOneofCase.FasterRcnnBoxCoder;
+ }
+ }
+
+ /// Field number for the "mean_stddev_box_coder" field.
+ public const int MeanStddevBoxCoderFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder MeanStddevBoxCoder {
+ get { return boxCoderOneofCase_ == BoxCoderOneofOneofCase.MeanStddevBoxCoder ? (global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder) boxCoderOneof_ : null; }
+ set {
+ boxCoderOneof_ = value;
+ boxCoderOneofCase_ = value == null ? BoxCoderOneofOneofCase.None : BoxCoderOneofOneofCase.MeanStddevBoxCoder;
+ }
+ }
+
+ /// Field number for the "square_box_coder" field.
+ public const int SquareBoxCoderFieldNumber = 3;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder SquareBoxCoder {
+ get { return boxCoderOneofCase_ == BoxCoderOneofOneofCase.SquareBoxCoder ? (global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder) boxCoderOneof_ : null; }
+ set {
+ boxCoderOneof_ = value;
+ boxCoderOneofCase_ = value == null ? BoxCoderOneofOneofCase.None : BoxCoderOneofOneofCase.SquareBoxCoder;
+ }
+ }
+
+ /// Field number for the "keypoint_box_coder" field.
+ public const int KeypointBoxCoderFieldNumber = 4;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder KeypointBoxCoder {
+ get { return boxCoderOneofCase_ == BoxCoderOneofOneofCase.KeypointBoxCoder ? (global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder) boxCoderOneof_ : null; }
+ set {
+ boxCoderOneof_ = value;
+ boxCoderOneofCase_ = value == null ? BoxCoderOneofOneofCase.None : BoxCoderOneofOneofCase.KeypointBoxCoder;
+ }
+ }
+
+ private object boxCoderOneof_;
+ /// Enum of possible cases for the "box_coder_oneof" oneof.
+ public enum BoxCoderOneofOneofCase {
+ None = 0,
+ FasterRcnnBoxCoder = 1,
+ MeanStddevBoxCoder = 2,
+ SquareBoxCoder = 3,
+ KeypointBoxCoder = 4,
+ }
+ private BoxCoderOneofOneofCase boxCoderOneofCase_ = BoxCoderOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxCoderOneofOneofCase BoxCoderOneofCase {
+ get { return boxCoderOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearBoxCoderOneof() {
+ boxCoderOneofCase_ = BoxCoderOneofOneofCase.None;
+ boxCoderOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as BoxCoder);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(BoxCoder other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(FasterRcnnBoxCoder, other.FasterRcnnBoxCoder)) return false;
+ if (!object.Equals(MeanStddevBoxCoder, other.MeanStddevBoxCoder)) return false;
+ if (!object.Equals(SquareBoxCoder, other.SquareBoxCoder)) return false;
+ if (!object.Equals(KeypointBoxCoder, other.KeypointBoxCoder)) return false;
+ if (BoxCoderOneofCase != other.BoxCoderOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.FasterRcnnBoxCoder) hash ^= FasterRcnnBoxCoder.GetHashCode();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.MeanStddevBoxCoder) hash ^= MeanStddevBoxCoder.GetHashCode();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.SquareBoxCoder) hash ^= SquareBoxCoder.GetHashCode();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.KeypointBoxCoder) hash ^= KeypointBoxCoder.GetHashCode();
+ hash ^= (int) boxCoderOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.FasterRcnnBoxCoder) {
+ output.WriteRawTag(10);
+ output.WriteMessage(FasterRcnnBoxCoder);
+ }
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.MeanStddevBoxCoder) {
+ output.WriteRawTag(18);
+ output.WriteMessage(MeanStddevBoxCoder);
+ }
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.SquareBoxCoder) {
+ output.WriteRawTag(26);
+ output.WriteMessage(SquareBoxCoder);
+ }
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.KeypointBoxCoder) {
+ output.WriteRawTag(34);
+ output.WriteMessage(KeypointBoxCoder);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.FasterRcnnBoxCoder) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FasterRcnnBoxCoder);
+ }
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.MeanStddevBoxCoder) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(MeanStddevBoxCoder);
+ }
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.SquareBoxCoder) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(SquareBoxCoder);
+ }
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.KeypointBoxCoder) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(KeypointBoxCoder);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(BoxCoder other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.BoxCoderOneofCase) {
+ case BoxCoderOneofOneofCase.FasterRcnnBoxCoder:
+ if (FasterRcnnBoxCoder == null) {
+ FasterRcnnBoxCoder = new global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder();
+ }
+ FasterRcnnBoxCoder.MergeFrom(other.FasterRcnnBoxCoder);
+ break;
+ case BoxCoderOneofOneofCase.MeanStddevBoxCoder:
+ if (MeanStddevBoxCoder == null) {
+ MeanStddevBoxCoder = new global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder();
+ }
+ MeanStddevBoxCoder.MergeFrom(other.MeanStddevBoxCoder);
+ break;
+ case BoxCoderOneofOneofCase.SquareBoxCoder:
+ if (SquareBoxCoder == null) {
+ SquareBoxCoder = new global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder();
+ }
+ SquareBoxCoder.MergeFrom(other.SquareBoxCoder);
+ break;
+ case BoxCoderOneofOneofCase.KeypointBoxCoder:
+ if (KeypointBoxCoder == null) {
+ KeypointBoxCoder = new global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder();
+ }
+ KeypointBoxCoder.MergeFrom(other.KeypointBoxCoder);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.FasterRcnnBoxCoder) {
+ subBuilder.MergeFrom(FasterRcnnBoxCoder);
+ }
+ input.ReadMessage(subBuilder);
+ FasterRcnnBoxCoder = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.MeanStddevBoxCoder) {
+ subBuilder.MergeFrom(MeanStddevBoxCoder);
+ }
+ input.ReadMessage(subBuilder);
+ MeanStddevBoxCoder = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.SquareBoxCoder) {
+ subBuilder.MergeFrom(SquareBoxCoder);
+ }
+ input.ReadMessage(subBuilder);
+ SquareBoxCoder = subBuilder;
+ break;
+ }
+ case 34: {
+ global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder();
+ if (boxCoderOneofCase_ == BoxCoderOneofOneofCase.KeypointBoxCoder) {
+ subBuilder.MergeFrom(KeypointBoxCoder);
+ }
+ input.ReadMessage(subBuilder);
+ KeypointBoxCoder = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs
new file mode 100644
index 00000000..382c0d21
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs
@@ -0,0 +1,2587 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/box_predictor.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/box_predictor.proto
+ public static partial class BoxPredictorReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/box_predictor.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static BoxPredictorReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CitvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9ib3hfcHJlZGljdG9yLnByb3Rv",
+ "EhdvYmplY3RfZGV0ZWN0aW9uLnByb3Rvcxopb2JqZWN0X2RldGVjdGlvbi9w",
+ "cm90b3MvaHlwZXJwYXJhbXMucHJvdG8ikAMKDEJveFByZWRpY3RvchJZChtj",
+ "b252b2x1dGlvbmFsX2JveF9wcmVkaWN0b3IYASABKAsyMi5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5Db252b2x1dGlvbmFsQm94UHJlZGljdG9ySAASUAoX",
+ "bWFza19yY25uX2JveF9wcmVkaWN0b3IYAiABKAsyLS5vYmplY3RfZGV0ZWN0",
+ "aW9uLnByb3Rvcy5NYXNrUkNOTkJveFByZWRpY3RvckgAEkcKEnJmY25fYm94",
+ "X3ByZWRpY3RvchgDIAEoCzIpLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJm",
+ "Y25Cb3hQcmVkaWN0b3JIABJzCil3ZWlnaHRfc2hhcmVkX2NvbnZvbHV0aW9u",
+ "YWxfYm94X3ByZWRpY3RvchgEIAEoCzI+Lm9iamVjdF9kZXRlY3Rpb24ucHJv",
+ "dG9zLldlaWdodFNoYXJlZENvbnZvbHV0aW9uYWxCb3hQcmVkaWN0b3JIAEIV",
+ "ChNib3hfcHJlZGljdG9yX29uZW9mIoQEChlDb252b2x1dGlvbmFsQm94UHJl",
+ "ZGljdG9yEj4KEGNvbnZfaHlwZXJwYXJhbXMYASABKAsyJC5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5IeXBlcnBhcmFtcxIRCgltaW5fZGVwdGgYAiABKAUS",
+ "EQoJbWF4X2RlcHRoGAMgASgFEiMKG251bV9sYXllcnNfYmVmb3JlX3ByZWRp",
+ "Y3RvchgEIAEoBRITCgt1c2VfZHJvcG91dBgFIAEoCBIgChhkcm9wb3V0X2tl",
+ "ZXBfcHJvYmFiaWxpdHkYBiABKAISEwoLa2VybmVsX3NpemUYByABKAUSFQoN",
+ "Ym94X2NvZGVfc2l6ZRgIIAEoBRIfChdhcHBseV9zaWdtb2lkX3RvX3Njb3Jl",
+ "cxgJIAEoCBIiChpjbGFzc19wcmVkaWN0aW9uX2JpYXNfaW5pdBgKIAEoAhIV",
+ "Cg11c2VfZGVwdGh3aXNlGAsgASgIEmoKGGJveF9lbmNvZGluZ3NfY2xpcF9y",
+ "YW5nZRgMIAEoCzJILm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLkNvbnZvbHV0",
+ "aW9uYWxCb3hQcmVkaWN0b3IuQm94RW5jb2RpbmdzQ2xpcFJhbmdlGjEKFUJv",
+ "eEVuY29kaW5nc0NsaXBSYW5nZRILCgNtaW4YASABKAISCwoDbWF4GAIgASgC",
+ "IpkFCiVXZWlnaHRTaGFyZWRDb252b2x1dGlvbmFsQm94UHJlZGljdG9yEj4K",
+ "EGNvbnZfaHlwZXJwYXJhbXMYASABKAsyJC5vYmplY3RfZGV0ZWN0aW9uLnBy",
+ "b3Rvcy5IeXBlcnBhcmFtcxIjChtudW1fbGF5ZXJzX2JlZm9yZV9wcmVkaWN0",
+ "b3IYBCABKAUSDQoFZGVwdGgYAiABKAUSEwoLa2VybmVsX3NpemUYByABKAUS",
+ "FQoNYm94X2NvZGVfc2l6ZRgIIAEoBRIiChpjbGFzc19wcmVkaWN0aW9uX2Jp",
+ "YXNfaW5pdBgKIAEoAhITCgt1c2VfZHJvcG91dBgLIAEoCBIgChhkcm9wb3V0",
+ "X2tlZXBfcHJvYmFiaWxpdHkYDCABKAISHgoWc2hhcmVfcHJlZGljdGlvbl90",
+ "b3dlchgNIAEoCBIVCg11c2VfZGVwdGh3aXNlGA4gASgIEmYKD3Njb3JlX2Nv",
+ "bnZlcnRlchgQIAEoDjJNLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLldlaWdo",
+ "dFNoYXJlZENvbnZvbHV0aW9uYWxCb3hQcmVkaWN0b3IuU2NvcmVDb252ZXJ0",
+ "ZXISdgoYYm94X2VuY29kaW5nc19jbGlwX3JhbmdlGBEgASgLMlQub2JqZWN0",
+ "X2RldGVjdGlvbi5wcm90b3MuV2VpZ2h0U2hhcmVkQ29udm9sdXRpb25hbEJv",
+ "eFByZWRpY3Rvci5Cb3hFbmNvZGluZ3NDbGlwUmFuZ2UaMQoVQm94RW5jb2Rp",
+ "bmdzQ2xpcFJhbmdlEgsKA21pbhgBIAEoAhILCgNtYXgYAiABKAIiKwoOU2Nv",
+ "cmVDb252ZXJ0ZXISDAoISURFTlRJVFkQABILCgdTSUdNT0lEEAEi/QMKFE1h",
+ "c2tSQ05OQm94UHJlZGljdG9yEjwKDmZjX2h5cGVycGFyYW1zGAEgASgLMiQu",
+ "b2JqZWN0X2RldGVjdGlvbi5wcm90b3MuSHlwZXJwYXJhbXMSEwoLdXNlX2Ry",
+ "b3BvdXQYAiABKAgSIAoYZHJvcG91dF9rZWVwX3Byb2JhYmlsaXR5GAMgASgC",
+ "EhUKDWJveF9jb2RlX3NpemUYBCABKAUSPgoQY29udl9oeXBlcnBhcmFtcxgF",
+ "IAEoCzIkLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLkh5cGVycGFyYW1zEh4K",
+ "FnByZWRpY3RfaW5zdGFuY2VfbWFza3MYBiABKAgSIgoabWFza19wcmVkaWN0",
+ "aW9uX2NvbnZfZGVwdGgYByABKAUSGQoRcHJlZGljdF9rZXlwb2ludHMYCCAB",
+ "KAgSEwoLbWFza19oZWlnaHQYCSABKAUSEgoKbWFza193aWR0aBgKIAEoBRIn",
+ "Ch9tYXNrX3ByZWRpY3Rpb25fbnVtX2NvbnZfbGF5ZXJzGAsgASgFEiAKGG1h",
+ "c2tzX2FyZV9jbGFzc19hZ25vc3RpYxgMIAEoCBIgChhzaGFyZV9ib3hfYWNy",
+ "b3NzX2NsYXNzZXMYDSABKAgSJAocY29udm9sdmVfdGhlbl91cHNhbXBsZV9t",
+ "YXNrcxgOIAEoCCLiAQoQUmZjbkJveFByZWRpY3RvchI+ChBjb252X2h5cGVy",
+ "cGFyYW1zGAEgASgLMiQub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuSHlwZXJw",
+ "YXJhbXMSHwoXbnVtX3NwYXRpYWxfYmluc19oZWlnaHQYAiABKAUSHgoWbnVt",
+ "X3NwYXRpYWxfYmluc193aWR0aBgDIAEoBRINCgVkZXB0aBgEIAEoBRIVCg1i",
+ "b3hfY29kZV9zaXplGAUgASgFEhMKC2Nyb3BfaGVpZ2h0GAYgASgFEhIKCmNy",
+ "b3Bfd2lkdGgYByABKAViBnByb3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor), global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor.Parser, new[]{ "ConvolutionalBoxPredictor", "MaskRcnnBoxPredictor", "RfcnBoxPredictor", "WeightSharedConvolutionalBoxPredictor" }, new[]{ "BoxPredictorOneof" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor), global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Parser, new[]{ "ConvHyperparams", "MinDepth", "MaxDepth", "NumLayersBeforePredictor", "UseDropout", "DropoutKeepProbability", "KernelSize", "BoxCodeSize", "ApplySigmoidToScores", "ClassPredictionBiasInit", "UseDepthwise", "BoxEncodingsClipRange" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Types.BoxEncodingsClipRange), global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Types.BoxEncodingsClipRange.Parser, new[]{ "Min", "Max" }, null, null, null)}),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor), global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Parser, new[]{ "ConvHyperparams", "NumLayersBeforePredictor", "Depth", "KernelSize", "BoxCodeSize", "ClassPredictionBiasInit", "UseDropout", "DropoutKeepProbability", "SharePredictionTower", "UseDepthwise", "ScoreConverter", "BoxEncodingsClipRange" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.ScoreConverter) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.BoxEncodingsClipRange), global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.BoxEncodingsClipRange.Parser, new[]{ "Min", "Max" }, null, null, null)}),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor), global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor.Parser, new[]{ "FcHyperparams", "UseDropout", "DropoutKeepProbability", "BoxCodeSize", "ConvHyperparams", "PredictInstanceMasks", "MaskPredictionConvDepth", "PredictKeypoints", "MaskHeight", "MaskWidth", "MaskPredictionNumConvLayers", "MasksAreClassAgnostic", "ShareBoxAcrossClasses", "ConvolveThenUpsampleMasks" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor), global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor.Parser, new[]{ "ConvHyperparams", "NumSpatialBinsHeight", "NumSpatialBinsWidth", "Depth", "BoxCodeSize", "CropHeight", "CropWidth" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for box predictor. See core/box_predictor.py for details.
+ ///
+ public sealed partial class BoxPredictor : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxPredictor());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictorReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxPredictor() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxPredictor(BoxPredictor other) : this() {
+ switch (other.BoxPredictorOneofCase) {
+ case BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor:
+ ConvolutionalBoxPredictor = other.ConvolutionalBoxPredictor.Clone();
+ break;
+ case BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor:
+ MaskRcnnBoxPredictor = other.MaskRcnnBoxPredictor.Clone();
+ break;
+ case BoxPredictorOneofOneofCase.RfcnBoxPredictor:
+ RfcnBoxPredictor = other.RfcnBoxPredictor.Clone();
+ break;
+ case BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor:
+ WeightSharedConvolutionalBoxPredictor = other.WeightSharedConvolutionalBoxPredictor.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxPredictor Clone() {
+ return new BoxPredictor(this);
+ }
+
+ /// Field number for the "convolutional_box_predictor" field.
+ public const int ConvolutionalBoxPredictorFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor ConvolutionalBoxPredictor {
+ get { return boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor ? (global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor) boxPredictorOneof_ : null; }
+ set {
+ boxPredictorOneof_ = value;
+ boxPredictorOneofCase_ = value == null ? BoxPredictorOneofOneofCase.None : BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor;
+ }
+ }
+
+ /// Field number for the "mask_rcnn_box_predictor" field.
+ public const int MaskRcnnBoxPredictorFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor MaskRcnnBoxPredictor {
+ get { return boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor ? (global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor) boxPredictorOneof_ : null; }
+ set {
+ boxPredictorOneof_ = value;
+ boxPredictorOneofCase_ = value == null ? BoxPredictorOneofOneofCase.None : BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor;
+ }
+ }
+
+ /// Field number for the "rfcn_box_predictor" field.
+ public const int RfcnBoxPredictorFieldNumber = 3;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor RfcnBoxPredictor {
+ get { return boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.RfcnBoxPredictor ? (global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor) boxPredictorOneof_ : null; }
+ set {
+ boxPredictorOneof_ = value;
+ boxPredictorOneofCase_ = value == null ? BoxPredictorOneofOneofCase.None : BoxPredictorOneofOneofCase.RfcnBoxPredictor;
+ }
+ }
+
+ /// Field number for the "weight_shared_convolutional_box_predictor" field.
+ public const int WeightSharedConvolutionalBoxPredictorFieldNumber = 4;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor WeightSharedConvolutionalBoxPredictor {
+ get { return boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor) boxPredictorOneof_ : null; }
+ set {
+ boxPredictorOneof_ = value;
+ boxPredictorOneofCase_ = value == null ? BoxPredictorOneofOneofCase.None : BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor;
+ }
+ }
+
+ private object boxPredictorOneof_;
+ /// Enum of possible cases for the "box_predictor_oneof" oneof.
+ public enum BoxPredictorOneofOneofCase {
+ None = 0,
+ ConvolutionalBoxPredictor = 1,
+ MaskRcnnBoxPredictor = 2,
+ RfcnBoxPredictor = 3,
+ WeightSharedConvolutionalBoxPredictor = 4,
+ }
+ private BoxPredictorOneofOneofCase boxPredictorOneofCase_ = BoxPredictorOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxPredictorOneofOneofCase BoxPredictorOneofCase {
+ get { return boxPredictorOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearBoxPredictorOneof() {
+ boxPredictorOneofCase_ = BoxPredictorOneofOneofCase.None;
+ boxPredictorOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as BoxPredictor);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(BoxPredictor other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(ConvolutionalBoxPredictor, other.ConvolutionalBoxPredictor)) return false;
+ if (!object.Equals(MaskRcnnBoxPredictor, other.MaskRcnnBoxPredictor)) return false;
+ if (!object.Equals(RfcnBoxPredictor, other.RfcnBoxPredictor)) return false;
+ if (!object.Equals(WeightSharedConvolutionalBoxPredictor, other.WeightSharedConvolutionalBoxPredictor)) return false;
+ if (BoxPredictorOneofCase != other.BoxPredictorOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor) hash ^= ConvolutionalBoxPredictor.GetHashCode();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor) hash ^= MaskRcnnBoxPredictor.GetHashCode();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.RfcnBoxPredictor) hash ^= RfcnBoxPredictor.GetHashCode();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor) hash ^= WeightSharedConvolutionalBoxPredictor.GetHashCode();
+ hash ^= (int) boxPredictorOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor) {
+ output.WriteRawTag(10);
+ output.WriteMessage(ConvolutionalBoxPredictor);
+ }
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor) {
+ output.WriteRawTag(18);
+ output.WriteMessage(MaskRcnnBoxPredictor);
+ }
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.RfcnBoxPredictor) {
+ output.WriteRawTag(26);
+ output.WriteMessage(RfcnBoxPredictor);
+ }
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor) {
+ output.WriteRawTag(34);
+ output.WriteMessage(WeightSharedConvolutionalBoxPredictor);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvolutionalBoxPredictor);
+ }
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(MaskRcnnBoxPredictor);
+ }
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.RfcnBoxPredictor) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(RfcnBoxPredictor);
+ }
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightSharedConvolutionalBoxPredictor);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(BoxPredictor other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.BoxPredictorOneofCase) {
+ case BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor:
+ if (ConvolutionalBoxPredictor == null) {
+ ConvolutionalBoxPredictor = new global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor();
+ }
+ ConvolutionalBoxPredictor.MergeFrom(other.ConvolutionalBoxPredictor);
+ break;
+ case BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor:
+ if (MaskRcnnBoxPredictor == null) {
+ MaskRcnnBoxPredictor = new global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor();
+ }
+ MaskRcnnBoxPredictor.MergeFrom(other.MaskRcnnBoxPredictor);
+ break;
+ case BoxPredictorOneofOneofCase.RfcnBoxPredictor:
+ if (RfcnBoxPredictor == null) {
+ RfcnBoxPredictor = new global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor();
+ }
+ RfcnBoxPredictor.MergeFrom(other.RfcnBoxPredictor);
+ break;
+ case BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor:
+ if (WeightSharedConvolutionalBoxPredictor == null) {
+ WeightSharedConvolutionalBoxPredictor = new global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor();
+ }
+ WeightSharedConvolutionalBoxPredictor.MergeFrom(other.WeightSharedConvolutionalBoxPredictor);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.ConvolutionalBoxPredictor) {
+ subBuilder.MergeFrom(ConvolutionalBoxPredictor);
+ }
+ input.ReadMessage(subBuilder);
+ ConvolutionalBoxPredictor = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.MaskRCNNBoxPredictor();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.MaskRcnnBoxPredictor) {
+ subBuilder.MergeFrom(MaskRcnnBoxPredictor);
+ }
+ input.ReadMessage(subBuilder);
+ MaskRcnnBoxPredictor = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RfcnBoxPredictor();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.RfcnBoxPredictor) {
+ subBuilder.MergeFrom(RfcnBoxPredictor);
+ }
+ input.ReadMessage(subBuilder);
+ RfcnBoxPredictor = subBuilder;
+ break;
+ }
+ case 34: {
+ global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor();
+ if (boxPredictorOneofCase_ == BoxPredictorOneofOneofCase.WeightSharedConvolutionalBoxPredictor) {
+ subBuilder.MergeFrom(WeightSharedConvolutionalBoxPredictor);
+ }
+ input.ReadMessage(subBuilder);
+ WeightSharedConvolutionalBoxPredictor = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for Convolutional box predictor.
+ /// Next id: 13
+ ///
+ public sealed partial class ConvolutionalBoxPredictor : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConvolutionalBoxPredictor());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictorReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ConvolutionalBoxPredictor() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ConvolutionalBoxPredictor(ConvolutionalBoxPredictor other) : this() {
+ convHyperparams_ = other.convHyperparams_ != null ? other.convHyperparams_.Clone() : null;
+ minDepth_ = other.minDepth_;
+ maxDepth_ = other.maxDepth_;
+ numLayersBeforePredictor_ = other.numLayersBeforePredictor_;
+ useDropout_ = other.useDropout_;
+ dropoutKeepProbability_ = other.dropoutKeepProbability_;
+ kernelSize_ = other.kernelSize_;
+ boxCodeSize_ = other.boxCodeSize_;
+ applySigmoidToScores_ = other.applySigmoidToScores_;
+ classPredictionBiasInit_ = other.classPredictionBiasInit_;
+ useDepthwise_ = other.useDepthwise_;
+ boxEncodingsClipRange_ = other.boxEncodingsClipRange_ != null ? other.boxEncodingsClipRange_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ConvolutionalBoxPredictor Clone() {
+ return new ConvolutionalBoxPredictor(this);
+ }
+
+ /// Field number for the "conv_hyperparams" field.
+ public const int ConvHyperparamsFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams convHyperparams_;
+ ///
+ /// Hyperparameters for convolution ops used in the box predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams ConvHyperparams {
+ get { return convHyperparams_; }
+ set {
+ convHyperparams_ = value;
+ }
+ }
+
+ /// Field number for the "min_depth" field.
+ public const int MinDepthFieldNumber = 2;
+ private int minDepth_;
+ ///
+ /// Minimum feature depth prior to predicting box encodings and class
+ /// predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MinDepth {
+ get { return minDepth_; }
+ set {
+ minDepth_ = value;
+ }
+ }
+
+ /// Field number for the "max_depth" field.
+ public const int MaxDepthFieldNumber = 3;
+ private int maxDepth_;
+ ///
+ /// Maximum feature depth prior to predicting box encodings and class
+ /// predictions. If max_depth is set to 0, no additional feature map will be
+ /// inserted before location and class predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaxDepth {
+ get { return maxDepth_; }
+ set {
+ maxDepth_ = value;
+ }
+ }
+
+ /// Field number for the "num_layers_before_predictor" field.
+ public const int NumLayersBeforePredictorFieldNumber = 4;
+ private int numLayersBeforePredictor_;
+ ///
+ /// Number of the additional conv layers before the predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumLayersBeforePredictor {
+ get { return numLayersBeforePredictor_; }
+ set {
+ numLayersBeforePredictor_ = value;
+ }
+ }
+
+ /// Field number for the "use_dropout" field.
+ public const int UseDropoutFieldNumber = 5;
+ private bool useDropout_;
+ ///
+ /// Whether to use dropout for class prediction.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseDropout {
+ get { return useDropout_; }
+ set {
+ useDropout_ = value;
+ }
+ }
+
+ /// Field number for the "dropout_keep_probability" field.
+ public const int DropoutKeepProbabilityFieldNumber = 6;
+ private float dropoutKeepProbability_;
+ ///
+ /// Keep probability for dropout
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float DropoutKeepProbability {
+ get { return dropoutKeepProbability_; }
+ set {
+ dropoutKeepProbability_ = value;
+ }
+ }
+
+ /// Field number for the "kernel_size" field.
+ public const int KernelSizeFieldNumber = 7;
+ private int kernelSize_;
+ ///
+ /// Size of final convolution kernel. If the spatial resolution of the feature
+ /// map is smaller than the kernel size, then the kernel size is set to
+ /// min(feature_width, feature_height).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int KernelSize {
+ get { return kernelSize_; }
+ set {
+ kernelSize_ = value;
+ }
+ }
+
+ /// Field number for the "box_code_size" field.
+ public const int BoxCodeSizeFieldNumber = 8;
+ private int boxCodeSize_;
+ ///
+ /// Size of the encoding for boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int BoxCodeSize {
+ get { return boxCodeSize_; }
+ set {
+ boxCodeSize_ = value;
+ }
+ }
+
+ /// Field number for the "apply_sigmoid_to_scores" field.
+ public const int ApplySigmoidToScoresFieldNumber = 9;
+ private bool applySigmoidToScores_;
+ ///
+ /// Whether to apply sigmoid to the output of class predictions.
+ /// TODO(jonathanhuang): Do we need this since we have a post processing
+ /// module.?
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ApplySigmoidToScores {
+ get { return applySigmoidToScores_; }
+ set {
+ applySigmoidToScores_ = value;
+ }
+ }
+
+ /// Field number for the "class_prediction_bias_init" field.
+ public const int ClassPredictionBiasInitFieldNumber = 10;
+ private float classPredictionBiasInit_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float ClassPredictionBiasInit {
+ get { return classPredictionBiasInit_; }
+ set {
+ classPredictionBiasInit_ = value;
+ }
+ }
+
+ /// Field number for the "use_depthwise" field.
+ public const int UseDepthwiseFieldNumber = 11;
+ private bool useDepthwise_;
+ ///
+ /// Whether to use depthwise separable convolution for box predictor layers.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseDepthwise {
+ get { return useDepthwise_; }
+ set {
+ useDepthwise_ = value;
+ }
+ }
+
+ /// Field number for the "box_encodings_clip_range" field.
+ public const int BoxEncodingsClipRangeFieldNumber = 12;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Types.BoxEncodingsClipRange boxEncodingsClipRange_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Types.BoxEncodingsClipRange BoxEncodingsClipRange {
+ get { return boxEncodingsClipRange_; }
+ set {
+ boxEncodingsClipRange_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ConvolutionalBoxPredictor);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ConvolutionalBoxPredictor other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(ConvHyperparams, other.ConvHyperparams)) return false;
+ if (MinDepth != other.MinDepth) return false;
+ if (MaxDepth != other.MaxDepth) return false;
+ if (NumLayersBeforePredictor != other.NumLayersBeforePredictor) return false;
+ if (UseDropout != other.UseDropout) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DropoutKeepProbability, other.DropoutKeepProbability)) return false;
+ if (KernelSize != other.KernelSize) return false;
+ if (BoxCodeSize != other.BoxCodeSize) return false;
+ if (ApplySigmoidToScores != other.ApplySigmoidToScores) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ClassPredictionBiasInit, other.ClassPredictionBiasInit)) return false;
+ if (UseDepthwise != other.UseDepthwise) return false;
+ if (!object.Equals(BoxEncodingsClipRange, other.BoxEncodingsClipRange)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (convHyperparams_ != null) hash ^= ConvHyperparams.GetHashCode();
+ if (MinDepth != 0) hash ^= MinDepth.GetHashCode();
+ if (MaxDepth != 0) hash ^= MaxDepth.GetHashCode();
+ if (NumLayersBeforePredictor != 0) hash ^= NumLayersBeforePredictor.GetHashCode();
+ if (UseDropout != false) hash ^= UseDropout.GetHashCode();
+ if (DropoutKeepProbability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DropoutKeepProbability);
+ if (KernelSize != 0) hash ^= KernelSize.GetHashCode();
+ if (BoxCodeSize != 0) hash ^= BoxCodeSize.GetHashCode();
+ if (ApplySigmoidToScores != false) hash ^= ApplySigmoidToScores.GetHashCode();
+ if (ClassPredictionBiasInit != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ClassPredictionBiasInit);
+ if (UseDepthwise != false) hash ^= UseDepthwise.GetHashCode();
+ if (boxEncodingsClipRange_ != null) hash ^= BoxEncodingsClipRange.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (convHyperparams_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(ConvHyperparams);
+ }
+ if (MinDepth != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(MinDepth);
+ }
+ if (MaxDepth != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(MaxDepth);
+ }
+ if (NumLayersBeforePredictor != 0) {
+ output.WriteRawTag(32);
+ output.WriteInt32(NumLayersBeforePredictor);
+ }
+ if (UseDropout != false) {
+ output.WriteRawTag(40);
+ output.WriteBool(UseDropout);
+ }
+ if (DropoutKeepProbability != 0F) {
+ output.WriteRawTag(53);
+ output.WriteFloat(DropoutKeepProbability);
+ }
+ if (KernelSize != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(KernelSize);
+ }
+ if (BoxCodeSize != 0) {
+ output.WriteRawTag(64);
+ output.WriteInt32(BoxCodeSize);
+ }
+ if (ApplySigmoidToScores != false) {
+ output.WriteRawTag(72);
+ output.WriteBool(ApplySigmoidToScores);
+ }
+ if (ClassPredictionBiasInit != 0F) {
+ output.WriteRawTag(85);
+ output.WriteFloat(ClassPredictionBiasInit);
+ }
+ if (UseDepthwise != false) {
+ output.WriteRawTag(88);
+ output.WriteBool(UseDepthwise);
+ }
+ if (boxEncodingsClipRange_ != null) {
+ output.WriteRawTag(98);
+ output.WriteMessage(BoxEncodingsClipRange);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (convHyperparams_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvHyperparams);
+ }
+ if (MinDepth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinDepth);
+ }
+ if (MaxDepth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxDepth);
+ }
+ if (NumLayersBeforePredictor != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLayersBeforePredictor);
+ }
+ if (UseDropout != false) {
+ size += 1 + 1;
+ }
+ if (DropoutKeepProbability != 0F) {
+ size += 1 + 4;
+ }
+ if (KernelSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(KernelSize);
+ }
+ if (BoxCodeSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxCodeSize);
+ }
+ if (ApplySigmoidToScores != false) {
+ size += 1 + 1;
+ }
+ if (ClassPredictionBiasInit != 0F) {
+ size += 1 + 4;
+ }
+ if (UseDepthwise != false) {
+ size += 1 + 1;
+ }
+ if (boxEncodingsClipRange_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(BoxEncodingsClipRange);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ConvolutionalBoxPredictor other) {
+ if (other == null) {
+ return;
+ }
+ if (other.convHyperparams_ != null) {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ ConvHyperparams.MergeFrom(other.ConvHyperparams);
+ }
+ if (other.MinDepth != 0) {
+ MinDepth = other.MinDepth;
+ }
+ if (other.MaxDepth != 0) {
+ MaxDepth = other.MaxDepth;
+ }
+ if (other.NumLayersBeforePredictor != 0) {
+ NumLayersBeforePredictor = other.NumLayersBeforePredictor;
+ }
+ if (other.UseDropout != false) {
+ UseDropout = other.UseDropout;
+ }
+ if (other.DropoutKeepProbability != 0F) {
+ DropoutKeepProbability = other.DropoutKeepProbability;
+ }
+ if (other.KernelSize != 0) {
+ KernelSize = other.KernelSize;
+ }
+ if (other.BoxCodeSize != 0) {
+ BoxCodeSize = other.BoxCodeSize;
+ }
+ if (other.ApplySigmoidToScores != false) {
+ ApplySigmoidToScores = other.ApplySigmoidToScores;
+ }
+ if (other.ClassPredictionBiasInit != 0F) {
+ ClassPredictionBiasInit = other.ClassPredictionBiasInit;
+ }
+ if (other.UseDepthwise != false) {
+ UseDepthwise = other.UseDepthwise;
+ }
+ if (other.boxEncodingsClipRange_ != null) {
+ if (boxEncodingsClipRange_ == null) {
+ boxEncodingsClipRange_ = new global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Types.BoxEncodingsClipRange();
+ }
+ BoxEncodingsClipRange.MergeFrom(other.BoxEncodingsClipRange);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ input.ReadMessage(convHyperparams_);
+ break;
+ }
+ case 16: {
+ MinDepth = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ MaxDepth = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ NumLayersBeforePredictor = input.ReadInt32();
+ break;
+ }
+ case 40: {
+ UseDropout = input.ReadBool();
+ break;
+ }
+ case 53: {
+ DropoutKeepProbability = input.ReadFloat();
+ break;
+ }
+ case 56: {
+ KernelSize = input.ReadInt32();
+ break;
+ }
+ case 64: {
+ BoxCodeSize = input.ReadInt32();
+ break;
+ }
+ case 72: {
+ ApplySigmoidToScores = input.ReadBool();
+ break;
+ }
+ case 85: {
+ ClassPredictionBiasInit = input.ReadFloat();
+ break;
+ }
+ case 88: {
+ UseDepthwise = input.ReadBool();
+ break;
+ }
+ case 98: {
+ if (boxEncodingsClipRange_ == null) {
+ boxEncodingsClipRange_ = new global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Types.BoxEncodingsClipRange();
+ }
+ input.ReadMessage(boxEncodingsClipRange_);
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the ConvolutionalBoxPredictor message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ ///
+ /// If specified, apply clipping to box encodings.
+ ///
+ public sealed partial class BoxEncodingsClipRange : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxEncodingsClipRange());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ConvolutionalBoxPredictor.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxEncodingsClipRange() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxEncodingsClipRange(BoxEncodingsClipRange other) : this() {
+ min_ = other.min_;
+ max_ = other.max_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxEncodingsClipRange Clone() {
+ return new BoxEncodingsClipRange(this);
+ }
+
+ /// Field number for the "min" field.
+ public const int MinFieldNumber = 1;
+ private float min_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Min {
+ get { return min_; }
+ set {
+ min_ = value;
+ }
+ }
+
+ /// Field number for the "max" field.
+ public const int MaxFieldNumber = 2;
+ private float max_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Max {
+ get { return max_; }
+ set {
+ max_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as BoxEncodingsClipRange);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(BoxEncodingsClipRange other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Min, other.Min)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Max, other.Max)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Min != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Min);
+ if (Max != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Max);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Min != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Min);
+ }
+ if (Max != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(Max);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Min != 0F) {
+ size += 1 + 4;
+ }
+ if (Max != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(BoxEncodingsClipRange other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Min != 0F) {
+ Min = other.Min;
+ }
+ if (other.Max != 0F) {
+ Max = other.Max;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Min = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ Max = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+ #endregion
+
+ }
+
+ ///
+ /// Configuration proto for weight shared convolutional box predictor.
+ /// Next id: 18
+ ///
+ public sealed partial class WeightSharedConvolutionalBoxPredictor : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightSharedConvolutionalBoxPredictor());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictorReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public WeightSharedConvolutionalBoxPredictor() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public WeightSharedConvolutionalBoxPredictor(WeightSharedConvolutionalBoxPredictor other) : this() {
+ convHyperparams_ = other.convHyperparams_ != null ? other.convHyperparams_.Clone() : null;
+ numLayersBeforePredictor_ = other.numLayersBeforePredictor_;
+ depth_ = other.depth_;
+ kernelSize_ = other.kernelSize_;
+ boxCodeSize_ = other.boxCodeSize_;
+ classPredictionBiasInit_ = other.classPredictionBiasInit_;
+ useDropout_ = other.useDropout_;
+ dropoutKeepProbability_ = other.dropoutKeepProbability_;
+ sharePredictionTower_ = other.sharePredictionTower_;
+ useDepthwise_ = other.useDepthwise_;
+ scoreConverter_ = other.scoreConverter_;
+ boxEncodingsClipRange_ = other.boxEncodingsClipRange_ != null ? other.boxEncodingsClipRange_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public WeightSharedConvolutionalBoxPredictor Clone() {
+ return new WeightSharedConvolutionalBoxPredictor(this);
+ }
+
+ /// Field number for the "conv_hyperparams" field.
+ public const int ConvHyperparamsFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams convHyperparams_;
+ ///
+ /// Hyperparameters for convolution ops used in the box predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams ConvHyperparams {
+ get { return convHyperparams_; }
+ set {
+ convHyperparams_ = value;
+ }
+ }
+
+ /// Field number for the "num_layers_before_predictor" field.
+ public const int NumLayersBeforePredictorFieldNumber = 4;
+ private int numLayersBeforePredictor_;
+ ///
+ /// Number of the additional conv layers before the predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumLayersBeforePredictor {
+ get { return numLayersBeforePredictor_; }
+ set {
+ numLayersBeforePredictor_ = value;
+ }
+ }
+
+ /// Field number for the "depth" field.
+ public const int DepthFieldNumber = 2;
+ private int depth_;
+ ///
+ /// Output depth for the convolution ops prior to predicting box encodings
+ /// and class predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Depth {
+ get { return depth_; }
+ set {
+ depth_ = value;
+ }
+ }
+
+ /// Field number for the "kernel_size" field.
+ public const int KernelSizeFieldNumber = 7;
+ private int kernelSize_;
+ ///
+ /// Size of final convolution kernel. If the spatial resolution of the feature
+ /// map is smaller than the kernel size, then the kernel size is set to
+ /// min(feature_width, feature_height).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int KernelSize {
+ get { return kernelSize_; }
+ set {
+ kernelSize_ = value;
+ }
+ }
+
+ /// Field number for the "box_code_size" field.
+ public const int BoxCodeSizeFieldNumber = 8;
+ private int boxCodeSize_;
+ ///
+ /// Size of the encoding for boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int BoxCodeSize {
+ get { return boxCodeSize_; }
+ set {
+ boxCodeSize_ = value;
+ }
+ }
+
+ /// Field number for the "class_prediction_bias_init" field.
+ public const int ClassPredictionBiasInitFieldNumber = 10;
+ private float classPredictionBiasInit_;
+ ///
+ /// Bias initialization for class prediction. It has been show to stabilize
+ /// training where there are large number of negative boxes. See
+ /// https://arxiv.org/abs/1708.02002 for details.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float ClassPredictionBiasInit {
+ get { return classPredictionBiasInit_; }
+ set {
+ classPredictionBiasInit_ = value;
+ }
+ }
+
+ /// Field number for the "use_dropout" field.
+ public const int UseDropoutFieldNumber = 11;
+ private bool useDropout_;
+ ///
+ /// Whether to use dropout for class prediction.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseDropout {
+ get { return useDropout_; }
+ set {
+ useDropout_ = value;
+ }
+ }
+
+ /// Field number for the "dropout_keep_probability" field.
+ public const int DropoutKeepProbabilityFieldNumber = 12;
+ private float dropoutKeepProbability_;
+ ///
+ /// Keep probability for dropout.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float DropoutKeepProbability {
+ get { return dropoutKeepProbability_; }
+ set {
+ dropoutKeepProbability_ = value;
+ }
+ }
+
+ /// Field number for the "share_prediction_tower" field.
+ public const int SharePredictionTowerFieldNumber = 13;
+ private bool sharePredictionTower_;
+ ///
+ /// Whether to share the multi-layer tower between box prediction and class
+ /// prediction heads.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool SharePredictionTower {
+ get { return sharePredictionTower_; }
+ set {
+ sharePredictionTower_ = value;
+ }
+ }
+
+ /// Field number for the "use_depthwise" field.
+ public const int UseDepthwiseFieldNumber = 14;
+ private bool useDepthwise_;
+ ///
+ /// Whether to use depthwise separable convolution for box predictor layers.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseDepthwise {
+ get { return useDepthwise_; }
+ set {
+ useDepthwise_ = value;
+ }
+ }
+
+ /// Field number for the "score_converter" field.
+ public const int ScoreConverterFieldNumber = 16;
+ private global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.ScoreConverter scoreConverter_ = 0;
+ ///
+ /// Callable elementwise score converter at inference time.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.ScoreConverter ScoreConverter {
+ get { return scoreConverter_; }
+ set {
+ scoreConverter_ = value;
+ }
+ }
+
+ /// Field number for the "box_encodings_clip_range" field.
+ public const int BoxEncodingsClipRangeFieldNumber = 17;
+ private global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.BoxEncodingsClipRange boxEncodingsClipRange_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.BoxEncodingsClipRange BoxEncodingsClipRange {
+ get { return boxEncodingsClipRange_; }
+ set {
+ boxEncodingsClipRange_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as WeightSharedConvolutionalBoxPredictor);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(WeightSharedConvolutionalBoxPredictor other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(ConvHyperparams, other.ConvHyperparams)) return false;
+ if (NumLayersBeforePredictor != other.NumLayersBeforePredictor) return false;
+ if (Depth != other.Depth) return false;
+ if (KernelSize != other.KernelSize) return false;
+ if (BoxCodeSize != other.BoxCodeSize) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ClassPredictionBiasInit, other.ClassPredictionBiasInit)) return false;
+ if (UseDropout != other.UseDropout) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DropoutKeepProbability, other.DropoutKeepProbability)) return false;
+ if (SharePredictionTower != other.SharePredictionTower) return false;
+ if (UseDepthwise != other.UseDepthwise) return false;
+ if (ScoreConverter != other.ScoreConverter) return false;
+ if (!object.Equals(BoxEncodingsClipRange, other.BoxEncodingsClipRange)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (convHyperparams_ != null) hash ^= ConvHyperparams.GetHashCode();
+ if (NumLayersBeforePredictor != 0) hash ^= NumLayersBeforePredictor.GetHashCode();
+ if (Depth != 0) hash ^= Depth.GetHashCode();
+ if (KernelSize != 0) hash ^= KernelSize.GetHashCode();
+ if (BoxCodeSize != 0) hash ^= BoxCodeSize.GetHashCode();
+ if (ClassPredictionBiasInit != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ClassPredictionBiasInit);
+ if (UseDropout != false) hash ^= UseDropout.GetHashCode();
+ if (DropoutKeepProbability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DropoutKeepProbability);
+ if (SharePredictionTower != false) hash ^= SharePredictionTower.GetHashCode();
+ if (UseDepthwise != false) hash ^= UseDepthwise.GetHashCode();
+ if (ScoreConverter != 0) hash ^= ScoreConverter.GetHashCode();
+ if (boxEncodingsClipRange_ != null) hash ^= BoxEncodingsClipRange.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (convHyperparams_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(ConvHyperparams);
+ }
+ if (Depth != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(Depth);
+ }
+ if (NumLayersBeforePredictor != 0) {
+ output.WriteRawTag(32);
+ output.WriteInt32(NumLayersBeforePredictor);
+ }
+ if (KernelSize != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(KernelSize);
+ }
+ if (BoxCodeSize != 0) {
+ output.WriteRawTag(64);
+ output.WriteInt32(BoxCodeSize);
+ }
+ if (ClassPredictionBiasInit != 0F) {
+ output.WriteRawTag(85);
+ output.WriteFloat(ClassPredictionBiasInit);
+ }
+ if (UseDropout != false) {
+ output.WriteRawTag(88);
+ output.WriteBool(UseDropout);
+ }
+ if (DropoutKeepProbability != 0F) {
+ output.WriteRawTag(101);
+ output.WriteFloat(DropoutKeepProbability);
+ }
+ if (SharePredictionTower != false) {
+ output.WriteRawTag(104);
+ output.WriteBool(SharePredictionTower);
+ }
+ if (UseDepthwise != false) {
+ output.WriteRawTag(112);
+ output.WriteBool(UseDepthwise);
+ }
+ if (ScoreConverter != 0) {
+ output.WriteRawTag(128, 1);
+ output.WriteEnum((int) ScoreConverter);
+ }
+ if (boxEncodingsClipRange_ != null) {
+ output.WriteRawTag(138, 1);
+ output.WriteMessage(BoxEncodingsClipRange);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (convHyperparams_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvHyperparams);
+ }
+ if (NumLayersBeforePredictor != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLayersBeforePredictor);
+ }
+ if (Depth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Depth);
+ }
+ if (KernelSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(KernelSize);
+ }
+ if (BoxCodeSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxCodeSize);
+ }
+ if (ClassPredictionBiasInit != 0F) {
+ size += 1 + 4;
+ }
+ if (UseDropout != false) {
+ size += 1 + 1;
+ }
+ if (DropoutKeepProbability != 0F) {
+ size += 1 + 4;
+ }
+ if (SharePredictionTower != false) {
+ size += 1 + 1;
+ }
+ if (UseDepthwise != false) {
+ size += 1 + 1;
+ }
+ if (ScoreConverter != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) ScoreConverter);
+ }
+ if (boxEncodingsClipRange_ != null) {
+ size += 2 + pb::CodedOutputStream.ComputeMessageSize(BoxEncodingsClipRange);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(WeightSharedConvolutionalBoxPredictor other) {
+ if (other == null) {
+ return;
+ }
+ if (other.convHyperparams_ != null) {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ ConvHyperparams.MergeFrom(other.ConvHyperparams);
+ }
+ if (other.NumLayersBeforePredictor != 0) {
+ NumLayersBeforePredictor = other.NumLayersBeforePredictor;
+ }
+ if (other.Depth != 0) {
+ Depth = other.Depth;
+ }
+ if (other.KernelSize != 0) {
+ KernelSize = other.KernelSize;
+ }
+ if (other.BoxCodeSize != 0) {
+ BoxCodeSize = other.BoxCodeSize;
+ }
+ if (other.ClassPredictionBiasInit != 0F) {
+ ClassPredictionBiasInit = other.ClassPredictionBiasInit;
+ }
+ if (other.UseDropout != false) {
+ UseDropout = other.UseDropout;
+ }
+ if (other.DropoutKeepProbability != 0F) {
+ DropoutKeepProbability = other.DropoutKeepProbability;
+ }
+ if (other.SharePredictionTower != false) {
+ SharePredictionTower = other.SharePredictionTower;
+ }
+ if (other.UseDepthwise != false) {
+ UseDepthwise = other.UseDepthwise;
+ }
+ if (other.ScoreConverter != 0) {
+ ScoreConverter = other.ScoreConverter;
+ }
+ if (other.boxEncodingsClipRange_ != null) {
+ if (boxEncodingsClipRange_ == null) {
+ boxEncodingsClipRange_ = new global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.BoxEncodingsClipRange();
+ }
+ BoxEncodingsClipRange.MergeFrom(other.BoxEncodingsClipRange);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ input.ReadMessage(convHyperparams_);
+ break;
+ }
+ case 16: {
+ Depth = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ NumLayersBeforePredictor = input.ReadInt32();
+ break;
+ }
+ case 56: {
+ KernelSize = input.ReadInt32();
+ break;
+ }
+ case 64: {
+ BoxCodeSize = input.ReadInt32();
+ break;
+ }
+ case 85: {
+ ClassPredictionBiasInit = input.ReadFloat();
+ break;
+ }
+ case 88: {
+ UseDropout = input.ReadBool();
+ break;
+ }
+ case 101: {
+ DropoutKeepProbability = input.ReadFloat();
+ break;
+ }
+ case 104: {
+ SharePredictionTower = input.ReadBool();
+ break;
+ }
+ case 112: {
+ UseDepthwise = input.ReadBool();
+ break;
+ }
+ case 128: {
+ scoreConverter_ = (global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.ScoreConverter) input.ReadEnum();
+ break;
+ }
+ case 138: {
+ if (boxEncodingsClipRange_ == null) {
+ boxEncodingsClipRange_ = new global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Types.BoxEncodingsClipRange();
+ }
+ input.ReadMessage(boxEncodingsClipRange_);
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the WeightSharedConvolutionalBoxPredictor message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ ///
+ /// Enum to specify how to convert the detection scores at inference time.
+ ///
+ public enum ScoreConverter {
+ ///
+ /// Input scores equals output scores.
+ ///
+ [pbr::OriginalName("IDENTITY")] Identity = 0,
+ ///
+ /// Applies a sigmoid on input scores.
+ ///
+ [pbr::OriginalName("SIGMOID")] Sigmoid = 1,
+ }
+
+ ///
+ /// If specified, apply clipping to box encodings.
+ ///
+ public sealed partial class BoxEncodingsClipRange : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoxEncodingsClipRange());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.WeightSharedConvolutionalBoxPredictor.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxEncodingsClipRange() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxEncodingsClipRange(BoxEncodingsClipRange other) : this() {
+ min_ = other.min_;
+ max_ = other.max_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BoxEncodingsClipRange Clone() {
+ return new BoxEncodingsClipRange(this);
+ }
+
+ /// Field number for the "min" field.
+ public const int MinFieldNumber = 1;
+ private float min_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Min {
+ get { return min_; }
+ set {
+ min_ = value;
+ }
+ }
+
+ /// Field number for the "max" field.
+ public const int MaxFieldNumber = 2;
+ private float max_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Max {
+ get { return max_; }
+ set {
+ max_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as BoxEncodingsClipRange);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(BoxEncodingsClipRange other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Min, other.Min)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Max, other.Max)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Min != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Min);
+ if (Max != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Max);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Min != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Min);
+ }
+ if (Max != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(Max);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Min != 0F) {
+ size += 1 + 4;
+ }
+ if (Max != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(BoxEncodingsClipRange other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Min != 0F) {
+ Min = other.Min;
+ }
+ if (other.Max != 0F) {
+ Max = other.Max;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Min = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ Max = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+ #endregion
+
+ }
+
+ ///
+ /// TODO(alirezafathi): Refactor the proto file to be able to configure mask rcnn
+ /// head easily.
+ /// Next id: 15
+ ///
+ public sealed partial class MaskRCNNBoxPredictor : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MaskRCNNBoxPredictor());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictorReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public MaskRCNNBoxPredictor() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public MaskRCNNBoxPredictor(MaskRCNNBoxPredictor other) : this() {
+ fcHyperparams_ = other.fcHyperparams_ != null ? other.fcHyperparams_.Clone() : null;
+ useDropout_ = other.useDropout_;
+ dropoutKeepProbability_ = other.dropoutKeepProbability_;
+ boxCodeSize_ = other.boxCodeSize_;
+ convHyperparams_ = other.convHyperparams_ != null ? other.convHyperparams_.Clone() : null;
+ predictInstanceMasks_ = other.predictInstanceMasks_;
+ maskPredictionConvDepth_ = other.maskPredictionConvDepth_;
+ predictKeypoints_ = other.predictKeypoints_;
+ maskHeight_ = other.maskHeight_;
+ maskWidth_ = other.maskWidth_;
+ maskPredictionNumConvLayers_ = other.maskPredictionNumConvLayers_;
+ masksAreClassAgnostic_ = other.masksAreClassAgnostic_;
+ shareBoxAcrossClasses_ = other.shareBoxAcrossClasses_;
+ convolveThenUpsampleMasks_ = other.convolveThenUpsampleMasks_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public MaskRCNNBoxPredictor Clone() {
+ return new MaskRCNNBoxPredictor(this);
+ }
+
+ /// Field number for the "fc_hyperparams" field.
+ public const int FcHyperparamsFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams fcHyperparams_;
+ ///
+ /// Hyperparameters for fully connected ops used in the box predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams FcHyperparams {
+ get { return fcHyperparams_; }
+ set {
+ fcHyperparams_ = value;
+ }
+ }
+
+ /// Field number for the "use_dropout" field.
+ public const int UseDropoutFieldNumber = 2;
+ private bool useDropout_;
+ ///
+ /// Whether to use dropout op prior to the both box and class predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseDropout {
+ get { return useDropout_; }
+ set {
+ useDropout_ = value;
+ }
+ }
+
+ /// Field number for the "dropout_keep_probability" field.
+ public const int DropoutKeepProbabilityFieldNumber = 3;
+ private float dropoutKeepProbability_;
+ ///
+ /// Keep probability for dropout. This is only used if use_dropout is true.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float DropoutKeepProbability {
+ get { return dropoutKeepProbability_; }
+ set {
+ dropoutKeepProbability_ = value;
+ }
+ }
+
+ /// Field number for the "box_code_size" field.
+ public const int BoxCodeSizeFieldNumber = 4;
+ private int boxCodeSize_;
+ ///
+ /// Size of the encoding for the boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int BoxCodeSize {
+ get { return boxCodeSize_; }
+ set {
+ boxCodeSize_ = value;
+ }
+ }
+
+ /// Field number for the "conv_hyperparams" field.
+ public const int ConvHyperparamsFieldNumber = 5;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams convHyperparams_;
+ ///
+ /// Hyperparameters for convolution ops used in the box predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams ConvHyperparams {
+ get { return convHyperparams_; }
+ set {
+ convHyperparams_ = value;
+ }
+ }
+
+ /// Field number for the "predict_instance_masks" field.
+ public const int PredictInstanceMasksFieldNumber = 6;
+ private bool predictInstanceMasks_;
+ ///
+ /// Whether to predict instance masks inside detection boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool PredictInstanceMasks {
+ get { return predictInstanceMasks_; }
+ set {
+ predictInstanceMasks_ = value;
+ }
+ }
+
+ /// Field number for the "mask_prediction_conv_depth" field.
+ public const int MaskPredictionConvDepthFieldNumber = 7;
+ private int maskPredictionConvDepth_;
+ ///
+ /// The depth for the first conv2d_transpose op applied to the
+ /// image_features in the mask prediction branch. If set to 0, the value
+ /// will be set automatically based on the number of channels in the image
+ /// features and the number of classes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaskPredictionConvDepth {
+ get { return maskPredictionConvDepth_; }
+ set {
+ maskPredictionConvDepth_ = value;
+ }
+ }
+
+ /// Field number for the "predict_keypoints" field.
+ public const int PredictKeypointsFieldNumber = 8;
+ private bool predictKeypoints_;
+ ///
+ /// Whether to predict keypoints inside detection boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool PredictKeypoints {
+ get { return predictKeypoints_; }
+ set {
+ predictKeypoints_ = value;
+ }
+ }
+
+ /// Field number for the "mask_height" field.
+ public const int MaskHeightFieldNumber = 9;
+ private int maskHeight_;
+ ///
+ /// The height and the width of the predicted mask.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaskHeight {
+ get { return maskHeight_; }
+ set {
+ maskHeight_ = value;
+ }
+ }
+
+ /// Field number for the "mask_width" field.
+ public const int MaskWidthFieldNumber = 10;
+ private int maskWidth_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaskWidth {
+ get { return maskWidth_; }
+ set {
+ maskWidth_ = value;
+ }
+ }
+
+ /// Field number for the "mask_prediction_num_conv_layers" field.
+ public const int MaskPredictionNumConvLayersFieldNumber = 11;
+ private int maskPredictionNumConvLayers_;
+ ///
+ /// The number of convolutions applied to image_features in the mask prediction
+ /// branch.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaskPredictionNumConvLayers {
+ get { return maskPredictionNumConvLayers_; }
+ set {
+ maskPredictionNumConvLayers_ = value;
+ }
+ }
+
+ /// Field number for the "masks_are_class_agnostic" field.
+ public const int MasksAreClassAgnosticFieldNumber = 12;
+ private bool masksAreClassAgnostic_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool MasksAreClassAgnostic {
+ get { return masksAreClassAgnostic_; }
+ set {
+ masksAreClassAgnostic_ = value;
+ }
+ }
+
+ /// Field number for the "share_box_across_classes" field.
+ public const int ShareBoxAcrossClassesFieldNumber = 13;
+ private bool shareBoxAcrossClasses_;
+ ///
+ /// Whether to use one box for all classes rather than a different box for each
+ /// class.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ShareBoxAcrossClasses {
+ get { return shareBoxAcrossClasses_; }
+ set {
+ shareBoxAcrossClasses_ = value;
+ }
+ }
+
+ /// Field number for the "convolve_then_upsample_masks" field.
+ public const int ConvolveThenUpsampleMasksFieldNumber = 14;
+ private bool convolveThenUpsampleMasks_;
+ ///
+ /// Whether to apply convolutions on mask features before upsampling using
+ /// nearest neighbor resizing.
+ /// By default, mask features are resized to [`mask_height`, `mask_width`]
+ /// before applying convolutions and predicting masks.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ConvolveThenUpsampleMasks {
+ get { return convolveThenUpsampleMasks_; }
+ set {
+ convolveThenUpsampleMasks_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as MaskRCNNBoxPredictor);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(MaskRCNNBoxPredictor other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(FcHyperparams, other.FcHyperparams)) return false;
+ if (UseDropout != other.UseDropout) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DropoutKeepProbability, other.DropoutKeepProbability)) return false;
+ if (BoxCodeSize != other.BoxCodeSize) return false;
+ if (!object.Equals(ConvHyperparams, other.ConvHyperparams)) return false;
+ if (PredictInstanceMasks != other.PredictInstanceMasks) return false;
+ if (MaskPredictionConvDepth != other.MaskPredictionConvDepth) return false;
+ if (PredictKeypoints != other.PredictKeypoints) return false;
+ if (MaskHeight != other.MaskHeight) return false;
+ if (MaskWidth != other.MaskWidth) return false;
+ if (MaskPredictionNumConvLayers != other.MaskPredictionNumConvLayers) return false;
+ if (MasksAreClassAgnostic != other.MasksAreClassAgnostic) return false;
+ if (ShareBoxAcrossClasses != other.ShareBoxAcrossClasses) return false;
+ if (ConvolveThenUpsampleMasks != other.ConvolveThenUpsampleMasks) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (fcHyperparams_ != null) hash ^= FcHyperparams.GetHashCode();
+ if (UseDropout != false) hash ^= UseDropout.GetHashCode();
+ if (DropoutKeepProbability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DropoutKeepProbability);
+ if (BoxCodeSize != 0) hash ^= BoxCodeSize.GetHashCode();
+ if (convHyperparams_ != null) hash ^= ConvHyperparams.GetHashCode();
+ if (PredictInstanceMasks != false) hash ^= PredictInstanceMasks.GetHashCode();
+ if (MaskPredictionConvDepth != 0) hash ^= MaskPredictionConvDepth.GetHashCode();
+ if (PredictKeypoints != false) hash ^= PredictKeypoints.GetHashCode();
+ if (MaskHeight != 0) hash ^= MaskHeight.GetHashCode();
+ if (MaskWidth != 0) hash ^= MaskWidth.GetHashCode();
+ if (MaskPredictionNumConvLayers != 0) hash ^= MaskPredictionNumConvLayers.GetHashCode();
+ if (MasksAreClassAgnostic != false) hash ^= MasksAreClassAgnostic.GetHashCode();
+ if (ShareBoxAcrossClasses != false) hash ^= ShareBoxAcrossClasses.GetHashCode();
+ if (ConvolveThenUpsampleMasks != false) hash ^= ConvolveThenUpsampleMasks.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (fcHyperparams_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(FcHyperparams);
+ }
+ if (UseDropout != false) {
+ output.WriteRawTag(16);
+ output.WriteBool(UseDropout);
+ }
+ if (DropoutKeepProbability != 0F) {
+ output.WriteRawTag(29);
+ output.WriteFloat(DropoutKeepProbability);
+ }
+ if (BoxCodeSize != 0) {
+ output.WriteRawTag(32);
+ output.WriteInt32(BoxCodeSize);
+ }
+ if (convHyperparams_ != null) {
+ output.WriteRawTag(42);
+ output.WriteMessage(ConvHyperparams);
+ }
+ if (PredictInstanceMasks != false) {
+ output.WriteRawTag(48);
+ output.WriteBool(PredictInstanceMasks);
+ }
+ if (MaskPredictionConvDepth != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(MaskPredictionConvDepth);
+ }
+ if (PredictKeypoints != false) {
+ output.WriteRawTag(64);
+ output.WriteBool(PredictKeypoints);
+ }
+ if (MaskHeight != 0) {
+ output.WriteRawTag(72);
+ output.WriteInt32(MaskHeight);
+ }
+ if (MaskWidth != 0) {
+ output.WriteRawTag(80);
+ output.WriteInt32(MaskWidth);
+ }
+ if (MaskPredictionNumConvLayers != 0) {
+ output.WriteRawTag(88);
+ output.WriteInt32(MaskPredictionNumConvLayers);
+ }
+ if (MasksAreClassAgnostic != false) {
+ output.WriteRawTag(96);
+ output.WriteBool(MasksAreClassAgnostic);
+ }
+ if (ShareBoxAcrossClasses != false) {
+ output.WriteRawTag(104);
+ output.WriteBool(ShareBoxAcrossClasses);
+ }
+ if (ConvolveThenUpsampleMasks != false) {
+ output.WriteRawTag(112);
+ output.WriteBool(ConvolveThenUpsampleMasks);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (fcHyperparams_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FcHyperparams);
+ }
+ if (UseDropout != false) {
+ size += 1 + 1;
+ }
+ if (DropoutKeepProbability != 0F) {
+ size += 1 + 4;
+ }
+ if (BoxCodeSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxCodeSize);
+ }
+ if (convHyperparams_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvHyperparams);
+ }
+ if (PredictInstanceMasks != false) {
+ size += 1 + 1;
+ }
+ if (MaskPredictionConvDepth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskPredictionConvDepth);
+ }
+ if (PredictKeypoints != false) {
+ size += 1 + 1;
+ }
+ if (MaskHeight != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskHeight);
+ }
+ if (MaskWidth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskWidth);
+ }
+ if (MaskPredictionNumConvLayers != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskPredictionNumConvLayers);
+ }
+ if (MasksAreClassAgnostic != false) {
+ size += 1 + 1;
+ }
+ if (ShareBoxAcrossClasses != false) {
+ size += 1 + 1;
+ }
+ if (ConvolveThenUpsampleMasks != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(MaskRCNNBoxPredictor other) {
+ if (other == null) {
+ return;
+ }
+ if (other.fcHyperparams_ != null) {
+ if (fcHyperparams_ == null) {
+ fcHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ FcHyperparams.MergeFrom(other.FcHyperparams);
+ }
+ if (other.UseDropout != false) {
+ UseDropout = other.UseDropout;
+ }
+ if (other.DropoutKeepProbability != 0F) {
+ DropoutKeepProbability = other.DropoutKeepProbability;
+ }
+ if (other.BoxCodeSize != 0) {
+ BoxCodeSize = other.BoxCodeSize;
+ }
+ if (other.convHyperparams_ != null) {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ ConvHyperparams.MergeFrom(other.ConvHyperparams);
+ }
+ if (other.PredictInstanceMasks != false) {
+ PredictInstanceMasks = other.PredictInstanceMasks;
+ }
+ if (other.MaskPredictionConvDepth != 0) {
+ MaskPredictionConvDepth = other.MaskPredictionConvDepth;
+ }
+ if (other.PredictKeypoints != false) {
+ PredictKeypoints = other.PredictKeypoints;
+ }
+ if (other.MaskHeight != 0) {
+ MaskHeight = other.MaskHeight;
+ }
+ if (other.MaskWidth != 0) {
+ MaskWidth = other.MaskWidth;
+ }
+ if (other.MaskPredictionNumConvLayers != 0) {
+ MaskPredictionNumConvLayers = other.MaskPredictionNumConvLayers;
+ }
+ if (other.MasksAreClassAgnostic != false) {
+ MasksAreClassAgnostic = other.MasksAreClassAgnostic;
+ }
+ if (other.ShareBoxAcrossClasses != false) {
+ ShareBoxAcrossClasses = other.ShareBoxAcrossClasses;
+ }
+ if (other.ConvolveThenUpsampleMasks != false) {
+ ConvolveThenUpsampleMasks = other.ConvolveThenUpsampleMasks;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (fcHyperparams_ == null) {
+ fcHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ input.ReadMessage(fcHyperparams_);
+ break;
+ }
+ case 16: {
+ UseDropout = input.ReadBool();
+ break;
+ }
+ case 29: {
+ DropoutKeepProbability = input.ReadFloat();
+ break;
+ }
+ case 32: {
+ BoxCodeSize = input.ReadInt32();
+ break;
+ }
+ case 42: {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ input.ReadMessage(convHyperparams_);
+ break;
+ }
+ case 48: {
+ PredictInstanceMasks = input.ReadBool();
+ break;
+ }
+ case 56: {
+ MaskPredictionConvDepth = input.ReadInt32();
+ break;
+ }
+ case 64: {
+ PredictKeypoints = input.ReadBool();
+ break;
+ }
+ case 72: {
+ MaskHeight = input.ReadInt32();
+ break;
+ }
+ case 80: {
+ MaskWidth = input.ReadInt32();
+ break;
+ }
+ case 88: {
+ MaskPredictionNumConvLayers = input.ReadInt32();
+ break;
+ }
+ case 96: {
+ MasksAreClassAgnostic = input.ReadBool();
+ break;
+ }
+ case 104: {
+ ShareBoxAcrossClasses = input.ReadBool();
+ break;
+ }
+ case 112: {
+ ConvolveThenUpsampleMasks = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class RfcnBoxPredictor : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RfcnBoxPredictor());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictorReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RfcnBoxPredictor() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RfcnBoxPredictor(RfcnBoxPredictor other) : this() {
+ convHyperparams_ = other.convHyperparams_ != null ? other.convHyperparams_.Clone() : null;
+ numSpatialBinsHeight_ = other.numSpatialBinsHeight_;
+ numSpatialBinsWidth_ = other.numSpatialBinsWidth_;
+ depth_ = other.depth_;
+ boxCodeSize_ = other.boxCodeSize_;
+ cropHeight_ = other.cropHeight_;
+ cropWidth_ = other.cropWidth_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RfcnBoxPredictor Clone() {
+ return new RfcnBoxPredictor(this);
+ }
+
+ /// Field number for the "conv_hyperparams" field.
+ public const int ConvHyperparamsFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams convHyperparams_;
+ ///
+ /// Hyperparameters for convolution ops used in the box predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams ConvHyperparams {
+ get { return convHyperparams_; }
+ set {
+ convHyperparams_ = value;
+ }
+ }
+
+ /// Field number for the "num_spatial_bins_height" field.
+ public const int NumSpatialBinsHeightFieldNumber = 2;
+ private int numSpatialBinsHeight_;
+ ///
+ /// Bin sizes for RFCN crops.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumSpatialBinsHeight {
+ get { return numSpatialBinsHeight_; }
+ set {
+ numSpatialBinsHeight_ = value;
+ }
+ }
+
+ /// Field number for the "num_spatial_bins_width" field.
+ public const int NumSpatialBinsWidthFieldNumber = 3;
+ private int numSpatialBinsWidth_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumSpatialBinsWidth {
+ get { return numSpatialBinsWidth_; }
+ set {
+ numSpatialBinsWidth_ = value;
+ }
+ }
+
+ /// Field number for the "depth" field.
+ public const int DepthFieldNumber = 4;
+ private int depth_;
+ ///
+ /// Target depth to reduce the input image features to.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Depth {
+ get { return depth_; }
+ set {
+ depth_ = value;
+ }
+ }
+
+ /// Field number for the "box_code_size" field.
+ public const int BoxCodeSizeFieldNumber = 5;
+ private int boxCodeSize_;
+ ///
+ /// Size of the encoding for the boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int BoxCodeSize {
+ get { return boxCodeSize_; }
+ set {
+ boxCodeSize_ = value;
+ }
+ }
+
+ /// Field number for the "crop_height" field.
+ public const int CropHeightFieldNumber = 6;
+ private int cropHeight_;
+ ///
+ /// Size to resize the rfcn crops to.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CropHeight {
+ get { return cropHeight_; }
+ set {
+ cropHeight_ = value;
+ }
+ }
+
+ /// Field number for the "crop_width" field.
+ public const int CropWidthFieldNumber = 7;
+ private int cropWidth_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CropWidth {
+ get { return cropWidth_; }
+ set {
+ cropWidth_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as RfcnBoxPredictor);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(RfcnBoxPredictor other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(ConvHyperparams, other.ConvHyperparams)) return false;
+ if (NumSpatialBinsHeight != other.NumSpatialBinsHeight) return false;
+ if (NumSpatialBinsWidth != other.NumSpatialBinsWidth) return false;
+ if (Depth != other.Depth) return false;
+ if (BoxCodeSize != other.BoxCodeSize) return false;
+ if (CropHeight != other.CropHeight) return false;
+ if (CropWidth != other.CropWidth) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (convHyperparams_ != null) hash ^= ConvHyperparams.GetHashCode();
+ if (NumSpatialBinsHeight != 0) hash ^= NumSpatialBinsHeight.GetHashCode();
+ if (NumSpatialBinsWidth != 0) hash ^= NumSpatialBinsWidth.GetHashCode();
+ if (Depth != 0) hash ^= Depth.GetHashCode();
+ if (BoxCodeSize != 0) hash ^= BoxCodeSize.GetHashCode();
+ if (CropHeight != 0) hash ^= CropHeight.GetHashCode();
+ if (CropWidth != 0) hash ^= CropWidth.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (convHyperparams_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(ConvHyperparams);
+ }
+ if (NumSpatialBinsHeight != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(NumSpatialBinsHeight);
+ }
+ if (NumSpatialBinsWidth != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(NumSpatialBinsWidth);
+ }
+ if (Depth != 0) {
+ output.WriteRawTag(32);
+ output.WriteInt32(Depth);
+ }
+ if (BoxCodeSize != 0) {
+ output.WriteRawTag(40);
+ output.WriteInt32(BoxCodeSize);
+ }
+ if (CropHeight != 0) {
+ output.WriteRawTag(48);
+ output.WriteInt32(CropHeight);
+ }
+ if (CropWidth != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(CropWidth);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (convHyperparams_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvHyperparams);
+ }
+ if (NumSpatialBinsHeight != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumSpatialBinsHeight);
+ }
+ if (NumSpatialBinsWidth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumSpatialBinsWidth);
+ }
+ if (Depth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Depth);
+ }
+ if (BoxCodeSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(BoxCodeSize);
+ }
+ if (CropHeight != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(CropHeight);
+ }
+ if (CropWidth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(CropWidth);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(RfcnBoxPredictor other) {
+ if (other == null) {
+ return;
+ }
+ if (other.convHyperparams_ != null) {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ ConvHyperparams.MergeFrom(other.ConvHyperparams);
+ }
+ if (other.NumSpatialBinsHeight != 0) {
+ NumSpatialBinsHeight = other.NumSpatialBinsHeight;
+ }
+ if (other.NumSpatialBinsWidth != 0) {
+ NumSpatialBinsWidth = other.NumSpatialBinsWidth;
+ }
+ if (other.Depth != 0) {
+ Depth = other.Depth;
+ }
+ if (other.BoxCodeSize != 0) {
+ BoxCodeSize = other.BoxCodeSize;
+ }
+ if (other.CropHeight != 0) {
+ CropHeight = other.CropHeight;
+ }
+ if (other.CropWidth != 0) {
+ CropWidth = other.CropWidth;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (convHyperparams_ == null) {
+ convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ input.ReadMessage(convHyperparams_);
+ break;
+ }
+ case 16: {
+ NumSpatialBinsHeight = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ NumSpatialBinsWidth = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ Depth = input.ReadInt32();
+ break;
+ }
+ case 40: {
+ BoxCodeSize = input.ReadInt32();
+ break;
+ }
+ case 48: {
+ CropHeight = input.ReadInt32();
+ break;
+ }
+ case 56: {
+ CropWidth = input.ReadInt32();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs
new file mode 100644
index 00000000..7bd62280
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs
@@ -0,0 +1,1413 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/calibration.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/calibration.proto
+ public static partial class CalibrationReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/calibration.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static CalibrationReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CilvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9jYWxpYnJhdGlvbi5wcm90bxIX",
+ "b2JqZWN0X2RldGVjdGlvbi5wcm90b3MigQMKEUNhbGlicmF0aW9uQ29uZmln",
+ "ElAKFmZ1bmN0aW9uX2FwcHJveGltYXRpb24YASABKAsyLi5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5GdW5jdGlvbkFwcHJveGltYXRpb25IABJiCiBjbGFz",
+ "c19pZF9mdW5jdGlvbl9hcHByb3hpbWF0aW9ucxgCIAEoCzI2Lm9iamVjdF9k",
+ "ZXRlY3Rpb24ucHJvdG9zLkNsYXNzSWRGdW5jdGlvbkFwcHJveGltYXRpb25z",
+ "SAASSgoTc2lnbW9pZF9jYWxpYnJhdGlvbhgDIAEoCzIrLm9iamVjdF9kZXRl",
+ "Y3Rpb24ucHJvdG9zLlNpZ21vaWRDYWxpYnJhdGlvbkgAElwKHWNsYXNzX2lk",
+ "X3NpZ21vaWRfY2FsaWJyYXRpb25zGAQgASgLMjMub2JqZWN0X2RldGVjdGlv",
+ "bi5wcm90b3MuQ2xhc3NJZFNpZ21vaWRDYWxpYnJhdGlvbnNIAEIMCgpjYWxp",
+ "YnJhdG9yIkwKFUZ1bmN0aW9uQXBwcm94aW1hdGlvbhIzCgl4X3lfcGFpcnMY",
+ "ASABKAsyIC5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5YWVBhaXJzIukBCh1D",
+ "bGFzc0lkRnVuY3Rpb25BcHByb3hpbWF0aW9ucxJsChVjbGFzc19pZF94eV9w",
+ "YWlyc19tYXAYASADKAsyTS5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5DbGFz",
+ "c0lkRnVuY3Rpb25BcHByb3hpbWF0aW9ucy5DbGFzc0lkWHlQYWlyc01hcEVu",
+ "dHJ5GloKFkNsYXNzSWRYeVBhaXJzTWFwRW50cnkSCwoDa2V5GAEgASgFEi8K",
+ "BXZhbHVlGAIgASgLMiAub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuWFlQYWly",
+ "czoCOAEiXAoSU2lnbW9pZENhbGlicmF0aW9uEkYKEnNpZ21vaWRfcGFyYW1l",
+ "dGVycxgBIAEoCzIqLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlNpZ21vaWRQ",
+ "YXJhbWV0ZXJzIosCChpDbGFzc0lkU2lnbW9pZENhbGlicmF0aW9ucxJ9Ch9j",
+ "bGFzc19pZF9zaWdtb2lkX3BhcmFtZXRlcnNfbWFwGAEgAygLMlQub2JqZWN0",
+ "X2RldGVjdGlvbi5wcm90b3MuQ2xhc3NJZFNpZ21vaWRDYWxpYnJhdGlvbnMu",
+ "Q2xhc3NJZFNpZ21vaWRQYXJhbWV0ZXJzTWFwRW50cnkabgogQ2xhc3NJZFNp",
+ "Z21vaWRQYXJhbWV0ZXJzTWFwRW50cnkSCwoDa2V5GAEgASgFEjkKBXZhbHVl",
+ "GAIgASgLMioub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuU2lnbW9pZFBhcmFt",
+ "ZXRlcnM6AjgBIqsBCgdYWVBhaXJzEjkKCHhfeV9wYWlyGAEgAygLMicub2Jq",
+ "ZWN0X2RldGVjdGlvbi5wcm90b3MuWFlQYWlycy5YWVBhaXISRQoSdHJhaW5p",
+ "bmdfZGF0YV90eXBlGAIgASgOMikub2JqZWN0X2RldGVjdGlvbi5wcm90b3Mu",
+ "VHJhaW5pbmdEYXRhVHlwZRoeCgZYWVBhaXISCQoBeBgBIAEoAhIJCgF5GAIg",
+ "ASgCIikKEVNpZ21vaWRQYXJhbWV0ZXJzEgkKAWEYASABKAISCQoBYhgCIAEo",
+ "AipOChBUcmFpbmluZ0RhdGFUeXBlEhUKEURBVEFfVFlQRV9VTktOT1dOEAAS",
+ "DwoLQUxMX0NMQVNTRVMQARISCg5DTEFTU19TUEVDSUZJQxACYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.Models.ObjectDetection.Protos.TrainingDataType), }, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig), global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig.Parser, new[]{ "FunctionApproximation", "ClassIdFunctionApproximations", "SigmoidCalibration", "ClassIdSigmoidCalibrations" }, new[]{ "Calibrator" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation), global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation.Parser, new[]{ "XYPairs" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations), global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations.Parser, new[]{ "ClassIdXyPairsMap" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration), global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration.Parser, new[]{ "SigmoidParameters" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations), global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations.Parser, new[]{ "ClassIdSigmoidParametersMap" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.XYPairs), global::Tensorflow.Models.ObjectDetection.Protos.XYPairs.Parser, new[]{ "XYPair", "TrainingDataType" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.XYPairs.Types.XYPair), global::Tensorflow.Models.ObjectDetection.Protos.XYPairs.Types.XYPair.Parser, new[]{ "X", "Y" }, null, null, null)}),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters), global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters.Parser, new[]{ "A", "B" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Enums
+ ///
+ /// Description of data used to fit the calibration model. CLASS_SPECIFIC
+ /// indicates that the calibration parameters are derived from detections
+ /// pertaining to a single class. ALL_CLASSES indicates that parameters were
+ /// obtained by fitting a model on detections from all classes (including the
+ /// background class).
+ ///
+ public enum TrainingDataType {
+ [pbr::OriginalName("DATA_TYPE_UNKNOWN")] DataTypeUnknown = 0,
+ [pbr::OriginalName("ALL_CLASSES")] AllClasses = 1,
+ [pbr::OriginalName("CLASS_SPECIFIC")] ClassSpecific = 2,
+ }
+
+ #endregion
+
+ #region Messages
+ ///
+ /// Message wrapper for various calibration configurations.
+ ///
+ public sealed partial class CalibrationConfig : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CalibrationConfig());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public CalibrationConfig() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public CalibrationConfig(CalibrationConfig other) : this() {
+ switch (other.CalibratorCase) {
+ case CalibratorOneofCase.FunctionApproximation:
+ FunctionApproximation = other.FunctionApproximation.Clone();
+ break;
+ case CalibratorOneofCase.ClassIdFunctionApproximations:
+ ClassIdFunctionApproximations = other.ClassIdFunctionApproximations.Clone();
+ break;
+ case CalibratorOneofCase.SigmoidCalibration:
+ SigmoidCalibration = other.SigmoidCalibration.Clone();
+ break;
+ case CalibratorOneofCase.ClassIdSigmoidCalibrations:
+ ClassIdSigmoidCalibrations = other.ClassIdSigmoidCalibrations.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public CalibrationConfig Clone() {
+ return new CalibrationConfig(this);
+ }
+
+ /// Field number for the "function_approximation" field.
+ public const int FunctionApproximationFieldNumber = 1;
+ ///
+ /// Class-agnostic calibration via linear interpolation (usually output from
+ /// isotonic regression).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation FunctionApproximation {
+ get { return calibratorCase_ == CalibratorOneofCase.FunctionApproximation ? (global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation) calibrator_ : null; }
+ set {
+ calibrator_ = value;
+ calibratorCase_ = value == null ? CalibratorOneofCase.None : CalibratorOneofCase.FunctionApproximation;
+ }
+ }
+
+ /// Field number for the "class_id_function_approximations" field.
+ public const int ClassIdFunctionApproximationsFieldNumber = 2;
+ ///
+ /// Per-class calibration via linear interpolation.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations ClassIdFunctionApproximations {
+ get { return calibratorCase_ == CalibratorOneofCase.ClassIdFunctionApproximations ? (global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations) calibrator_ : null; }
+ set {
+ calibrator_ = value;
+ calibratorCase_ = value == null ? CalibratorOneofCase.None : CalibratorOneofCase.ClassIdFunctionApproximations;
+ }
+ }
+
+ /// Field number for the "sigmoid_calibration" field.
+ public const int SigmoidCalibrationFieldNumber = 3;
+ ///
+ /// Class-agnostic sigmoid calibration.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration SigmoidCalibration {
+ get { return calibratorCase_ == CalibratorOneofCase.SigmoidCalibration ? (global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration) calibrator_ : null; }
+ set {
+ calibrator_ = value;
+ calibratorCase_ = value == null ? CalibratorOneofCase.None : CalibratorOneofCase.SigmoidCalibration;
+ }
+ }
+
+ /// Field number for the "class_id_sigmoid_calibrations" field.
+ public const int ClassIdSigmoidCalibrationsFieldNumber = 4;
+ ///
+ /// Per-class sigmoid calibration.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations ClassIdSigmoidCalibrations {
+ get { return calibratorCase_ == CalibratorOneofCase.ClassIdSigmoidCalibrations ? (global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations) calibrator_ : null; }
+ set {
+ calibrator_ = value;
+ calibratorCase_ = value == null ? CalibratorOneofCase.None : CalibratorOneofCase.ClassIdSigmoidCalibrations;
+ }
+ }
+
+ private object calibrator_;
+ /// Enum of possible cases for the "calibrator" oneof.
+ public enum CalibratorOneofCase {
+ None = 0,
+ FunctionApproximation = 1,
+ ClassIdFunctionApproximations = 2,
+ SigmoidCalibration = 3,
+ ClassIdSigmoidCalibrations = 4,
+ }
+ private CalibratorOneofCase calibratorCase_ = CalibratorOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public CalibratorOneofCase CalibratorCase {
+ get { return calibratorCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearCalibrator() {
+ calibratorCase_ = CalibratorOneofCase.None;
+ calibrator_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as CalibrationConfig);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(CalibrationConfig other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(FunctionApproximation, other.FunctionApproximation)) return false;
+ if (!object.Equals(ClassIdFunctionApproximations, other.ClassIdFunctionApproximations)) return false;
+ if (!object.Equals(SigmoidCalibration, other.SigmoidCalibration)) return false;
+ if (!object.Equals(ClassIdSigmoidCalibrations, other.ClassIdSigmoidCalibrations)) return false;
+ if (CalibratorCase != other.CalibratorCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (calibratorCase_ == CalibratorOneofCase.FunctionApproximation) hash ^= FunctionApproximation.GetHashCode();
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdFunctionApproximations) hash ^= ClassIdFunctionApproximations.GetHashCode();
+ if (calibratorCase_ == CalibratorOneofCase.SigmoidCalibration) hash ^= SigmoidCalibration.GetHashCode();
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdSigmoidCalibrations) hash ^= ClassIdSigmoidCalibrations.GetHashCode();
+ hash ^= (int) calibratorCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (calibratorCase_ == CalibratorOneofCase.FunctionApproximation) {
+ output.WriteRawTag(10);
+ output.WriteMessage(FunctionApproximation);
+ }
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdFunctionApproximations) {
+ output.WriteRawTag(18);
+ output.WriteMessage(ClassIdFunctionApproximations);
+ }
+ if (calibratorCase_ == CalibratorOneofCase.SigmoidCalibration) {
+ output.WriteRawTag(26);
+ output.WriteMessage(SigmoidCalibration);
+ }
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdSigmoidCalibrations) {
+ output.WriteRawTag(34);
+ output.WriteMessage(ClassIdSigmoidCalibrations);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (calibratorCase_ == CalibratorOneofCase.FunctionApproximation) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FunctionApproximation);
+ }
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdFunctionApproximations) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClassIdFunctionApproximations);
+ }
+ if (calibratorCase_ == CalibratorOneofCase.SigmoidCalibration) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(SigmoidCalibration);
+ }
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdSigmoidCalibrations) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClassIdSigmoidCalibrations);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(CalibrationConfig other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.CalibratorCase) {
+ case CalibratorOneofCase.FunctionApproximation:
+ if (FunctionApproximation == null) {
+ FunctionApproximation = new global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation();
+ }
+ FunctionApproximation.MergeFrom(other.FunctionApproximation);
+ break;
+ case CalibratorOneofCase.ClassIdFunctionApproximations:
+ if (ClassIdFunctionApproximations == null) {
+ ClassIdFunctionApproximations = new global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations();
+ }
+ ClassIdFunctionApproximations.MergeFrom(other.ClassIdFunctionApproximations);
+ break;
+ case CalibratorOneofCase.SigmoidCalibration:
+ if (SigmoidCalibration == null) {
+ SigmoidCalibration = new global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration();
+ }
+ SigmoidCalibration.MergeFrom(other.SigmoidCalibration);
+ break;
+ case CalibratorOneofCase.ClassIdSigmoidCalibrations:
+ if (ClassIdSigmoidCalibrations == null) {
+ ClassIdSigmoidCalibrations = new global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations();
+ }
+ ClassIdSigmoidCalibrations.MergeFrom(other.ClassIdSigmoidCalibrations);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.FunctionApproximation();
+ if (calibratorCase_ == CalibratorOneofCase.FunctionApproximation) {
+ subBuilder.MergeFrom(FunctionApproximation);
+ }
+ input.ReadMessage(subBuilder);
+ FunctionApproximation = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ClassIdFunctionApproximations();
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdFunctionApproximations) {
+ subBuilder.MergeFrom(ClassIdFunctionApproximations);
+ }
+ input.ReadMessage(subBuilder);
+ ClassIdFunctionApproximations = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SigmoidCalibration();
+ if (calibratorCase_ == CalibratorOneofCase.SigmoidCalibration) {
+ subBuilder.MergeFrom(SigmoidCalibration);
+ }
+ input.ReadMessage(subBuilder);
+ SigmoidCalibration = subBuilder;
+ break;
+ }
+ case 34: {
+ global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ClassIdSigmoidCalibrations();
+ if (calibratorCase_ == CalibratorOneofCase.ClassIdSigmoidCalibrations) {
+ subBuilder.MergeFrom(ClassIdSigmoidCalibrations);
+ }
+ input.ReadMessage(subBuilder);
+ ClassIdSigmoidCalibrations = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Message for class-agnostic domain/range mapping for function
+ /// approximations.
+ ///
+ public sealed partial class FunctionApproximation : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FunctionApproximation());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FunctionApproximation() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FunctionApproximation(FunctionApproximation other) : this() {
+ xYPairs_ = other.xYPairs_ != null ? other.xYPairs_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FunctionApproximation Clone() {
+ return new FunctionApproximation(this);
+ }
+
+ /// Field number for the "x_y_pairs" field.
+ public const int XYPairsFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.XYPairs xYPairs_;
+ ///
+ /// Message mapping class labels to indices
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.XYPairs XYPairs {
+ get { return xYPairs_; }
+ set {
+ xYPairs_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as FunctionApproximation);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(FunctionApproximation other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(XYPairs, other.XYPairs)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (xYPairs_ != null) hash ^= XYPairs.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (xYPairs_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(XYPairs);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (xYPairs_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(XYPairs);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(FunctionApproximation other) {
+ if (other == null) {
+ return;
+ }
+ if (other.xYPairs_ != null) {
+ if (xYPairs_ == null) {
+ xYPairs_ = new global::Tensorflow.Models.ObjectDetection.Protos.XYPairs();
+ }
+ XYPairs.MergeFrom(other.XYPairs);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (xYPairs_ == null) {
+ xYPairs_ = new global::Tensorflow.Models.ObjectDetection.Protos.XYPairs();
+ }
+ input.ReadMessage(xYPairs_);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Message for class-specific domain/range mapping for function
+ /// approximations.
+ ///
+ public sealed partial class ClassIdFunctionApproximations : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClassIdFunctionApproximations());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ClassIdFunctionApproximations() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ClassIdFunctionApproximations(ClassIdFunctionApproximations other) : this() {
+ classIdXyPairsMap_ = other.classIdXyPairsMap_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ClassIdFunctionApproximations Clone() {
+ return new ClassIdFunctionApproximations(this);
+ }
+
+ /// Field number for the "class_id_xy_pairs_map" field.
+ public const int ClassIdXyPairsMapFieldNumber = 1;
+ private static readonly pbc::MapField.Codec _map_classIdXyPairsMap_codec
+ = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Tensorflow.Models.ObjectDetection.Protos.XYPairs.Parser), 10);
+ private readonly pbc::MapField classIdXyPairsMap_ = new pbc::MapField();
+ ///
+ /// Message mapping class ids to indices.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::MapField ClassIdXyPairsMap {
+ get { return classIdXyPairsMap_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ClassIdFunctionApproximations);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ClassIdFunctionApproximations other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!ClassIdXyPairsMap.Equals(other.ClassIdXyPairsMap)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= ClassIdXyPairsMap.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ classIdXyPairsMap_.WriteTo(output, _map_classIdXyPairsMap_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ size += classIdXyPairsMap_.CalculateSize(_map_classIdXyPairsMap_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ClassIdFunctionApproximations other) {
+ if (other == null) {
+ return;
+ }
+ classIdXyPairsMap_.Add(other.classIdXyPairsMap_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ classIdXyPairsMap_.AddEntriesFrom(input, _map_classIdXyPairsMap_codec);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Message for class-agnostic Sigmoid Calibration.
+ ///
+ public sealed partial class SigmoidCalibration : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SigmoidCalibration());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SigmoidCalibration() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SigmoidCalibration(SigmoidCalibration other) : this() {
+ sigmoidParameters_ = other.sigmoidParameters_ != null ? other.sigmoidParameters_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SigmoidCalibration Clone() {
+ return new SigmoidCalibration(this);
+ }
+
+ /// Field number for the "sigmoid_parameters" field.
+ public const int SigmoidParametersFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters sigmoidParameters_;
+ ///
+ /// Message mapping class index to Sigmoid Parameters
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters SigmoidParameters {
+ get { return sigmoidParameters_; }
+ set {
+ sigmoidParameters_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as SigmoidCalibration);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(SigmoidCalibration other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(SigmoidParameters, other.SigmoidParameters)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (sigmoidParameters_ != null) hash ^= SigmoidParameters.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (sigmoidParameters_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(SigmoidParameters);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (sigmoidParameters_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(SigmoidParameters);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(SigmoidCalibration other) {
+ if (other == null) {
+ return;
+ }
+ if (other.sigmoidParameters_ != null) {
+ if (sigmoidParameters_ == null) {
+ sigmoidParameters_ = new global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters();
+ }
+ SigmoidParameters.MergeFrom(other.SigmoidParameters);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (sigmoidParameters_ == null) {
+ sigmoidParameters_ = new global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters();
+ }
+ input.ReadMessage(sigmoidParameters_);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Message for class-specific Sigmoid Calibration.
+ ///
+ public sealed partial class ClassIdSigmoidCalibrations : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClassIdSigmoidCalibrations());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ClassIdSigmoidCalibrations() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ClassIdSigmoidCalibrations(ClassIdSigmoidCalibrations other) : this() {
+ classIdSigmoidParametersMap_ = other.classIdSigmoidParametersMap_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ClassIdSigmoidCalibrations Clone() {
+ return new ClassIdSigmoidCalibrations(this);
+ }
+
+ /// Field number for the "class_id_sigmoid_parameters_map" field.
+ public const int ClassIdSigmoidParametersMapFieldNumber = 1;
+ private static readonly pbc::MapField.Codec _map_classIdSigmoidParametersMap_codec
+ = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8), pb::FieldCodec.ForMessage(18, global::Tensorflow.Models.ObjectDetection.Protos.SigmoidParameters.Parser), 10);
+ private readonly pbc::MapField classIdSigmoidParametersMap_ = new pbc::MapField();
+ ///
+ /// Message mapping class index to Sigmoid Parameters.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::MapField ClassIdSigmoidParametersMap {
+ get { return classIdSigmoidParametersMap_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ClassIdSigmoidCalibrations);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ClassIdSigmoidCalibrations other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!ClassIdSigmoidParametersMap.Equals(other.ClassIdSigmoidParametersMap)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= ClassIdSigmoidParametersMap.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ classIdSigmoidParametersMap_.WriteTo(output, _map_classIdSigmoidParametersMap_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ size += classIdSigmoidParametersMap_.CalculateSize(_map_classIdSigmoidParametersMap_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ClassIdSigmoidCalibrations other) {
+ if (other == null) {
+ return;
+ }
+ classIdSigmoidParametersMap_.Add(other.classIdSigmoidParametersMap_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ classIdSigmoidParametersMap_.AddEntriesFrom(input, _map_classIdSigmoidParametersMap_codec);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Message to store a domain/range pair for function to be approximated.
+ ///
+ public sealed partial class XYPairs : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new XYPairs());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[5]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public XYPairs() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public XYPairs(XYPairs other) : this() {
+ xYPair_ = other.xYPair_.Clone();
+ trainingDataType_ = other.trainingDataType_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public XYPairs Clone() {
+ return new XYPairs(this);
+ }
+
+ /// Field number for the "x_y_pair" field.
+ public const int XYPairFieldNumber = 1;
+ private static readonly pb::FieldCodec _repeated_xYPair_codec
+ = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.XYPairs.Types.XYPair.Parser);
+ private readonly pbc::RepeatedField xYPair_ = new pbc::RepeatedField();
+ ///
+ /// Sequence of x/y pairs for function approximation.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField XYPair {
+ get { return xYPair_; }
+ }
+
+ /// Field number for the "training_data_type" field.
+ public const int TrainingDataTypeFieldNumber = 2;
+ private global::Tensorflow.Models.ObjectDetection.Protos.TrainingDataType trainingDataType_ = 0;
+ ///
+ /// Description of data used to fit the calibration model.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.TrainingDataType TrainingDataType {
+ get { return trainingDataType_; }
+ set {
+ trainingDataType_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as XYPairs);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(XYPairs other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if(!xYPair_.Equals(other.xYPair_)) return false;
+ if (TrainingDataType != other.TrainingDataType) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= xYPair_.GetHashCode();
+ if (TrainingDataType != 0) hash ^= TrainingDataType.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ xYPair_.WriteTo(output, _repeated_xYPair_codec);
+ if (TrainingDataType != 0) {
+ output.WriteRawTag(16);
+ output.WriteEnum((int) TrainingDataType);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ size += xYPair_.CalculateSize(_repeated_xYPair_codec);
+ if (TrainingDataType != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) TrainingDataType);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(XYPairs other) {
+ if (other == null) {
+ return;
+ }
+ xYPair_.Add(other.xYPair_);
+ if (other.TrainingDataType != 0) {
+ TrainingDataType = other.TrainingDataType;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ xYPair_.AddEntriesFrom(input, _repeated_xYPair_codec);
+ break;
+ }
+ case 16: {
+ trainingDataType_ = (global::Tensorflow.Models.ObjectDetection.Protos.TrainingDataType) input.ReadEnum();
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the XYPairs message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ public sealed partial class XYPair : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new XYPair());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.XYPairs.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public XYPair() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public XYPair(XYPair other) : this() {
+ x_ = other.x_;
+ y_ = other.y_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public XYPair Clone() {
+ return new XYPair(this);
+ }
+
+ /// Field number for the "x" field.
+ public const int XFieldNumber = 1;
+ private float x_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float X {
+ get { return x_; }
+ set {
+ x_ = value;
+ }
+ }
+
+ /// Field number for the "y" field.
+ public const int YFieldNumber = 2;
+ private float y_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Y {
+ get { return y_; }
+ set {
+ y_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as XYPair);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(XYPair other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X);
+ if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (X != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(X);
+ }
+ if (Y != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(Y);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (X != 0F) {
+ size += 1 + 4;
+ }
+ if (Y != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(XYPair other) {
+ if (other == null) {
+ return;
+ }
+ if (other.X != 0F) {
+ X = other.X;
+ }
+ if (other.Y != 0F) {
+ Y = other.Y;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ X = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ Y = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+ #endregion
+
+ }
+
+ ///
+ /// Message defining parameters for sigmoid calibration.
+ ///
+ public sealed partial class SigmoidParameters : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SigmoidParameters());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor.MessageTypes[6]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SigmoidParameters() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SigmoidParameters(SigmoidParameters other) : this() {
+ a_ = other.a_;
+ b_ = other.b_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public SigmoidParameters Clone() {
+ return new SigmoidParameters(this);
+ }
+
+ /// Field number for the "a" field.
+ public const int AFieldNumber = 1;
+ private float a_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float A {
+ get { return a_; }
+ set {
+ a_ = value;
+ }
+ }
+
+ /// Field number for the "b" field.
+ public const int BFieldNumber = 2;
+ private float b_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float B {
+ get { return b_; }
+ set {
+ b_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as SigmoidParameters);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(SigmoidParameters other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(A, other.A)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(B, other.B)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (A != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(A);
+ if (B != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(B);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (A != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(A);
+ }
+ if (B != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(B);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (A != 0F) {
+ size += 1 + 4;
+ }
+ if (B != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(SigmoidParameters other) {
+ if (other == null) {
+ return;
+ }
+ if (other.A != 0F) {
+ A = other.A;
+ }
+ if (other.B != 0F) {
+ B = other.B;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ A = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ B = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs
new file mode 100644
index 00000000..b33b5869
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs
@@ -0,0 +1,901 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/eval.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/eval.proto
+ public static partial class EvalReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/eval.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static EvalReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CiJvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9ldmFsLnByb3RvEhdvYmplY3Rf",
+ "ZGV0ZWN0aW9uLnByb3RvcyK3BQoKRXZhbENvbmZpZxISCgpiYXRjaF9zaXpl",
+ "GBkgASgNEhoKEm51bV92aXN1YWxpemF0aW9ucxgBIAEoDRIUCgxudW1fZXhh",
+ "bXBsZXMYAiABKA0SGgoSZXZhbF9pbnRlcnZhbF9zZWNzGAMgASgNEhEKCW1h",
+ "eF9ldmFscxgEIAEoDRISCgpzYXZlX2dyYXBoGAUgASgIEiAKGHZpc3VhbGl6",
+ "YXRpb25fZXhwb3J0X2RpchgGIAEoCRITCgtldmFsX21hc3RlchgHIAEoCRIT",
+ "CgttZXRyaWNzX3NldBgIIAMoCRITCgtleHBvcnRfcGF0aBgJIAEoCRIaChJp",
+ "Z25vcmVfZ3JvdW5kdHJ1dGgYCiABKAgSGwoTdXNlX21vdmluZ19hdmVyYWdl",
+ "cxgLIAEoCBIbChNldmFsX2luc3RhbmNlX21hc2tzGAwgASgIEhsKE21pbl9z",
+ "Y29yZV90aHJlc2hvbGQYDSABKAISIgoabWF4X251bV9ib3hlc190b192aXN1",
+ "YWxpemUYDiABKAUSEwoLc2tpcF9zY29yZXMYDyABKAgSEwoLc2tpcF9sYWJl",
+ "bHMYECABKAgSIwobdmlzdWFsaXplX2dyb3VuZHRydXRoX2JveGVzGBEgASgI",
+ "EisKI2dyb3VuZHRydXRoX2JveF92aXN1YWxpemF0aW9uX2NvbG9yGBIgASgJ",
+ "Ei4KJmtlZXBfaW1hZ2VfaWRfZm9yX3Zpc3VhbGl6YXRpb25fZXhwb3J0GBMg",
+ "ASgIEh4KFnJldGFpbl9vcmlnaW5hbF9pbWFnZXMYFyABKAgSJAocaW5jbHVk",
+ "ZV9tZXRyaWNzX3Blcl9jYXRlZ29yeRgYIAEoCBIaChJyZWNhbGxfbG93ZXJf",
+ "Ym91bmQYGiABKAISGgoScmVjYWxsX3VwcGVyX2JvdW5kGBsgASgCYgZwcm90",
+ "bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.EvalConfig), global::Tensorflow.Models.ObjectDetection.Protos.EvalConfig.Parser, new[]{ "BatchSize", "NumVisualizations", "NumExamples", "EvalIntervalSecs", "MaxEvals", "SaveGraph", "VisualizationExportDir", "EvalMaster", "MetricsSet", "ExportPath", "IgnoreGroundtruth", "UseMovingAverages", "EvalInstanceMasks", "MinScoreThreshold", "MaxNumBoxesToVisualize", "SkipScores", "SkipLabels", "VisualizeGroundtruthBoxes", "GroundtruthBoxVisualizationColor", "KeepImageIdForVisualizationExport", "RetainOriginalImages", "IncludeMetricsPerCategory", "RecallLowerBound", "RecallUpperBound" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Message for configuring DetectionModel evaluation jobs (eval.py).
+ ///
+ public sealed partial class EvalConfig : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EvalConfig());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.EvalReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EvalConfig() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EvalConfig(EvalConfig other) : this() {
+ batchSize_ = other.batchSize_;
+ numVisualizations_ = other.numVisualizations_;
+ numExamples_ = other.numExamples_;
+ evalIntervalSecs_ = other.evalIntervalSecs_;
+ maxEvals_ = other.maxEvals_;
+ saveGraph_ = other.saveGraph_;
+ visualizationExportDir_ = other.visualizationExportDir_;
+ evalMaster_ = other.evalMaster_;
+ metricsSet_ = other.metricsSet_.Clone();
+ exportPath_ = other.exportPath_;
+ ignoreGroundtruth_ = other.ignoreGroundtruth_;
+ useMovingAverages_ = other.useMovingAverages_;
+ evalInstanceMasks_ = other.evalInstanceMasks_;
+ minScoreThreshold_ = other.minScoreThreshold_;
+ maxNumBoxesToVisualize_ = other.maxNumBoxesToVisualize_;
+ skipScores_ = other.skipScores_;
+ skipLabels_ = other.skipLabels_;
+ visualizeGroundtruthBoxes_ = other.visualizeGroundtruthBoxes_;
+ groundtruthBoxVisualizationColor_ = other.groundtruthBoxVisualizationColor_;
+ keepImageIdForVisualizationExport_ = other.keepImageIdForVisualizationExport_;
+ retainOriginalImages_ = other.retainOriginalImages_;
+ includeMetricsPerCategory_ = other.includeMetricsPerCategory_;
+ recallLowerBound_ = other.recallLowerBound_;
+ recallUpperBound_ = other.recallUpperBound_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EvalConfig Clone() {
+ return new EvalConfig(this);
+ }
+
+ /// Field number for the "batch_size" field.
+ public const int BatchSizeFieldNumber = 25;
+ private uint batchSize_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint BatchSize {
+ get { return batchSize_; }
+ set {
+ batchSize_ = value;
+ }
+ }
+
+ /// Field number for the "num_visualizations" field.
+ public const int NumVisualizationsFieldNumber = 1;
+ private uint numVisualizations_;
+ ///
+ /// Number of visualization images to generate.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumVisualizations {
+ get { return numVisualizations_; }
+ set {
+ numVisualizations_ = value;
+ }
+ }
+
+ /// Field number for the "num_examples" field.
+ public const int NumExamplesFieldNumber = 2;
+ private uint numExamples_;
+ ///
+ /// Number of examples to process of evaluation.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumExamples {
+ get { return numExamples_; }
+ set {
+ numExamples_ = value;
+ }
+ }
+
+ /// Field number for the "eval_interval_secs" field.
+ public const int EvalIntervalSecsFieldNumber = 3;
+ private uint evalIntervalSecs_;
+ ///
+ /// How often to run evaluation.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint EvalIntervalSecs {
+ get { return evalIntervalSecs_; }
+ set {
+ evalIntervalSecs_ = value;
+ }
+ }
+
+ /// Field number for the "max_evals" field.
+ public const int MaxEvalsFieldNumber = 4;
+ private uint maxEvals_;
+ ///
+ /// Maximum number of times to run evaluation. If set to 0, will run forever.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint MaxEvals {
+ get { return maxEvals_; }
+ set {
+ maxEvals_ = value;
+ }
+ }
+
+ /// Field number for the "save_graph" field.
+ public const int SaveGraphFieldNumber = 5;
+ private bool saveGraph_;
+ ///
+ /// Whether the TensorFlow graph used for evaluation should be saved to disk.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool SaveGraph {
+ get { return saveGraph_; }
+ set {
+ saveGraph_ = value;
+ }
+ }
+
+ /// Field number for the "visualization_export_dir" field.
+ public const int VisualizationExportDirFieldNumber = 6;
+ private string visualizationExportDir_ = "";
+ ///
+ /// Path to directory to store visualizations in. If empty, visualization
+ /// images are not exported (only shown on Tensorboard).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string VisualizationExportDir {
+ get { return visualizationExportDir_; }
+ set {
+ visualizationExportDir_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "eval_master" field.
+ public const int EvalMasterFieldNumber = 7;
+ private string evalMaster_ = "";
+ ///
+ /// BNS name of the TensorFlow master.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string EvalMaster {
+ get { return evalMaster_; }
+ set {
+ evalMaster_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "metrics_set" field.
+ public const int MetricsSetFieldNumber = 8;
+ private static readonly pb::FieldCodec _repeated_metricsSet_codec
+ = pb::FieldCodec.ForString(66);
+ private readonly pbc::RepeatedField metricsSet_ = new pbc::RepeatedField();
+ ///
+ /// Type of metrics to use for evaluation.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField MetricsSet {
+ get { return metricsSet_; }
+ }
+
+ /// Field number for the "export_path" field.
+ public const int ExportPathFieldNumber = 9;
+ private string exportPath_ = "";
+ ///
+ /// Path to export detections to COCO compatible JSON format.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string ExportPath {
+ get { return exportPath_; }
+ set {
+ exportPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "ignore_groundtruth" field.
+ public const int IgnoreGroundtruthFieldNumber = 10;
+ private bool ignoreGroundtruth_;
+ ///
+ /// Option to not read groundtruth labels and only export detections to
+ /// COCO-compatible JSON file.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool IgnoreGroundtruth {
+ get { return ignoreGroundtruth_; }
+ set {
+ ignoreGroundtruth_ = value;
+ }
+ }
+
+ /// Field number for the "use_moving_averages" field.
+ public const int UseMovingAveragesFieldNumber = 11;
+ private bool useMovingAverages_;
+ ///
+ /// Use exponential moving averages of variables for evaluation.
+ /// TODO(rathodv): When this is false make sure the model is constructed
+ /// without moving averages in restore_fn.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseMovingAverages {
+ get { return useMovingAverages_; }
+ set {
+ useMovingAverages_ = value;
+ }
+ }
+
+ /// Field number for the "eval_instance_masks" field.
+ public const int EvalInstanceMasksFieldNumber = 12;
+ private bool evalInstanceMasks_;
+ ///
+ /// Whether to evaluate instance masks.
+ /// Note that since there is no evaluation code currently for instance
+ /// segmenation this option is unused.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool EvalInstanceMasks {
+ get { return evalInstanceMasks_; }
+ set {
+ evalInstanceMasks_ = value;
+ }
+ }
+
+ /// Field number for the "min_score_threshold" field.
+ public const int MinScoreThresholdFieldNumber = 13;
+ private float minScoreThreshold_;
+ ///
+ /// Minimum score threshold for a detected object box to be visualized
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float MinScoreThreshold {
+ get { return minScoreThreshold_; }
+ set {
+ minScoreThreshold_ = value;
+ }
+ }
+
+ /// Field number for the "max_num_boxes_to_visualize" field.
+ public const int MaxNumBoxesToVisualizeFieldNumber = 14;
+ private int maxNumBoxesToVisualize_;
+ ///
+ /// Maximum number of detections to visualize
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaxNumBoxesToVisualize {
+ get { return maxNumBoxesToVisualize_; }
+ set {
+ maxNumBoxesToVisualize_ = value;
+ }
+ }
+
+ /// Field number for the "skip_scores" field.
+ public const int SkipScoresFieldNumber = 15;
+ private bool skipScores_;
+ ///
+ /// When drawing a single detection, each label is by default visualized as
+ /// <label name> : <label score>. One can skip the name or/and score using the
+ /// following fields:
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool SkipScores {
+ get { return skipScores_; }
+ set {
+ skipScores_ = value;
+ }
+ }
+
+ /// Field number for the "skip_labels" field.
+ public const int SkipLabelsFieldNumber = 16;
+ private bool skipLabels_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool SkipLabels {
+ get { return skipLabels_; }
+ set {
+ skipLabels_ = value;
+ }
+ }
+
+ /// Field number for the "visualize_groundtruth_boxes" field.
+ public const int VisualizeGroundtruthBoxesFieldNumber = 17;
+ private bool visualizeGroundtruthBoxes_;
+ ///
+ /// Whether to show groundtruth boxes in addition to detected boxes in
+ /// visualizations.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool VisualizeGroundtruthBoxes {
+ get { return visualizeGroundtruthBoxes_; }
+ set {
+ visualizeGroundtruthBoxes_ = value;
+ }
+ }
+
+ /// Field number for the "groundtruth_box_visualization_color" field.
+ public const int GroundtruthBoxVisualizationColorFieldNumber = 18;
+ private string groundtruthBoxVisualizationColor_ = "";
+ ///
+ /// Box color for visualizing groundtruth boxes.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string GroundtruthBoxVisualizationColor {
+ get { return groundtruthBoxVisualizationColor_; }
+ set {
+ groundtruthBoxVisualizationColor_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "keep_image_id_for_visualization_export" field.
+ public const int KeepImageIdForVisualizationExportFieldNumber = 19;
+ private bool keepImageIdForVisualizationExport_;
+ ///
+ /// Whether to keep image identifier in filename when exported to
+ /// visualization_export_dir.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool KeepImageIdForVisualizationExport {
+ get { return keepImageIdForVisualizationExport_; }
+ set {
+ keepImageIdForVisualizationExport_ = value;
+ }
+ }
+
+ /// Field number for the "retain_original_images" field.
+ public const int RetainOriginalImagesFieldNumber = 23;
+ private bool retainOriginalImages_;
+ ///
+ /// Whether to retain original images (i.e. not pre-processed) in the tensor
+ /// dictionary, so that they can be displayed in Tensorboard.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool RetainOriginalImages {
+ get { return retainOriginalImages_; }
+ set {
+ retainOriginalImages_ = value;
+ }
+ }
+
+ /// Field number for the "include_metrics_per_category" field.
+ public const int IncludeMetricsPerCategoryFieldNumber = 24;
+ private bool includeMetricsPerCategory_;
+ ///
+ /// If True, additionally include per-category metrics.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool IncludeMetricsPerCategory {
+ get { return includeMetricsPerCategory_; }
+ set {
+ includeMetricsPerCategory_ = value;
+ }
+ }
+
+ /// Field number for the "recall_lower_bound" field.
+ public const int RecallLowerBoundFieldNumber = 26;
+ private float recallLowerBound_;
+ ///
+ /// Recall range within which precision should be computed.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float RecallLowerBound {
+ get { return recallLowerBound_; }
+ set {
+ recallLowerBound_ = value;
+ }
+ }
+
+ /// Field number for the "recall_upper_bound" field.
+ public const int RecallUpperBoundFieldNumber = 27;
+ private float recallUpperBound_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float RecallUpperBound {
+ get { return recallUpperBound_; }
+ set {
+ recallUpperBound_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as EvalConfig);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(EvalConfig other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (BatchSize != other.BatchSize) return false;
+ if (NumVisualizations != other.NumVisualizations) return false;
+ if (NumExamples != other.NumExamples) return false;
+ if (EvalIntervalSecs != other.EvalIntervalSecs) return false;
+ if (MaxEvals != other.MaxEvals) return false;
+ if (SaveGraph != other.SaveGraph) return false;
+ if (VisualizationExportDir != other.VisualizationExportDir) return false;
+ if (EvalMaster != other.EvalMaster) return false;
+ if(!metricsSet_.Equals(other.metricsSet_)) return false;
+ if (ExportPath != other.ExportPath) return false;
+ if (IgnoreGroundtruth != other.IgnoreGroundtruth) return false;
+ if (UseMovingAverages != other.UseMovingAverages) return false;
+ if (EvalInstanceMasks != other.EvalInstanceMasks) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScoreThreshold, other.MinScoreThreshold)) return false;
+ if (MaxNumBoxesToVisualize != other.MaxNumBoxesToVisualize) return false;
+ if (SkipScores != other.SkipScores) return false;
+ if (SkipLabels != other.SkipLabels) return false;
+ if (VisualizeGroundtruthBoxes != other.VisualizeGroundtruthBoxes) return false;
+ if (GroundtruthBoxVisualizationColor != other.GroundtruthBoxVisualizationColor) return false;
+ if (KeepImageIdForVisualizationExport != other.KeepImageIdForVisualizationExport) return false;
+ if (RetainOriginalImages != other.RetainOriginalImages) return false;
+ if (IncludeMetricsPerCategory != other.IncludeMetricsPerCategory) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RecallLowerBound, other.RecallLowerBound)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RecallUpperBound, other.RecallUpperBound)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (BatchSize != 0) hash ^= BatchSize.GetHashCode();
+ if (NumVisualizations != 0) hash ^= NumVisualizations.GetHashCode();
+ if (NumExamples != 0) hash ^= NumExamples.GetHashCode();
+ if (EvalIntervalSecs != 0) hash ^= EvalIntervalSecs.GetHashCode();
+ if (MaxEvals != 0) hash ^= MaxEvals.GetHashCode();
+ if (SaveGraph != false) hash ^= SaveGraph.GetHashCode();
+ if (VisualizationExportDir.Length != 0) hash ^= VisualizationExportDir.GetHashCode();
+ if (EvalMaster.Length != 0) hash ^= EvalMaster.GetHashCode();
+ hash ^= metricsSet_.GetHashCode();
+ if (ExportPath.Length != 0) hash ^= ExportPath.GetHashCode();
+ if (IgnoreGroundtruth != false) hash ^= IgnoreGroundtruth.GetHashCode();
+ if (UseMovingAverages != false) hash ^= UseMovingAverages.GetHashCode();
+ if (EvalInstanceMasks != false) hash ^= EvalInstanceMasks.GetHashCode();
+ if (MinScoreThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScoreThreshold);
+ if (MaxNumBoxesToVisualize != 0) hash ^= MaxNumBoxesToVisualize.GetHashCode();
+ if (SkipScores != false) hash ^= SkipScores.GetHashCode();
+ if (SkipLabels != false) hash ^= SkipLabels.GetHashCode();
+ if (VisualizeGroundtruthBoxes != false) hash ^= VisualizeGroundtruthBoxes.GetHashCode();
+ if (GroundtruthBoxVisualizationColor.Length != 0) hash ^= GroundtruthBoxVisualizationColor.GetHashCode();
+ if (KeepImageIdForVisualizationExport != false) hash ^= KeepImageIdForVisualizationExport.GetHashCode();
+ if (RetainOriginalImages != false) hash ^= RetainOriginalImages.GetHashCode();
+ if (IncludeMetricsPerCategory != false) hash ^= IncludeMetricsPerCategory.GetHashCode();
+ if (RecallLowerBound != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RecallLowerBound);
+ if (RecallUpperBound != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RecallUpperBound);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (NumVisualizations != 0) {
+ output.WriteRawTag(8);
+ output.WriteUInt32(NumVisualizations);
+ }
+ if (NumExamples != 0) {
+ output.WriteRawTag(16);
+ output.WriteUInt32(NumExamples);
+ }
+ if (EvalIntervalSecs != 0) {
+ output.WriteRawTag(24);
+ output.WriteUInt32(EvalIntervalSecs);
+ }
+ if (MaxEvals != 0) {
+ output.WriteRawTag(32);
+ output.WriteUInt32(MaxEvals);
+ }
+ if (SaveGraph != false) {
+ output.WriteRawTag(40);
+ output.WriteBool(SaveGraph);
+ }
+ if (VisualizationExportDir.Length != 0) {
+ output.WriteRawTag(50);
+ output.WriteString(VisualizationExportDir);
+ }
+ if (EvalMaster.Length != 0) {
+ output.WriteRawTag(58);
+ output.WriteString(EvalMaster);
+ }
+ metricsSet_.WriteTo(output, _repeated_metricsSet_codec);
+ if (ExportPath.Length != 0) {
+ output.WriteRawTag(74);
+ output.WriteString(ExportPath);
+ }
+ if (IgnoreGroundtruth != false) {
+ output.WriteRawTag(80);
+ output.WriteBool(IgnoreGroundtruth);
+ }
+ if (UseMovingAverages != false) {
+ output.WriteRawTag(88);
+ output.WriteBool(UseMovingAverages);
+ }
+ if (EvalInstanceMasks != false) {
+ output.WriteRawTag(96);
+ output.WriteBool(EvalInstanceMasks);
+ }
+ if (MinScoreThreshold != 0F) {
+ output.WriteRawTag(109);
+ output.WriteFloat(MinScoreThreshold);
+ }
+ if (MaxNumBoxesToVisualize != 0) {
+ output.WriteRawTag(112);
+ output.WriteInt32(MaxNumBoxesToVisualize);
+ }
+ if (SkipScores != false) {
+ output.WriteRawTag(120);
+ output.WriteBool(SkipScores);
+ }
+ if (SkipLabels != false) {
+ output.WriteRawTag(128, 1);
+ output.WriteBool(SkipLabels);
+ }
+ if (VisualizeGroundtruthBoxes != false) {
+ output.WriteRawTag(136, 1);
+ output.WriteBool(VisualizeGroundtruthBoxes);
+ }
+ if (GroundtruthBoxVisualizationColor.Length != 0) {
+ output.WriteRawTag(146, 1);
+ output.WriteString(GroundtruthBoxVisualizationColor);
+ }
+ if (KeepImageIdForVisualizationExport != false) {
+ output.WriteRawTag(152, 1);
+ output.WriteBool(KeepImageIdForVisualizationExport);
+ }
+ if (RetainOriginalImages != false) {
+ output.WriteRawTag(184, 1);
+ output.WriteBool(RetainOriginalImages);
+ }
+ if (IncludeMetricsPerCategory != false) {
+ output.WriteRawTag(192, 1);
+ output.WriteBool(IncludeMetricsPerCategory);
+ }
+ if (BatchSize != 0) {
+ output.WriteRawTag(200, 1);
+ output.WriteUInt32(BatchSize);
+ }
+ if (RecallLowerBound != 0F) {
+ output.WriteRawTag(213, 1);
+ output.WriteFloat(RecallLowerBound);
+ }
+ if (RecallUpperBound != 0F) {
+ output.WriteRawTag(221, 1);
+ output.WriteFloat(RecallUpperBound);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (BatchSize != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeUInt32Size(BatchSize);
+ }
+ if (NumVisualizations != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumVisualizations);
+ }
+ if (NumExamples != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumExamples);
+ }
+ if (EvalIntervalSecs != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(EvalIntervalSecs);
+ }
+ if (MaxEvals != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaxEvals);
+ }
+ if (SaveGraph != false) {
+ size += 1 + 1;
+ }
+ if (VisualizationExportDir.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(VisualizationExportDir);
+ }
+ if (EvalMaster.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(EvalMaster);
+ }
+ size += metricsSet_.CalculateSize(_repeated_metricsSet_codec);
+ if (ExportPath.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(ExportPath);
+ }
+ if (IgnoreGroundtruth != false) {
+ size += 1 + 1;
+ }
+ if (UseMovingAverages != false) {
+ size += 1 + 1;
+ }
+ if (EvalInstanceMasks != false) {
+ size += 1 + 1;
+ }
+ if (MinScoreThreshold != 0F) {
+ size += 1 + 4;
+ }
+ if (MaxNumBoxesToVisualize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNumBoxesToVisualize);
+ }
+ if (SkipScores != false) {
+ size += 1 + 1;
+ }
+ if (SkipLabels != false) {
+ size += 2 + 1;
+ }
+ if (VisualizeGroundtruthBoxes != false) {
+ size += 2 + 1;
+ }
+ if (GroundtruthBoxVisualizationColor.Length != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeStringSize(GroundtruthBoxVisualizationColor);
+ }
+ if (KeepImageIdForVisualizationExport != false) {
+ size += 2 + 1;
+ }
+ if (RetainOriginalImages != false) {
+ size += 2 + 1;
+ }
+ if (IncludeMetricsPerCategory != false) {
+ size += 2 + 1;
+ }
+ if (RecallLowerBound != 0F) {
+ size += 2 + 4;
+ }
+ if (RecallUpperBound != 0F) {
+ size += 2 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(EvalConfig other) {
+ if (other == null) {
+ return;
+ }
+ if (other.BatchSize != 0) {
+ BatchSize = other.BatchSize;
+ }
+ if (other.NumVisualizations != 0) {
+ NumVisualizations = other.NumVisualizations;
+ }
+ if (other.NumExamples != 0) {
+ NumExamples = other.NumExamples;
+ }
+ if (other.EvalIntervalSecs != 0) {
+ EvalIntervalSecs = other.EvalIntervalSecs;
+ }
+ if (other.MaxEvals != 0) {
+ MaxEvals = other.MaxEvals;
+ }
+ if (other.SaveGraph != false) {
+ SaveGraph = other.SaveGraph;
+ }
+ if (other.VisualizationExportDir.Length != 0) {
+ VisualizationExportDir = other.VisualizationExportDir;
+ }
+ if (other.EvalMaster.Length != 0) {
+ EvalMaster = other.EvalMaster;
+ }
+ metricsSet_.Add(other.metricsSet_);
+ if (other.ExportPath.Length != 0) {
+ ExportPath = other.ExportPath;
+ }
+ if (other.IgnoreGroundtruth != false) {
+ IgnoreGroundtruth = other.IgnoreGroundtruth;
+ }
+ if (other.UseMovingAverages != false) {
+ UseMovingAverages = other.UseMovingAverages;
+ }
+ if (other.EvalInstanceMasks != false) {
+ EvalInstanceMasks = other.EvalInstanceMasks;
+ }
+ if (other.MinScoreThreshold != 0F) {
+ MinScoreThreshold = other.MinScoreThreshold;
+ }
+ if (other.MaxNumBoxesToVisualize != 0) {
+ MaxNumBoxesToVisualize = other.MaxNumBoxesToVisualize;
+ }
+ if (other.SkipScores != false) {
+ SkipScores = other.SkipScores;
+ }
+ if (other.SkipLabels != false) {
+ SkipLabels = other.SkipLabels;
+ }
+ if (other.VisualizeGroundtruthBoxes != false) {
+ VisualizeGroundtruthBoxes = other.VisualizeGroundtruthBoxes;
+ }
+ if (other.GroundtruthBoxVisualizationColor.Length != 0) {
+ GroundtruthBoxVisualizationColor = other.GroundtruthBoxVisualizationColor;
+ }
+ if (other.KeepImageIdForVisualizationExport != false) {
+ KeepImageIdForVisualizationExport = other.KeepImageIdForVisualizationExport;
+ }
+ if (other.RetainOriginalImages != false) {
+ RetainOriginalImages = other.RetainOriginalImages;
+ }
+ if (other.IncludeMetricsPerCategory != false) {
+ IncludeMetricsPerCategory = other.IncludeMetricsPerCategory;
+ }
+ if (other.RecallLowerBound != 0F) {
+ RecallLowerBound = other.RecallLowerBound;
+ }
+ if (other.RecallUpperBound != 0F) {
+ RecallUpperBound = other.RecallUpperBound;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ NumVisualizations = input.ReadUInt32();
+ break;
+ }
+ case 16: {
+ NumExamples = input.ReadUInt32();
+ break;
+ }
+ case 24: {
+ EvalIntervalSecs = input.ReadUInt32();
+ break;
+ }
+ case 32: {
+ MaxEvals = input.ReadUInt32();
+ break;
+ }
+ case 40: {
+ SaveGraph = input.ReadBool();
+ break;
+ }
+ case 50: {
+ VisualizationExportDir = input.ReadString();
+ break;
+ }
+ case 58: {
+ EvalMaster = input.ReadString();
+ break;
+ }
+ case 66: {
+ metricsSet_.AddEntriesFrom(input, _repeated_metricsSet_codec);
+ break;
+ }
+ case 74: {
+ ExportPath = input.ReadString();
+ break;
+ }
+ case 80: {
+ IgnoreGroundtruth = input.ReadBool();
+ break;
+ }
+ case 88: {
+ UseMovingAverages = input.ReadBool();
+ break;
+ }
+ case 96: {
+ EvalInstanceMasks = input.ReadBool();
+ break;
+ }
+ case 109: {
+ MinScoreThreshold = input.ReadFloat();
+ break;
+ }
+ case 112: {
+ MaxNumBoxesToVisualize = input.ReadInt32();
+ break;
+ }
+ case 120: {
+ SkipScores = input.ReadBool();
+ break;
+ }
+ case 128: {
+ SkipLabels = input.ReadBool();
+ break;
+ }
+ case 136: {
+ VisualizeGroundtruthBoxes = input.ReadBool();
+ break;
+ }
+ case 146: {
+ GroundtruthBoxVisualizationColor = input.ReadString();
+ break;
+ }
+ case 152: {
+ KeepImageIdForVisualizationExport = input.ReadBool();
+ break;
+ }
+ case 184: {
+ RetainOriginalImages = input.ReadBool();
+ break;
+ }
+ case 192: {
+ IncludeMetricsPerCategory = input.ReadBool();
+ break;
+ }
+ case 200: {
+ BatchSize = input.ReadUInt32();
+ break;
+ }
+ case 213: {
+ RecallLowerBound = input.ReadFloat();
+ break;
+ }
+ case 221: {
+ RecallUpperBound = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs
new file mode 100644
index 00000000..f5ed1f2c
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs
@@ -0,0 +1,1592 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/faster_rcnn.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/faster_rcnn.proto
+ public static partial class FasterRcnnReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/faster_rcnn.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static FasterRcnnReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CilvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9mYXN0ZXJfcmNubi5wcm90bxIX",
+ "b2JqZWN0X2RldGVjdGlvbi5wcm90b3MaLm9iamVjdF9kZXRlY3Rpb24vcHJv",
+ "dG9zL2FuY2hvcl9nZW5lcmF0b3IucHJvdG8aK29iamVjdF9kZXRlY3Rpb24v",
+ "cHJvdG9zL2JveF9wcmVkaWN0b3IucHJvdG8aKW9iamVjdF9kZXRlY3Rpb24v",
+ "cHJvdG9zL2h5cGVycGFyYW1zLnByb3RvGitvYmplY3RfZGV0ZWN0aW9uL3By",
+ "b3Rvcy9pbWFnZV9yZXNpemVyLnByb3RvGiRvYmplY3RfZGV0ZWN0aW9uL3By",
+ "b3Rvcy9sb3NzZXMucHJvdG8aLW9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL3Bv",
+ "c3RfcHJvY2Vzc2luZy5wcm90byL5DAoKRmFzdGVyUmNubhIYChBudW1iZXJf",
+ "b2Zfc3RhZ2VzGAEgASgFEhMKC251bV9jbGFzc2VzGAMgASgFEjwKDWltYWdl",
+ "X3Jlc2l6ZXIYBCABKAsyJS5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5JbWFn",
+ "ZVJlc2l6ZXISTgoRZmVhdHVyZV9leHRyYWN0b3IYBSABKAsyMy5vYmplY3Rf",
+ "ZGV0ZWN0aW9uLnByb3Rvcy5GYXN0ZXJSY25uRmVhdHVyZUV4dHJhY3RvchJO",
+ "ChxmaXJzdF9zdGFnZV9hbmNob3JfZ2VuZXJhdG9yGAYgASgLMigub2JqZWN0",
+ "X2RldGVjdGlvbi5wcm90b3MuQW5jaG9yR2VuZXJhdG9yEh8KF2ZpcnN0X3N0",
+ "YWdlX2F0cm91c19yYXRlGAcgASgFElgKKmZpcnN0X3N0YWdlX2JveF9wcmVk",
+ "aWN0b3JfY29udl9oeXBlcnBhcmFtcxgIIAEoCzIkLm9iamVjdF9kZXRlY3Rp",
+ "b24ucHJvdG9zLkh5cGVycGFyYW1zEi0KJWZpcnN0X3N0YWdlX2JveF9wcmVk",
+ "aWN0b3Jfa2VybmVsX3NpemUYCSABKAUSJwofZmlyc3Rfc3RhZ2VfYm94X3By",
+ "ZWRpY3Rvcl9kZXB0aBgKIAEoBRIiChpmaXJzdF9zdGFnZV9taW5pYmF0Y2hf",
+ "c2l6ZRgLIAEoBRItCiVmaXJzdF9zdGFnZV9wb3NpdGl2ZV9iYWxhbmNlX2Zy",
+ "YWN0aW9uGAwgASgCEicKH2ZpcnN0X3N0YWdlX25tc19zY29yZV90aHJlc2hv",
+ "bGQYDSABKAISJQodZmlyc3Rfc3RhZ2Vfbm1zX2lvdV90aHJlc2hvbGQYDiAB",
+ "KAISIQoZZmlyc3Rfc3RhZ2VfbWF4X3Byb3Bvc2FscxgPIAEoBRIsCiRmaXJz",
+ "dF9zdGFnZV9sb2NhbGl6YXRpb25fbG9zc193ZWlnaHQYECABKAISKgoiZmly",
+ "c3Rfc3RhZ2Vfb2JqZWN0bmVzc19sb3NzX3dlaWdodBgRIAEoAhIZChFpbml0",
+ "aWFsX2Nyb3Bfc2l6ZRgSIAEoBRIbChNtYXhwb29sX2tlcm5lbF9zaXplGBMg",
+ "ASgFEhYKDm1heHBvb2xfc3RyaWRlGBQgASgFEkkKGnNlY29uZF9zdGFnZV9i",
+ "b3hfcHJlZGljdG9yGBUgASgLMiUub2JqZWN0X2RldGVjdGlvbi5wcm90b3Mu",
+ "Qm94UHJlZGljdG9yEh8KF3NlY29uZF9zdGFnZV9iYXRjaF9zaXplGBYgASgF",
+ "EiUKHXNlY29uZF9zdGFnZV9iYWxhbmNlX2ZyYWN0aW9uGBcgASgCEk0KHHNl",
+ "Y29uZF9zdGFnZV9wb3N0X3Byb2Nlc3NpbmcYGCABKAsyJy5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5Qb3N0UHJvY2Vzc2luZxItCiVzZWNvbmRfc3RhZ2Vf",
+ "bG9jYWxpemF0aW9uX2xvc3Nfd2VpZ2h0GBkgASgCEi8KJ3NlY29uZF9zdGFn",
+ "ZV9jbGFzc2lmaWNhdGlvbl9sb3NzX3dlaWdodBgaIAEoAhIwCihzZWNvbmRf",
+ "c3RhZ2VfbWFza19wcmVkaWN0aW9uX2xvc3Nfd2VpZ2h0GBsgASgCEkUKEmhh",
+ "cmRfZXhhbXBsZV9taW5lchgcIAEoCzIpLm9iamVjdF9kZXRlY3Rpb24ucHJv",
+ "dG9zLkhhcmRFeGFtcGxlTWluZXISVQogc2Vjb25kX3N0YWdlX2NsYXNzaWZp",
+ "Y2F0aW9uX2xvc3MYHSABKAsyKy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5D",
+ "bGFzc2lmaWNhdGlvbkxvc3MSIAoYaW5wbGFjZV9iYXRjaG5vcm1fdXBkYXRl",
+ "GB4gASgIEiIKGnVzZV9tYXRtdWxfY3JvcF9hbmRfcmVzaXplGB8gASgIEh0K",
+ "FWNsaXBfYW5jaG9yc190b19pbWFnZRggIAEoCBIkChx1c2VfbWF0bXVsX2dh",
+ "dGhlcl9pbl9tYXRjaGVyGCEgASgIEikKIXVzZV9zdGF0aWNfYmFsYW5jZWRf",
+ "bGFiZWxfc2FtcGxlchgiIAEoCBIZChF1c2Vfc3RhdGljX3NoYXBlcxgjIAEo",
+ "CBIUCgxyZXNpemVfbWFza3MYJCABKAgSIgoadXNlX3N0YXRpY19zaGFwZXNf",
+ "Zm9yX2V2YWwYJSABKAgibQoaRmFzdGVyUmNubkZlYXR1cmVFeHRyYWN0b3IS",
+ "DAoEdHlwZRgBIAEoCRIjChtmaXJzdF9zdGFnZV9mZWF0dXJlc19zdHJpZGUY",
+ "AiABKAUSHAoUYmF0Y2hfbm9ybV90cmFpbmFibGUYAyABKAhiBnByb3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.AnchorGeneratorReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictorReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.ImageResizerReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.LossesReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.PostProcessingReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnn), global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnn.Parser, new[]{ "NumberOfStages", "NumClasses", "ImageResizer", "FeatureExtractor", "FirstStageAnchorGenerator", "FirstStageAtrousRate", "FirstStageBoxPredictorConvHyperparams", "FirstStageBoxPredictorKernelSize", "FirstStageBoxPredictorDepth", "FirstStageMinibatchSize", "FirstStagePositiveBalanceFraction", "FirstStageNmsScoreThreshold", "FirstStageNmsIouThreshold", "FirstStageMaxProposals", "FirstStageLocalizationLossWeight", "FirstStageObjectnessLossWeight", "InitialCropSize", "MaxpoolKernelSize", "MaxpoolStride", "SecondStageBoxPredictor", "SecondStageBatchSize", "SecondStageBalanceFraction", "SecondStagePostProcessing", "SecondStageLocalizationLossWeight", "SecondStageClassificationLossWeight", "SecondStageMaskPredictionLossWeight", "HardExampleMiner", "SecondStageClassificationLoss", "InplaceBatchnormUpdate", "UseMatmulCropAndResize", "ClipAnchorsToImage", "UseMatmulGatherInMatcher", "UseStaticBalancedLabelSampler", "UseStaticShapes", "ResizeMasks", "UseStaticShapesForEval" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnFeatureExtractor), global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnFeatureExtractor.Parser, new[]{ "Type", "FirstStageFeaturesStride", "BatchNormTrainable" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration for Faster R-CNN models.
+ /// See meta_architectures/faster_rcnn_meta_arch.py and models/model_builder.py
+ ///
+ /// Naming conventions:
+ /// Faster R-CNN models have two stages: a first stage region proposal network
+ /// (or RPN) and a second stage box classifier. We thus use the prefixes
+ /// `first_stage_` and `second_stage_` to indicate the stage to which each
+ /// parameter pertains when relevant.
+ ///
+ public sealed partial class FasterRcnn : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FasterRcnn());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnn() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnn(FasterRcnn other) : this() {
+ numberOfStages_ = other.numberOfStages_;
+ numClasses_ = other.numClasses_;
+ imageResizer_ = other.imageResizer_ != null ? other.imageResizer_.Clone() : null;
+ featureExtractor_ = other.featureExtractor_ != null ? other.featureExtractor_.Clone() : null;
+ firstStageAnchorGenerator_ = other.firstStageAnchorGenerator_ != null ? other.firstStageAnchorGenerator_.Clone() : null;
+ firstStageAtrousRate_ = other.firstStageAtrousRate_;
+ firstStageBoxPredictorConvHyperparams_ = other.firstStageBoxPredictorConvHyperparams_ != null ? other.firstStageBoxPredictorConvHyperparams_.Clone() : null;
+ firstStageBoxPredictorKernelSize_ = other.firstStageBoxPredictorKernelSize_;
+ firstStageBoxPredictorDepth_ = other.firstStageBoxPredictorDepth_;
+ firstStageMinibatchSize_ = other.firstStageMinibatchSize_;
+ firstStagePositiveBalanceFraction_ = other.firstStagePositiveBalanceFraction_;
+ firstStageNmsScoreThreshold_ = other.firstStageNmsScoreThreshold_;
+ firstStageNmsIouThreshold_ = other.firstStageNmsIouThreshold_;
+ firstStageMaxProposals_ = other.firstStageMaxProposals_;
+ firstStageLocalizationLossWeight_ = other.firstStageLocalizationLossWeight_;
+ firstStageObjectnessLossWeight_ = other.firstStageObjectnessLossWeight_;
+ initialCropSize_ = other.initialCropSize_;
+ maxpoolKernelSize_ = other.maxpoolKernelSize_;
+ maxpoolStride_ = other.maxpoolStride_;
+ secondStageBoxPredictor_ = other.secondStageBoxPredictor_ != null ? other.secondStageBoxPredictor_.Clone() : null;
+ secondStageBatchSize_ = other.secondStageBatchSize_;
+ secondStageBalanceFraction_ = other.secondStageBalanceFraction_;
+ secondStagePostProcessing_ = other.secondStagePostProcessing_ != null ? other.secondStagePostProcessing_.Clone() : null;
+ secondStageLocalizationLossWeight_ = other.secondStageLocalizationLossWeight_;
+ secondStageClassificationLossWeight_ = other.secondStageClassificationLossWeight_;
+ secondStageMaskPredictionLossWeight_ = other.secondStageMaskPredictionLossWeight_;
+ hardExampleMiner_ = other.hardExampleMiner_ != null ? other.hardExampleMiner_.Clone() : null;
+ secondStageClassificationLoss_ = other.secondStageClassificationLoss_ != null ? other.secondStageClassificationLoss_.Clone() : null;
+ inplaceBatchnormUpdate_ = other.inplaceBatchnormUpdate_;
+ useMatmulCropAndResize_ = other.useMatmulCropAndResize_;
+ clipAnchorsToImage_ = other.clipAnchorsToImage_;
+ useMatmulGatherInMatcher_ = other.useMatmulGatherInMatcher_;
+ useStaticBalancedLabelSampler_ = other.useStaticBalancedLabelSampler_;
+ useStaticShapes_ = other.useStaticShapes_;
+ resizeMasks_ = other.resizeMasks_;
+ useStaticShapesForEval_ = other.useStaticShapesForEval_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnn Clone() {
+ return new FasterRcnn(this);
+ }
+
+ /// Field number for the "number_of_stages" field.
+ public const int NumberOfStagesFieldNumber = 1;
+ private int numberOfStages_;
+ ///
+ /// Whether to construct only the Region Proposal Network (RPN).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumberOfStages {
+ get { return numberOfStages_; }
+ set {
+ numberOfStages_ = value;
+ }
+ }
+
+ /// Field number for the "num_classes" field.
+ public const int NumClassesFieldNumber = 3;
+ private int numClasses_;
+ ///
+ /// Number of classes to predict.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumClasses {
+ get { return numClasses_; }
+ set {
+ numClasses_ = value;
+ }
+ }
+
+ /// Field number for the "image_resizer" field.
+ public const int ImageResizerFieldNumber = 4;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer imageResizer_;
+ ///
+ /// Image resizer for preprocessing the input image.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer ImageResizer {
+ get { return imageResizer_; }
+ set {
+ imageResizer_ = value;
+ }
+ }
+
+ /// Field number for the "feature_extractor" field.
+ public const int FeatureExtractorFieldNumber = 5;
+ private global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnFeatureExtractor featureExtractor_;
+ ///
+ /// Feature extractor config.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnFeatureExtractor FeatureExtractor {
+ get { return featureExtractor_; }
+ set {
+ featureExtractor_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_anchor_generator" field.
+ public const int FirstStageAnchorGeneratorFieldNumber = 6;
+ private global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator firstStageAnchorGenerator_;
+ ///
+ /// Anchor generator to compute RPN anchors.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator FirstStageAnchorGenerator {
+ get { return firstStageAnchorGenerator_; }
+ set {
+ firstStageAnchorGenerator_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_atrous_rate" field.
+ public const int FirstStageAtrousRateFieldNumber = 7;
+ private int firstStageAtrousRate_;
+ ///
+ /// Atrous rate for the convolution op applied to the
+ /// `first_stage_features_to_crop` tensor to obtain box predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int FirstStageAtrousRate {
+ get { return firstStageAtrousRate_; }
+ set {
+ firstStageAtrousRate_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_box_predictor_conv_hyperparams" field.
+ public const int FirstStageBoxPredictorConvHyperparamsFieldNumber = 8;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams firstStageBoxPredictorConvHyperparams_;
+ ///
+ /// Hyperparameters for the convolutional RPN box predictor.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams FirstStageBoxPredictorConvHyperparams {
+ get { return firstStageBoxPredictorConvHyperparams_; }
+ set {
+ firstStageBoxPredictorConvHyperparams_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_box_predictor_kernel_size" field.
+ public const int FirstStageBoxPredictorKernelSizeFieldNumber = 9;
+ private int firstStageBoxPredictorKernelSize_;
+ ///
+ /// Kernel size to use for the convolution op just prior to RPN box
+ /// predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int FirstStageBoxPredictorKernelSize {
+ get { return firstStageBoxPredictorKernelSize_; }
+ set {
+ firstStageBoxPredictorKernelSize_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_box_predictor_depth" field.
+ public const int FirstStageBoxPredictorDepthFieldNumber = 10;
+ private int firstStageBoxPredictorDepth_;
+ ///
+ /// Output depth for the convolution op just prior to RPN box predictions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int FirstStageBoxPredictorDepth {
+ get { return firstStageBoxPredictorDepth_; }
+ set {
+ firstStageBoxPredictorDepth_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_minibatch_size" field.
+ public const int FirstStageMinibatchSizeFieldNumber = 11;
+ private int firstStageMinibatchSize_;
+ ///
+ /// The batch size to use for computing the first stage objectness and
+ /// location losses.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int FirstStageMinibatchSize {
+ get { return firstStageMinibatchSize_; }
+ set {
+ firstStageMinibatchSize_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_positive_balance_fraction" field.
+ public const int FirstStagePositiveBalanceFractionFieldNumber = 12;
+ private float firstStagePositiveBalanceFraction_;
+ ///
+ /// Fraction of positive examples per image for the RPN.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float FirstStagePositiveBalanceFraction {
+ get { return firstStagePositiveBalanceFraction_; }
+ set {
+ firstStagePositiveBalanceFraction_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_nms_score_threshold" field.
+ public const int FirstStageNmsScoreThresholdFieldNumber = 13;
+ private float firstStageNmsScoreThreshold_;
+ ///
+ /// Non max suppression score threshold applied to first stage RPN proposals.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float FirstStageNmsScoreThreshold {
+ get { return firstStageNmsScoreThreshold_; }
+ set {
+ firstStageNmsScoreThreshold_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_nms_iou_threshold" field.
+ public const int FirstStageNmsIouThresholdFieldNumber = 14;
+ private float firstStageNmsIouThreshold_;
+ ///
+ /// Non max suppression IOU threshold applied to first stage RPN proposals.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float FirstStageNmsIouThreshold {
+ get { return firstStageNmsIouThreshold_; }
+ set {
+ firstStageNmsIouThreshold_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_max_proposals" field.
+ public const int FirstStageMaxProposalsFieldNumber = 15;
+ private int firstStageMaxProposals_;
+ ///
+ /// Maximum number of RPN proposals retained after first stage postprocessing.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int FirstStageMaxProposals {
+ get { return firstStageMaxProposals_; }
+ set {
+ firstStageMaxProposals_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_localization_loss_weight" field.
+ public const int FirstStageLocalizationLossWeightFieldNumber = 16;
+ private float firstStageLocalizationLossWeight_;
+ ///
+ /// First stage RPN localization loss weight.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float FirstStageLocalizationLossWeight {
+ get { return firstStageLocalizationLossWeight_; }
+ set {
+ firstStageLocalizationLossWeight_ = value;
+ }
+ }
+
+ /// Field number for the "first_stage_objectness_loss_weight" field.
+ public const int FirstStageObjectnessLossWeightFieldNumber = 17;
+ private float firstStageObjectnessLossWeight_;
+ ///
+ /// First stage RPN objectness loss weight.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float FirstStageObjectnessLossWeight {
+ get { return firstStageObjectnessLossWeight_; }
+ set {
+ firstStageObjectnessLossWeight_ = value;
+ }
+ }
+
+ /// Field number for the "initial_crop_size" field.
+ public const int InitialCropSizeFieldNumber = 18;
+ private int initialCropSize_;
+ ///
+ /// Output size (width and height are set to be the same) of the initial
+ /// bilinear interpolation based cropping during ROI pooling.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int InitialCropSize {
+ get { return initialCropSize_; }
+ set {
+ initialCropSize_ = value;
+ }
+ }
+
+ /// Field number for the "maxpool_kernel_size" field.
+ public const int MaxpoolKernelSizeFieldNumber = 19;
+ private int maxpoolKernelSize_;
+ ///
+ /// Kernel size of the max pool op on the cropped feature map during
+ /// ROI pooling.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaxpoolKernelSize {
+ get { return maxpoolKernelSize_; }
+ set {
+ maxpoolKernelSize_ = value;
+ }
+ }
+
+ /// Field number for the "maxpool_stride" field.
+ public const int MaxpoolStrideFieldNumber = 20;
+ private int maxpoolStride_;
+ ///
+ /// Stride of the max pool op on the cropped feature map during ROI pooling.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaxpoolStride {
+ get { return maxpoolStride_; }
+ set {
+ maxpoolStride_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_box_predictor" field.
+ public const int SecondStageBoxPredictorFieldNumber = 21;
+ private global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor secondStageBoxPredictor_;
+ ///
+ /// Hyperparameters for the second stage box predictor. If box predictor type
+ /// is set to rfcn_box_predictor, a R-FCN model is constructed, otherwise a
+ /// Faster R-CNN model is constructed.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor SecondStageBoxPredictor {
+ get { return secondStageBoxPredictor_; }
+ set {
+ secondStageBoxPredictor_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_batch_size" field.
+ public const int SecondStageBatchSizeFieldNumber = 22;
+ private int secondStageBatchSize_;
+ ///
+ /// The batch size per image used for computing the classification and refined
+ /// location loss of the box classifier.
+ /// Note that this field is ignored if `hard_example_miner` is configured.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int SecondStageBatchSize {
+ get { return secondStageBatchSize_; }
+ set {
+ secondStageBatchSize_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_balance_fraction" field.
+ public const int SecondStageBalanceFractionFieldNumber = 23;
+ private float secondStageBalanceFraction_;
+ ///
+ /// Fraction of positive examples to use per image for the box classifier.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float SecondStageBalanceFraction {
+ get { return secondStageBalanceFraction_; }
+ set {
+ secondStageBalanceFraction_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_post_processing" field.
+ public const int SecondStagePostProcessingFieldNumber = 24;
+ private global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing secondStagePostProcessing_;
+ ///
+ /// Post processing to apply on the second stage box classifier predictions.
+ /// Note: the `score_converter` provided to the FasterRCNNMetaArch constructor
+ /// is taken from this `second_stage_post_processing` proto.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing SecondStagePostProcessing {
+ get { return secondStagePostProcessing_; }
+ set {
+ secondStagePostProcessing_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_localization_loss_weight" field.
+ public const int SecondStageLocalizationLossWeightFieldNumber = 25;
+ private float secondStageLocalizationLossWeight_;
+ ///
+ /// Second stage refined localization loss weight.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float SecondStageLocalizationLossWeight {
+ get { return secondStageLocalizationLossWeight_; }
+ set {
+ secondStageLocalizationLossWeight_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_classification_loss_weight" field.
+ public const int SecondStageClassificationLossWeightFieldNumber = 26;
+ private float secondStageClassificationLossWeight_;
+ ///
+ /// Second stage classification loss weight
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float SecondStageClassificationLossWeight {
+ get { return secondStageClassificationLossWeight_; }
+ set {
+ secondStageClassificationLossWeight_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_mask_prediction_loss_weight" field.
+ public const int SecondStageMaskPredictionLossWeightFieldNumber = 27;
+ private float secondStageMaskPredictionLossWeight_;
+ ///
+ /// Second stage instance mask loss weight. Note that this is only applicable
+ /// when `MaskRCNNBoxPredictor` is selected for second stage and configured to
+ /// predict instance masks.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float SecondStageMaskPredictionLossWeight {
+ get { return secondStageMaskPredictionLossWeight_; }
+ set {
+ secondStageMaskPredictionLossWeight_ = value;
+ }
+ }
+
+ /// Field number for the "hard_example_miner" field.
+ public const int HardExampleMinerFieldNumber = 28;
+ private global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner hardExampleMiner_;
+ ///
+ /// If not left to default, applies hard example mining only to classification
+ /// and localization loss..
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner HardExampleMiner {
+ get { return hardExampleMiner_; }
+ set {
+ hardExampleMiner_ = value;
+ }
+ }
+
+ /// Field number for the "second_stage_classification_loss" field.
+ public const int SecondStageClassificationLossFieldNumber = 29;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss secondStageClassificationLoss_;
+ ///
+ /// Loss for second stage box classifers, supports Softmax and Sigmoid.
+ /// Note that score converter must be consistent with loss type.
+ /// When there are multiple labels assigned to the same boxes, recommend
+ /// to use sigmoid loss and enable merge_multiple_label_boxes.
+ /// If not specified, Softmax loss is used as default.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss SecondStageClassificationLoss {
+ get { return secondStageClassificationLoss_; }
+ set {
+ secondStageClassificationLoss_ = value;
+ }
+ }
+
+ /// Field number for the "inplace_batchnorm_update" field.
+ public const int InplaceBatchnormUpdateFieldNumber = 30;
+ private bool inplaceBatchnormUpdate_;
+ ///
+ /// Whether to update batch_norm inplace during training. This is required
+ /// for batch norm to work correctly on TPUs. When this is false, user must add
+ /// a control dependency on tf.GraphKeys.UPDATE_OPS for train/loss op in order
+ /// to update the batch norm moving average parameters.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool InplaceBatchnormUpdate {
+ get { return inplaceBatchnormUpdate_; }
+ set {
+ inplaceBatchnormUpdate_ = value;
+ }
+ }
+
+ /// Field number for the "use_matmul_crop_and_resize" field.
+ public const int UseMatmulCropAndResizeFieldNumber = 31;
+ private bool useMatmulCropAndResize_;
+ ///
+ /// Force the use of matrix multiplication based crop and resize instead of
+ /// standard tf.image.crop_and_resize while computing second stage input
+ /// feature maps.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseMatmulCropAndResize {
+ get { return useMatmulCropAndResize_; }
+ set {
+ useMatmulCropAndResize_ = value;
+ }
+ }
+
+ /// Field number for the "clip_anchors_to_image" field.
+ public const int ClipAnchorsToImageFieldNumber = 32;
+ private bool clipAnchorsToImage_;
+ ///
+ /// Normally, anchors generated for a given image size are pruned during
+ /// training if they lie outside the image window. Setting this option to true,
+ /// clips the anchors to be within the image instead of pruning.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ClipAnchorsToImage {
+ get { return clipAnchorsToImage_; }
+ set {
+ clipAnchorsToImage_ = value;
+ }
+ }
+
+ /// Field number for the "use_matmul_gather_in_matcher" field.
+ public const int UseMatmulGatherInMatcherFieldNumber = 33;
+ private bool useMatmulGatherInMatcher_;
+ ///
+ /// After peforming matching between anchors and targets, in order to pull out
+ /// targets for training Faster R-CNN meta architecture we perform a gather
+ /// operation. This options specifies whether to use an alternate
+ /// implementation of tf.gather that is faster on TPUs.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseMatmulGatherInMatcher {
+ get { return useMatmulGatherInMatcher_; }
+ set {
+ useMatmulGatherInMatcher_ = value;
+ }
+ }
+
+ /// Field number for the "use_static_balanced_label_sampler" field.
+ public const int UseStaticBalancedLabelSamplerFieldNumber = 34;
+ private bool useStaticBalancedLabelSampler_;
+ ///
+ /// Whether to use the balanced positive negative sampler implementation with
+ /// static shape guarantees.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseStaticBalancedLabelSampler {
+ get { return useStaticBalancedLabelSampler_; }
+ set {
+ useStaticBalancedLabelSampler_ = value;
+ }
+ }
+
+ /// Field number for the "use_static_shapes" field.
+ public const int UseStaticShapesFieldNumber = 35;
+ private bool useStaticShapes_;
+ ///
+ /// If True, uses implementation of ops with static shape guarantees.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseStaticShapes {
+ get { return useStaticShapes_; }
+ set {
+ useStaticShapes_ = value;
+ }
+ }
+
+ /// Field number for the "resize_masks" field.
+ public const int ResizeMasksFieldNumber = 36;
+ private bool resizeMasks_;
+ ///
+ /// Whether the masks present in groundtruth should be resized in the model to
+ /// match the image size.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ResizeMasks {
+ get { return resizeMasks_; }
+ set {
+ resizeMasks_ = value;
+ }
+ }
+
+ /// Field number for the "use_static_shapes_for_eval" field.
+ public const int UseStaticShapesForEvalFieldNumber = 37;
+ private bool useStaticShapesForEval_;
+ ///
+ /// If True, uses implementation of ops with static shape guarantees when
+ /// running evaluation (specifically not is_training if False).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseStaticShapesForEval {
+ get { return useStaticShapesForEval_; }
+ set {
+ useStaticShapesForEval_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as FasterRcnn);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(FasterRcnn other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (NumberOfStages != other.NumberOfStages) return false;
+ if (NumClasses != other.NumClasses) return false;
+ if (!object.Equals(ImageResizer, other.ImageResizer)) return false;
+ if (!object.Equals(FeatureExtractor, other.FeatureExtractor)) return false;
+ if (!object.Equals(FirstStageAnchorGenerator, other.FirstStageAnchorGenerator)) return false;
+ if (FirstStageAtrousRate != other.FirstStageAtrousRate) return false;
+ if (!object.Equals(FirstStageBoxPredictorConvHyperparams, other.FirstStageBoxPredictorConvHyperparams)) return false;
+ if (FirstStageBoxPredictorKernelSize != other.FirstStageBoxPredictorKernelSize) return false;
+ if (FirstStageBoxPredictorDepth != other.FirstStageBoxPredictorDepth) return false;
+ if (FirstStageMinibatchSize != other.FirstStageMinibatchSize) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FirstStagePositiveBalanceFraction, other.FirstStagePositiveBalanceFraction)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FirstStageNmsScoreThreshold, other.FirstStageNmsScoreThreshold)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FirstStageNmsIouThreshold, other.FirstStageNmsIouThreshold)) return false;
+ if (FirstStageMaxProposals != other.FirstStageMaxProposals) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FirstStageLocalizationLossWeight, other.FirstStageLocalizationLossWeight)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(FirstStageObjectnessLossWeight, other.FirstStageObjectnessLossWeight)) return false;
+ if (InitialCropSize != other.InitialCropSize) return false;
+ if (MaxpoolKernelSize != other.MaxpoolKernelSize) return false;
+ if (MaxpoolStride != other.MaxpoolStride) return false;
+ if (!object.Equals(SecondStageBoxPredictor, other.SecondStageBoxPredictor)) return false;
+ if (SecondStageBatchSize != other.SecondStageBatchSize) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SecondStageBalanceFraction, other.SecondStageBalanceFraction)) return false;
+ if (!object.Equals(SecondStagePostProcessing, other.SecondStagePostProcessing)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SecondStageLocalizationLossWeight, other.SecondStageLocalizationLossWeight)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SecondStageClassificationLossWeight, other.SecondStageClassificationLossWeight)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SecondStageMaskPredictionLossWeight, other.SecondStageMaskPredictionLossWeight)) return false;
+ if (!object.Equals(HardExampleMiner, other.HardExampleMiner)) return false;
+ if (!object.Equals(SecondStageClassificationLoss, other.SecondStageClassificationLoss)) return false;
+ if (InplaceBatchnormUpdate != other.InplaceBatchnormUpdate) return false;
+ if (UseMatmulCropAndResize != other.UseMatmulCropAndResize) return false;
+ if (ClipAnchorsToImage != other.ClipAnchorsToImage) return false;
+ if (UseMatmulGatherInMatcher != other.UseMatmulGatherInMatcher) return false;
+ if (UseStaticBalancedLabelSampler != other.UseStaticBalancedLabelSampler) return false;
+ if (UseStaticShapes != other.UseStaticShapes) return false;
+ if (ResizeMasks != other.ResizeMasks) return false;
+ if (UseStaticShapesForEval != other.UseStaticShapesForEval) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (NumberOfStages != 0) hash ^= NumberOfStages.GetHashCode();
+ if (NumClasses != 0) hash ^= NumClasses.GetHashCode();
+ if (imageResizer_ != null) hash ^= ImageResizer.GetHashCode();
+ if (featureExtractor_ != null) hash ^= FeatureExtractor.GetHashCode();
+ if (firstStageAnchorGenerator_ != null) hash ^= FirstStageAnchorGenerator.GetHashCode();
+ if (FirstStageAtrousRate != 0) hash ^= FirstStageAtrousRate.GetHashCode();
+ if (firstStageBoxPredictorConvHyperparams_ != null) hash ^= FirstStageBoxPredictorConvHyperparams.GetHashCode();
+ if (FirstStageBoxPredictorKernelSize != 0) hash ^= FirstStageBoxPredictorKernelSize.GetHashCode();
+ if (FirstStageBoxPredictorDepth != 0) hash ^= FirstStageBoxPredictorDepth.GetHashCode();
+ if (FirstStageMinibatchSize != 0) hash ^= FirstStageMinibatchSize.GetHashCode();
+ if (FirstStagePositiveBalanceFraction != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FirstStagePositiveBalanceFraction);
+ if (FirstStageNmsScoreThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FirstStageNmsScoreThreshold);
+ if (FirstStageNmsIouThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FirstStageNmsIouThreshold);
+ if (FirstStageMaxProposals != 0) hash ^= FirstStageMaxProposals.GetHashCode();
+ if (FirstStageLocalizationLossWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FirstStageLocalizationLossWeight);
+ if (FirstStageObjectnessLossWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(FirstStageObjectnessLossWeight);
+ if (InitialCropSize != 0) hash ^= InitialCropSize.GetHashCode();
+ if (MaxpoolKernelSize != 0) hash ^= MaxpoolKernelSize.GetHashCode();
+ if (MaxpoolStride != 0) hash ^= MaxpoolStride.GetHashCode();
+ if (secondStageBoxPredictor_ != null) hash ^= SecondStageBoxPredictor.GetHashCode();
+ if (SecondStageBatchSize != 0) hash ^= SecondStageBatchSize.GetHashCode();
+ if (SecondStageBalanceFraction != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SecondStageBalanceFraction);
+ if (secondStagePostProcessing_ != null) hash ^= SecondStagePostProcessing.GetHashCode();
+ if (SecondStageLocalizationLossWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SecondStageLocalizationLossWeight);
+ if (SecondStageClassificationLossWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SecondStageClassificationLossWeight);
+ if (SecondStageMaskPredictionLossWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SecondStageMaskPredictionLossWeight);
+ if (hardExampleMiner_ != null) hash ^= HardExampleMiner.GetHashCode();
+ if (secondStageClassificationLoss_ != null) hash ^= SecondStageClassificationLoss.GetHashCode();
+ if (InplaceBatchnormUpdate != false) hash ^= InplaceBatchnormUpdate.GetHashCode();
+ if (UseMatmulCropAndResize != false) hash ^= UseMatmulCropAndResize.GetHashCode();
+ if (ClipAnchorsToImage != false) hash ^= ClipAnchorsToImage.GetHashCode();
+ if (UseMatmulGatherInMatcher != false) hash ^= UseMatmulGatherInMatcher.GetHashCode();
+ if (UseStaticBalancedLabelSampler != false) hash ^= UseStaticBalancedLabelSampler.GetHashCode();
+ if (UseStaticShapes != false) hash ^= UseStaticShapes.GetHashCode();
+ if (ResizeMasks != false) hash ^= ResizeMasks.GetHashCode();
+ if (UseStaticShapesForEval != false) hash ^= UseStaticShapesForEval.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (NumberOfStages != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(NumberOfStages);
+ }
+ if (NumClasses != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(NumClasses);
+ }
+ if (imageResizer_ != null) {
+ output.WriteRawTag(34);
+ output.WriteMessage(ImageResizer);
+ }
+ if (featureExtractor_ != null) {
+ output.WriteRawTag(42);
+ output.WriteMessage(FeatureExtractor);
+ }
+ if (firstStageAnchorGenerator_ != null) {
+ output.WriteRawTag(50);
+ output.WriteMessage(FirstStageAnchorGenerator);
+ }
+ if (FirstStageAtrousRate != 0) {
+ output.WriteRawTag(56);
+ output.WriteInt32(FirstStageAtrousRate);
+ }
+ if (firstStageBoxPredictorConvHyperparams_ != null) {
+ output.WriteRawTag(66);
+ output.WriteMessage(FirstStageBoxPredictorConvHyperparams);
+ }
+ if (FirstStageBoxPredictorKernelSize != 0) {
+ output.WriteRawTag(72);
+ output.WriteInt32(FirstStageBoxPredictorKernelSize);
+ }
+ if (FirstStageBoxPredictorDepth != 0) {
+ output.WriteRawTag(80);
+ output.WriteInt32(FirstStageBoxPredictorDepth);
+ }
+ if (FirstStageMinibatchSize != 0) {
+ output.WriteRawTag(88);
+ output.WriteInt32(FirstStageMinibatchSize);
+ }
+ if (FirstStagePositiveBalanceFraction != 0F) {
+ output.WriteRawTag(101);
+ output.WriteFloat(FirstStagePositiveBalanceFraction);
+ }
+ if (FirstStageNmsScoreThreshold != 0F) {
+ output.WriteRawTag(109);
+ output.WriteFloat(FirstStageNmsScoreThreshold);
+ }
+ if (FirstStageNmsIouThreshold != 0F) {
+ output.WriteRawTag(117);
+ output.WriteFloat(FirstStageNmsIouThreshold);
+ }
+ if (FirstStageMaxProposals != 0) {
+ output.WriteRawTag(120);
+ output.WriteInt32(FirstStageMaxProposals);
+ }
+ if (FirstStageLocalizationLossWeight != 0F) {
+ output.WriteRawTag(133, 1);
+ output.WriteFloat(FirstStageLocalizationLossWeight);
+ }
+ if (FirstStageObjectnessLossWeight != 0F) {
+ output.WriteRawTag(141, 1);
+ output.WriteFloat(FirstStageObjectnessLossWeight);
+ }
+ if (InitialCropSize != 0) {
+ output.WriteRawTag(144, 1);
+ output.WriteInt32(InitialCropSize);
+ }
+ if (MaxpoolKernelSize != 0) {
+ output.WriteRawTag(152, 1);
+ output.WriteInt32(MaxpoolKernelSize);
+ }
+ if (MaxpoolStride != 0) {
+ output.WriteRawTag(160, 1);
+ output.WriteInt32(MaxpoolStride);
+ }
+ if (secondStageBoxPredictor_ != null) {
+ output.WriteRawTag(170, 1);
+ output.WriteMessage(SecondStageBoxPredictor);
+ }
+ if (SecondStageBatchSize != 0) {
+ output.WriteRawTag(176, 1);
+ output.WriteInt32(SecondStageBatchSize);
+ }
+ if (SecondStageBalanceFraction != 0F) {
+ output.WriteRawTag(189, 1);
+ output.WriteFloat(SecondStageBalanceFraction);
+ }
+ if (secondStagePostProcessing_ != null) {
+ output.WriteRawTag(194, 1);
+ output.WriteMessage(SecondStagePostProcessing);
+ }
+ if (SecondStageLocalizationLossWeight != 0F) {
+ output.WriteRawTag(205, 1);
+ output.WriteFloat(SecondStageLocalizationLossWeight);
+ }
+ if (SecondStageClassificationLossWeight != 0F) {
+ output.WriteRawTag(213, 1);
+ output.WriteFloat(SecondStageClassificationLossWeight);
+ }
+ if (SecondStageMaskPredictionLossWeight != 0F) {
+ output.WriteRawTag(221, 1);
+ output.WriteFloat(SecondStageMaskPredictionLossWeight);
+ }
+ if (hardExampleMiner_ != null) {
+ output.WriteRawTag(226, 1);
+ output.WriteMessage(HardExampleMiner);
+ }
+ if (secondStageClassificationLoss_ != null) {
+ output.WriteRawTag(234, 1);
+ output.WriteMessage(SecondStageClassificationLoss);
+ }
+ if (InplaceBatchnormUpdate != false) {
+ output.WriteRawTag(240, 1);
+ output.WriteBool(InplaceBatchnormUpdate);
+ }
+ if (UseMatmulCropAndResize != false) {
+ output.WriteRawTag(248, 1);
+ output.WriteBool(UseMatmulCropAndResize);
+ }
+ if (ClipAnchorsToImage != false) {
+ output.WriteRawTag(128, 2);
+ output.WriteBool(ClipAnchorsToImage);
+ }
+ if (UseMatmulGatherInMatcher != false) {
+ output.WriteRawTag(136, 2);
+ output.WriteBool(UseMatmulGatherInMatcher);
+ }
+ if (UseStaticBalancedLabelSampler != false) {
+ output.WriteRawTag(144, 2);
+ output.WriteBool(UseStaticBalancedLabelSampler);
+ }
+ if (UseStaticShapes != false) {
+ output.WriteRawTag(152, 2);
+ output.WriteBool(UseStaticShapes);
+ }
+ if (ResizeMasks != false) {
+ output.WriteRawTag(160, 2);
+ output.WriteBool(ResizeMasks);
+ }
+ if (UseStaticShapesForEval != false) {
+ output.WriteRawTag(168, 2);
+ output.WriteBool(UseStaticShapesForEval);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (NumberOfStages != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumberOfStages);
+ }
+ if (NumClasses != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumClasses);
+ }
+ if (imageResizer_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ImageResizer);
+ }
+ if (featureExtractor_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FeatureExtractor);
+ }
+ if (firstStageAnchorGenerator_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FirstStageAnchorGenerator);
+ }
+ if (FirstStageAtrousRate != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FirstStageAtrousRate);
+ }
+ if (firstStageBoxPredictorConvHyperparams_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FirstStageBoxPredictorConvHyperparams);
+ }
+ if (FirstStageBoxPredictorKernelSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FirstStageBoxPredictorKernelSize);
+ }
+ if (FirstStageBoxPredictorDepth != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FirstStageBoxPredictorDepth);
+ }
+ if (FirstStageMinibatchSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FirstStageMinibatchSize);
+ }
+ if (FirstStagePositiveBalanceFraction != 0F) {
+ size += 1 + 4;
+ }
+ if (FirstStageNmsScoreThreshold != 0F) {
+ size += 1 + 4;
+ }
+ if (FirstStageNmsIouThreshold != 0F) {
+ size += 1 + 4;
+ }
+ if (FirstStageMaxProposals != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FirstStageMaxProposals);
+ }
+ if (FirstStageLocalizationLossWeight != 0F) {
+ size += 2 + 4;
+ }
+ if (FirstStageObjectnessLossWeight != 0F) {
+ size += 2 + 4;
+ }
+ if (InitialCropSize != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(InitialCropSize);
+ }
+ if (MaxpoolKernelSize != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxpoolKernelSize);
+ }
+ if (MaxpoolStride != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxpoolStride);
+ }
+ if (secondStageBoxPredictor_ != null) {
+ size += 2 + pb::CodedOutputStream.ComputeMessageSize(SecondStageBoxPredictor);
+ }
+ if (SecondStageBatchSize != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(SecondStageBatchSize);
+ }
+ if (SecondStageBalanceFraction != 0F) {
+ size += 2 + 4;
+ }
+ if (secondStagePostProcessing_ != null) {
+ size += 2 + pb::CodedOutputStream.ComputeMessageSize(SecondStagePostProcessing);
+ }
+ if (SecondStageLocalizationLossWeight != 0F) {
+ size += 2 + 4;
+ }
+ if (SecondStageClassificationLossWeight != 0F) {
+ size += 2 + 4;
+ }
+ if (SecondStageMaskPredictionLossWeight != 0F) {
+ size += 2 + 4;
+ }
+ if (hardExampleMiner_ != null) {
+ size += 2 + pb::CodedOutputStream.ComputeMessageSize(HardExampleMiner);
+ }
+ if (secondStageClassificationLoss_ != null) {
+ size += 2 + pb::CodedOutputStream.ComputeMessageSize(SecondStageClassificationLoss);
+ }
+ if (InplaceBatchnormUpdate != false) {
+ size += 2 + 1;
+ }
+ if (UseMatmulCropAndResize != false) {
+ size += 2 + 1;
+ }
+ if (ClipAnchorsToImage != false) {
+ size += 2 + 1;
+ }
+ if (UseMatmulGatherInMatcher != false) {
+ size += 2 + 1;
+ }
+ if (UseStaticBalancedLabelSampler != false) {
+ size += 2 + 1;
+ }
+ if (UseStaticShapes != false) {
+ size += 2 + 1;
+ }
+ if (ResizeMasks != false) {
+ size += 2 + 1;
+ }
+ if (UseStaticShapesForEval != false) {
+ size += 2 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(FasterRcnn other) {
+ if (other == null) {
+ return;
+ }
+ if (other.NumberOfStages != 0) {
+ NumberOfStages = other.NumberOfStages;
+ }
+ if (other.NumClasses != 0) {
+ NumClasses = other.NumClasses;
+ }
+ if (other.imageResizer_ != null) {
+ if (imageResizer_ == null) {
+ imageResizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer();
+ }
+ ImageResizer.MergeFrom(other.ImageResizer);
+ }
+ if (other.featureExtractor_ != null) {
+ if (featureExtractor_ == null) {
+ featureExtractor_ = new global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnFeatureExtractor();
+ }
+ FeatureExtractor.MergeFrom(other.FeatureExtractor);
+ }
+ if (other.firstStageAnchorGenerator_ != null) {
+ if (firstStageAnchorGenerator_ == null) {
+ firstStageAnchorGenerator_ = new global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator();
+ }
+ FirstStageAnchorGenerator.MergeFrom(other.FirstStageAnchorGenerator);
+ }
+ if (other.FirstStageAtrousRate != 0) {
+ FirstStageAtrousRate = other.FirstStageAtrousRate;
+ }
+ if (other.firstStageBoxPredictorConvHyperparams_ != null) {
+ if (firstStageBoxPredictorConvHyperparams_ == null) {
+ firstStageBoxPredictorConvHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ FirstStageBoxPredictorConvHyperparams.MergeFrom(other.FirstStageBoxPredictorConvHyperparams);
+ }
+ if (other.FirstStageBoxPredictorKernelSize != 0) {
+ FirstStageBoxPredictorKernelSize = other.FirstStageBoxPredictorKernelSize;
+ }
+ if (other.FirstStageBoxPredictorDepth != 0) {
+ FirstStageBoxPredictorDepth = other.FirstStageBoxPredictorDepth;
+ }
+ if (other.FirstStageMinibatchSize != 0) {
+ FirstStageMinibatchSize = other.FirstStageMinibatchSize;
+ }
+ if (other.FirstStagePositiveBalanceFraction != 0F) {
+ FirstStagePositiveBalanceFraction = other.FirstStagePositiveBalanceFraction;
+ }
+ if (other.FirstStageNmsScoreThreshold != 0F) {
+ FirstStageNmsScoreThreshold = other.FirstStageNmsScoreThreshold;
+ }
+ if (other.FirstStageNmsIouThreshold != 0F) {
+ FirstStageNmsIouThreshold = other.FirstStageNmsIouThreshold;
+ }
+ if (other.FirstStageMaxProposals != 0) {
+ FirstStageMaxProposals = other.FirstStageMaxProposals;
+ }
+ if (other.FirstStageLocalizationLossWeight != 0F) {
+ FirstStageLocalizationLossWeight = other.FirstStageLocalizationLossWeight;
+ }
+ if (other.FirstStageObjectnessLossWeight != 0F) {
+ FirstStageObjectnessLossWeight = other.FirstStageObjectnessLossWeight;
+ }
+ if (other.InitialCropSize != 0) {
+ InitialCropSize = other.InitialCropSize;
+ }
+ if (other.MaxpoolKernelSize != 0) {
+ MaxpoolKernelSize = other.MaxpoolKernelSize;
+ }
+ if (other.MaxpoolStride != 0) {
+ MaxpoolStride = other.MaxpoolStride;
+ }
+ if (other.secondStageBoxPredictor_ != null) {
+ if (secondStageBoxPredictor_ == null) {
+ secondStageBoxPredictor_ = new global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor();
+ }
+ SecondStageBoxPredictor.MergeFrom(other.SecondStageBoxPredictor);
+ }
+ if (other.SecondStageBatchSize != 0) {
+ SecondStageBatchSize = other.SecondStageBatchSize;
+ }
+ if (other.SecondStageBalanceFraction != 0F) {
+ SecondStageBalanceFraction = other.SecondStageBalanceFraction;
+ }
+ if (other.secondStagePostProcessing_ != null) {
+ if (secondStagePostProcessing_ == null) {
+ secondStagePostProcessing_ = new global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing();
+ }
+ SecondStagePostProcessing.MergeFrom(other.SecondStagePostProcessing);
+ }
+ if (other.SecondStageLocalizationLossWeight != 0F) {
+ SecondStageLocalizationLossWeight = other.SecondStageLocalizationLossWeight;
+ }
+ if (other.SecondStageClassificationLossWeight != 0F) {
+ SecondStageClassificationLossWeight = other.SecondStageClassificationLossWeight;
+ }
+ if (other.SecondStageMaskPredictionLossWeight != 0F) {
+ SecondStageMaskPredictionLossWeight = other.SecondStageMaskPredictionLossWeight;
+ }
+ if (other.hardExampleMiner_ != null) {
+ if (hardExampleMiner_ == null) {
+ hardExampleMiner_ = new global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner();
+ }
+ HardExampleMiner.MergeFrom(other.HardExampleMiner);
+ }
+ if (other.secondStageClassificationLoss_ != null) {
+ if (secondStageClassificationLoss_ == null) {
+ secondStageClassificationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss();
+ }
+ SecondStageClassificationLoss.MergeFrom(other.SecondStageClassificationLoss);
+ }
+ if (other.InplaceBatchnormUpdate != false) {
+ InplaceBatchnormUpdate = other.InplaceBatchnormUpdate;
+ }
+ if (other.UseMatmulCropAndResize != false) {
+ UseMatmulCropAndResize = other.UseMatmulCropAndResize;
+ }
+ if (other.ClipAnchorsToImage != false) {
+ ClipAnchorsToImage = other.ClipAnchorsToImage;
+ }
+ if (other.UseMatmulGatherInMatcher != false) {
+ UseMatmulGatherInMatcher = other.UseMatmulGatherInMatcher;
+ }
+ if (other.UseStaticBalancedLabelSampler != false) {
+ UseStaticBalancedLabelSampler = other.UseStaticBalancedLabelSampler;
+ }
+ if (other.UseStaticShapes != false) {
+ UseStaticShapes = other.UseStaticShapes;
+ }
+ if (other.ResizeMasks != false) {
+ ResizeMasks = other.ResizeMasks;
+ }
+ if (other.UseStaticShapesForEval != false) {
+ UseStaticShapesForEval = other.UseStaticShapesForEval;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ NumberOfStages = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ NumClasses = input.ReadInt32();
+ break;
+ }
+ case 34: {
+ if (imageResizer_ == null) {
+ imageResizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer();
+ }
+ input.ReadMessage(imageResizer_);
+ break;
+ }
+ case 42: {
+ if (featureExtractor_ == null) {
+ featureExtractor_ = new global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnFeatureExtractor();
+ }
+ input.ReadMessage(featureExtractor_);
+ break;
+ }
+ case 50: {
+ if (firstStageAnchorGenerator_ == null) {
+ firstStageAnchorGenerator_ = new global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator();
+ }
+ input.ReadMessage(firstStageAnchorGenerator_);
+ break;
+ }
+ case 56: {
+ FirstStageAtrousRate = input.ReadInt32();
+ break;
+ }
+ case 66: {
+ if (firstStageBoxPredictorConvHyperparams_ == null) {
+ firstStageBoxPredictorConvHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams();
+ }
+ input.ReadMessage(firstStageBoxPredictorConvHyperparams_);
+ break;
+ }
+ case 72: {
+ FirstStageBoxPredictorKernelSize = input.ReadInt32();
+ break;
+ }
+ case 80: {
+ FirstStageBoxPredictorDepth = input.ReadInt32();
+ break;
+ }
+ case 88: {
+ FirstStageMinibatchSize = input.ReadInt32();
+ break;
+ }
+ case 101: {
+ FirstStagePositiveBalanceFraction = input.ReadFloat();
+ break;
+ }
+ case 109: {
+ FirstStageNmsScoreThreshold = input.ReadFloat();
+ break;
+ }
+ case 117: {
+ FirstStageNmsIouThreshold = input.ReadFloat();
+ break;
+ }
+ case 120: {
+ FirstStageMaxProposals = input.ReadInt32();
+ break;
+ }
+ case 133: {
+ FirstStageLocalizationLossWeight = input.ReadFloat();
+ break;
+ }
+ case 141: {
+ FirstStageObjectnessLossWeight = input.ReadFloat();
+ break;
+ }
+ case 144: {
+ InitialCropSize = input.ReadInt32();
+ break;
+ }
+ case 152: {
+ MaxpoolKernelSize = input.ReadInt32();
+ break;
+ }
+ case 160: {
+ MaxpoolStride = input.ReadInt32();
+ break;
+ }
+ case 170: {
+ if (secondStageBoxPredictor_ == null) {
+ secondStageBoxPredictor_ = new global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor();
+ }
+ input.ReadMessage(secondStageBoxPredictor_);
+ break;
+ }
+ case 176: {
+ SecondStageBatchSize = input.ReadInt32();
+ break;
+ }
+ case 189: {
+ SecondStageBalanceFraction = input.ReadFloat();
+ break;
+ }
+ case 194: {
+ if (secondStagePostProcessing_ == null) {
+ secondStagePostProcessing_ = new global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing();
+ }
+ input.ReadMessage(secondStagePostProcessing_);
+ break;
+ }
+ case 205: {
+ SecondStageLocalizationLossWeight = input.ReadFloat();
+ break;
+ }
+ case 213: {
+ SecondStageClassificationLossWeight = input.ReadFloat();
+ break;
+ }
+ case 221: {
+ SecondStageMaskPredictionLossWeight = input.ReadFloat();
+ break;
+ }
+ case 226: {
+ if (hardExampleMiner_ == null) {
+ hardExampleMiner_ = new global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner();
+ }
+ input.ReadMessage(hardExampleMiner_);
+ break;
+ }
+ case 234: {
+ if (secondStageClassificationLoss_ == null) {
+ secondStageClassificationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss();
+ }
+ input.ReadMessage(secondStageClassificationLoss_);
+ break;
+ }
+ case 240: {
+ InplaceBatchnormUpdate = input.ReadBool();
+ break;
+ }
+ case 248: {
+ UseMatmulCropAndResize = input.ReadBool();
+ break;
+ }
+ case 256: {
+ ClipAnchorsToImage = input.ReadBool();
+ break;
+ }
+ case 264: {
+ UseMatmulGatherInMatcher = input.ReadBool();
+ break;
+ }
+ case 272: {
+ UseStaticBalancedLabelSampler = input.ReadBool();
+ break;
+ }
+ case 280: {
+ UseStaticShapes = input.ReadBool();
+ break;
+ }
+ case 288: {
+ ResizeMasks = input.ReadBool();
+ break;
+ }
+ case 296: {
+ UseStaticShapesForEval = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class FasterRcnnFeatureExtractor : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FasterRcnnFeatureExtractor());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnnFeatureExtractor() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnnFeatureExtractor(FasterRcnnFeatureExtractor other) : this() {
+ type_ = other.type_;
+ firstStageFeaturesStride_ = other.firstStageFeaturesStride_;
+ batchNormTrainable_ = other.batchNormTrainable_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnnFeatureExtractor Clone() {
+ return new FasterRcnnFeatureExtractor(this);
+ }
+
+ /// Field number for the "type" field.
+ public const int TypeFieldNumber = 1;
+ private string type_ = "";
+ ///
+ /// Type of Faster R-CNN model (e.g., 'faster_rcnn_resnet101';
+ /// See builders/model_builder.py for expected types).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Type {
+ get { return type_; }
+ set {
+ type_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "first_stage_features_stride" field.
+ public const int FirstStageFeaturesStrideFieldNumber = 2;
+ private int firstStageFeaturesStride_;
+ ///
+ /// Output stride of extracted RPN feature map.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int FirstStageFeaturesStride {
+ get { return firstStageFeaturesStride_; }
+ set {
+ firstStageFeaturesStride_ = value;
+ }
+ }
+
+ /// Field number for the "batch_norm_trainable" field.
+ public const int BatchNormTrainableFieldNumber = 3;
+ private bool batchNormTrainable_;
+ ///
+ /// Whether to update batch norm parameters during training or not.
+ /// When training with a relative large batch size (e.g. 8), it could be
+ /// desirable to enable batch norm update.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool BatchNormTrainable {
+ get { return batchNormTrainable_; }
+ set {
+ batchNormTrainable_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as FasterRcnnFeatureExtractor);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(FasterRcnnFeatureExtractor other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Type != other.Type) return false;
+ if (FirstStageFeaturesStride != other.FirstStageFeaturesStride) return false;
+ if (BatchNormTrainable != other.BatchNormTrainable) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Type.Length != 0) hash ^= Type.GetHashCode();
+ if (FirstStageFeaturesStride != 0) hash ^= FirstStageFeaturesStride.GetHashCode();
+ if (BatchNormTrainable != false) hash ^= BatchNormTrainable.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Type.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(Type);
+ }
+ if (FirstStageFeaturesStride != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(FirstStageFeaturesStride);
+ }
+ if (BatchNormTrainable != false) {
+ output.WriteRawTag(24);
+ output.WriteBool(BatchNormTrainable);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Type.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Type);
+ }
+ if (FirstStageFeaturesStride != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(FirstStageFeaturesStride);
+ }
+ if (BatchNormTrainable != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(FasterRcnnFeatureExtractor other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Type.Length != 0) {
+ Type = other.Type;
+ }
+ if (other.FirstStageFeaturesStride != 0) {
+ FirstStageFeaturesStride = other.FirstStageFeaturesStride;
+ }
+ if (other.BatchNormTrainable != false) {
+ BatchNormTrainable = other.BatchNormTrainable;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ Type = input.ReadString();
+ break;
+ }
+ case 16: {
+ FirstStageFeaturesStride = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ BatchNormTrainable = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs
new file mode 100644
index 00000000..bf9dbe92
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs
@@ -0,0 +1,272 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/faster_rcnn_box_coder.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/faster_rcnn_box_coder.proto
+ public static partial class FasterRcnnBoxCoderReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/faster_rcnn_box_coder.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static FasterRcnnBoxCoderReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CjNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9mYXN0ZXJfcmNubl9ib3hfY29k",
+ "ZXIucHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zImEKEkZhc3RlclJj",
+ "bm5Cb3hDb2RlchIPCgd5X3NjYWxlGAEgASgCEg8KB3hfc2NhbGUYAiABKAIS",
+ "FAoMaGVpZ2h0X3NjYWxlGAMgASgCEhMKC3dpZHRoX3NjYWxlGAQgASgCYgZw",
+ "cm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder), global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoder.Parser, new[]{ "YScale", "XScale", "HeightScale", "WidthScale" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for FasterRCNNBoxCoder. See
+ /// box_coders/faster_rcnn_box_coder.py for details.
+ ///
+ public sealed partial class FasterRcnnBoxCoder : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FasterRcnnBoxCoder());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnBoxCoderReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnnBoxCoder() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnnBoxCoder(FasterRcnnBoxCoder other) : this() {
+ yScale_ = other.yScale_;
+ xScale_ = other.xScale_;
+ heightScale_ = other.heightScale_;
+ widthScale_ = other.widthScale_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FasterRcnnBoxCoder Clone() {
+ return new FasterRcnnBoxCoder(this);
+ }
+
+ /// Field number for the "y_scale" field.
+ public const int YScaleFieldNumber = 1;
+ private float yScale_;
+ ///
+ /// Scale factor for anchor encoded box center.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float YScale {
+ get { return yScale_; }
+ set {
+ yScale_ = value;
+ }
+ }
+
+ /// Field number for the "x_scale" field.
+ public const int XScaleFieldNumber = 2;
+ private float xScale_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float XScale {
+ get { return xScale_; }
+ set {
+ xScale_ = value;
+ }
+ }
+
+ /// Field number for the "height_scale" field.
+ public const int HeightScaleFieldNumber = 3;
+ private float heightScale_;
+ ///
+ /// Scale factor for anchor encoded box height.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float HeightScale {
+ get { return heightScale_; }
+ set {
+ heightScale_ = value;
+ }
+ }
+
+ /// Field number for the "width_scale" field.
+ public const int WidthScaleFieldNumber = 4;
+ private float widthScale_;
+ ///
+ /// Scale factor for anchor encoded box width.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float WidthScale {
+ get { return widthScale_; }
+ set {
+ widthScale_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as FasterRcnnBoxCoder);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(FasterRcnnBoxCoder other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YScale, other.YScale)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XScale, other.XScale)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HeightScale, other.HeightScale)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WidthScale, other.WidthScale)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (YScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YScale);
+ if (XScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XScale);
+ if (HeightScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HeightScale);
+ if (WidthScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WidthScale);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (YScale != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(YScale);
+ }
+ if (XScale != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(XScale);
+ }
+ if (HeightScale != 0F) {
+ output.WriteRawTag(29);
+ output.WriteFloat(HeightScale);
+ }
+ if (WidthScale != 0F) {
+ output.WriteRawTag(37);
+ output.WriteFloat(WidthScale);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (YScale != 0F) {
+ size += 1 + 4;
+ }
+ if (XScale != 0F) {
+ size += 1 + 4;
+ }
+ if (HeightScale != 0F) {
+ size += 1 + 4;
+ }
+ if (WidthScale != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(FasterRcnnBoxCoder other) {
+ if (other == null) {
+ return;
+ }
+ if (other.YScale != 0F) {
+ YScale = other.YScale;
+ }
+ if (other.XScale != 0F) {
+ XScale = other.XScale;
+ }
+ if (other.HeightScale != 0F) {
+ HeightScale = other.HeightScale;
+ }
+ if (other.WidthScale != 0F) {
+ WidthScale = other.WidthScale;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ YScale = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ XScale = input.ReadFloat();
+ break;
+ }
+ case 29: {
+ HeightScale = input.ReadFloat();
+ break;
+ }
+ case 37: {
+ WidthScale = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs
new file mode 100644
index 00000000..2847b5fd
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs
@@ -0,0 +1,476 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/flexible_grid_anchor_generator.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/flexible_grid_anchor_generator.proto
+ public static partial class FlexibleGridAnchorGeneratorReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/flexible_grid_anchor_generator.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static FlexibleGridAnchorGeneratorReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CjxvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9mbGV4aWJsZV9ncmlkX2FuY2hv",
+ "cl9nZW5lcmF0b3IucHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zInYK",
+ "G0ZsZXhpYmxlR3JpZEFuY2hvckdlbmVyYXRvchI4CgthbmNob3JfZ3JpZBgB",
+ "IAMoCzIjLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLkFuY2hvckdyaWQSHQoV",
+ "bm9ybWFsaXplX2Nvb3JkaW5hdGVzGAIgASgIIpEBCgpBbmNob3JHcmlkEhIK",
+ "CmJhc2Vfc2l6ZXMYASADKAISFQoNYXNwZWN0X3JhdGlvcxgCIAMoAhIVCg1o",
+ "ZWlnaHRfc3RyaWRlGAMgASgNEhQKDHdpZHRoX3N0cmlkZRgEIAEoDRIVCg1o",
+ "ZWlnaHRfb2Zmc2V0GAUgASgNEhQKDHdpZHRoX29mZnNldBgGIAEoDWIGcHJv",
+ "dG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator), global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGenerator.Parser, new[]{ "AnchorGrid", "NormalizeCoordinates" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid), global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid.Parser, new[]{ "BaseSizes", "AspectRatios", "HeightStride", "WidthStride", "HeightOffset", "WidthOffset" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ public sealed partial class FlexibleGridAnchorGenerator : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FlexibleGridAnchorGenerator());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGeneratorReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FlexibleGridAnchorGenerator() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FlexibleGridAnchorGenerator(FlexibleGridAnchorGenerator other) : this() {
+ anchorGrid_ = other.anchorGrid_.Clone();
+ normalizeCoordinates_ = other.normalizeCoordinates_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FlexibleGridAnchorGenerator Clone() {
+ return new FlexibleGridAnchorGenerator(this);
+ }
+
+ /// Field number for the "anchor_grid" field.
+ public const int AnchorGridFieldNumber = 1;
+ private static readonly pb::FieldCodec _repeated_anchorGrid_codec
+ = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid.Parser);
+ private readonly pbc::RepeatedField anchorGrid_ = new pbc::RepeatedField();
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField AnchorGrid {
+ get { return anchorGrid_; }
+ }
+
+ /// Field number for the "normalize_coordinates" field.
+ public const int NormalizeCoordinatesFieldNumber = 2;
+ private bool normalizeCoordinates_;
+ ///
+ /// Whether to produce anchors in normalized coordinates.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool NormalizeCoordinates {
+ get { return normalizeCoordinates_; }
+ set {
+ normalizeCoordinates_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as FlexibleGridAnchorGenerator);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(FlexibleGridAnchorGenerator other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if(!anchorGrid_.Equals(other.anchorGrid_)) return false;
+ if (NormalizeCoordinates != other.NormalizeCoordinates) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= anchorGrid_.GetHashCode();
+ if (NormalizeCoordinates != false) hash ^= NormalizeCoordinates.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ anchorGrid_.WriteTo(output, _repeated_anchorGrid_codec);
+ if (NormalizeCoordinates != false) {
+ output.WriteRawTag(16);
+ output.WriteBool(NormalizeCoordinates);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ size += anchorGrid_.CalculateSize(_repeated_anchorGrid_codec);
+ if (NormalizeCoordinates != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(FlexibleGridAnchorGenerator other) {
+ if (other == null) {
+ return;
+ }
+ anchorGrid_.Add(other.anchorGrid_);
+ if (other.NormalizeCoordinates != false) {
+ NormalizeCoordinates = other.NormalizeCoordinates;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ anchorGrid_.AddEntriesFrom(input, _repeated_anchorGrid_codec);
+ break;
+ }
+ case 16: {
+ NormalizeCoordinates = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class AnchorGrid : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AnchorGrid());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.FlexibleGridAnchorGeneratorReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGrid() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGrid(AnchorGrid other) : this() {
+ baseSizes_ = other.baseSizes_.Clone();
+ aspectRatios_ = other.aspectRatios_.Clone();
+ heightStride_ = other.heightStride_;
+ widthStride_ = other.widthStride_;
+ heightOffset_ = other.heightOffset_;
+ widthOffset_ = other.widthOffset_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public AnchorGrid Clone() {
+ return new AnchorGrid(this);
+ }
+
+ /// Field number for the "base_sizes" field.
+ public const int BaseSizesFieldNumber = 1;
+ private static readonly pb::FieldCodec _repeated_baseSizes_codec
+ = pb::FieldCodec.ForFloat(10);
+ private readonly pbc::RepeatedField baseSizes_ = new pbc::RepeatedField();
+ ///
+ /// The base sizes in pixels for each anchor in this anchor layer.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField BaseSizes {
+ get { return baseSizes_; }
+ }
+
+ /// Field number for the "aspect_ratios" field.
+ public const int AspectRatiosFieldNumber = 2;
+ private static readonly pb::FieldCodec _repeated_aspectRatios_codec
+ = pb::FieldCodec.ForFloat(18);
+ private readonly pbc::RepeatedField aspectRatios_ = new pbc::RepeatedField();
+ ///
+ /// The aspect ratios for each anchor in this anchor layer.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField AspectRatios {
+ get { return aspectRatios_; }
+ }
+
+ /// Field number for the "height_stride" field.
+ public const int HeightStrideFieldNumber = 3;
+ private uint heightStride_;
+ ///
+ /// The anchor height stride in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint HeightStride {
+ get { return heightStride_; }
+ set {
+ heightStride_ = value;
+ }
+ }
+
+ /// Field number for the "width_stride" field.
+ public const int WidthStrideFieldNumber = 4;
+ private uint widthStride_;
+ ///
+ /// The anchor width stride in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint WidthStride {
+ get { return widthStride_; }
+ set {
+ widthStride_ = value;
+ }
+ }
+
+ /// Field number for the "height_offset" field.
+ public const int HeightOffsetFieldNumber = 5;
+ private uint heightOffset_;
+ ///
+ /// The anchor height offset in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint HeightOffset {
+ get { return heightOffset_; }
+ set {
+ heightOffset_ = value;
+ }
+ }
+
+ /// Field number for the "width_offset" field.
+ public const int WidthOffsetFieldNumber = 6;
+ private uint widthOffset_;
+ ///
+ /// The anchor width offset in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint WidthOffset {
+ get { return widthOffset_; }
+ set {
+ widthOffset_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as AnchorGrid);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(AnchorGrid other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if(!baseSizes_.Equals(other.baseSizes_)) return false;
+ if(!aspectRatios_.Equals(other.aspectRatios_)) return false;
+ if (HeightStride != other.HeightStride) return false;
+ if (WidthStride != other.WidthStride) return false;
+ if (HeightOffset != other.HeightOffset) return false;
+ if (WidthOffset != other.WidthOffset) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= baseSizes_.GetHashCode();
+ hash ^= aspectRatios_.GetHashCode();
+ if (HeightStride != 0) hash ^= HeightStride.GetHashCode();
+ if (WidthStride != 0) hash ^= WidthStride.GetHashCode();
+ if (HeightOffset != 0) hash ^= HeightOffset.GetHashCode();
+ if (WidthOffset != 0) hash ^= WidthOffset.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ baseSizes_.WriteTo(output, _repeated_baseSizes_codec);
+ aspectRatios_.WriteTo(output, _repeated_aspectRatios_codec);
+ if (HeightStride != 0) {
+ output.WriteRawTag(24);
+ output.WriteUInt32(HeightStride);
+ }
+ if (WidthStride != 0) {
+ output.WriteRawTag(32);
+ output.WriteUInt32(WidthStride);
+ }
+ if (HeightOffset != 0) {
+ output.WriteRawTag(40);
+ output.WriteUInt32(HeightOffset);
+ }
+ if (WidthOffset != 0) {
+ output.WriteRawTag(48);
+ output.WriteUInt32(WidthOffset);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ size += baseSizes_.CalculateSize(_repeated_baseSizes_codec);
+ size += aspectRatios_.CalculateSize(_repeated_aspectRatios_codec);
+ if (HeightStride != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(HeightStride);
+ }
+ if (WidthStride != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(WidthStride);
+ }
+ if (HeightOffset != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(HeightOffset);
+ }
+ if (WidthOffset != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(WidthOffset);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(AnchorGrid other) {
+ if (other == null) {
+ return;
+ }
+ baseSizes_.Add(other.baseSizes_);
+ aspectRatios_.Add(other.aspectRatios_);
+ if (other.HeightStride != 0) {
+ HeightStride = other.HeightStride;
+ }
+ if (other.WidthStride != 0) {
+ WidthStride = other.WidthStride;
+ }
+ if (other.HeightOffset != 0) {
+ HeightOffset = other.HeightOffset;
+ }
+ if (other.WidthOffset != 0) {
+ WidthOffset = other.WidthOffset;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10:
+ case 13: {
+ baseSizes_.AddEntriesFrom(input, _repeated_baseSizes_codec);
+ break;
+ }
+ case 18:
+ case 21: {
+ aspectRatios_.AddEntriesFrom(input, _repeated_aspectRatios_codec);
+ break;
+ }
+ case 24: {
+ HeightStride = input.ReadUInt32();
+ break;
+ }
+ case 32: {
+ WidthStride = input.ReadUInt32();
+ break;
+ }
+ case 40: {
+ HeightOffset = input.ReadUInt32();
+ break;
+ }
+ case 48: {
+ WidthOffset = input.ReadUInt32();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs
new file mode 100644
index 00000000..04d3530c
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs
@@ -0,0 +1,417 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/graph_rewriter.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/graph_rewriter.proto
+ public static partial class GraphRewriterReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/graph_rewriter.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static GraphRewriterReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CixvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9ncmFwaF9yZXdyaXRlci5wcm90",
+ "bxIXb2JqZWN0X2RldGVjdGlvbi5wcm90b3MiTAoNR3JhcGhSZXdyaXRlchI7",
+ "CgxxdWFudGl6YXRpb24YASABKAsyJS5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv",
+ "cy5RdWFudGl6YXRpb24iXgoMUXVhbnRpemF0aW9uEg0KBWRlbGF5GAEgASgF",
+ "EhMKC3dlaWdodF9iaXRzGAIgASgFEhcKD2FjdGl2YXRpb25fYml0cxgDIAEo",
+ "BRIRCglzeW1tZXRyaWMYBCABKAhiBnByb3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriter), global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriter.Parser, new[]{ "Quantization" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Quantization), global::Tensorflow.Models.ObjectDetection.Protos.Quantization.Parser, new[]{ "Delay", "WeightBits", "ActivationBits", "Symmetric" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Message to configure graph rewriter for the tf graph.
+ ///
+ public sealed partial class GraphRewriter : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GraphRewriter());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriterReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GraphRewriter() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GraphRewriter(GraphRewriter other) : this() {
+ quantization_ = other.quantization_ != null ? other.quantization_.Clone() : null;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GraphRewriter Clone() {
+ return new GraphRewriter(this);
+ }
+
+ /// Field number for the "quantization" field.
+ public const int QuantizationFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Quantization quantization_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Quantization Quantization {
+ get { return quantization_; }
+ set {
+ quantization_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as GraphRewriter);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(GraphRewriter other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(Quantization, other.Quantization)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (quantization_ != null) hash ^= Quantization.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (quantization_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(Quantization);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (quantization_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Quantization);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(GraphRewriter other) {
+ if (other == null) {
+ return;
+ }
+ if (other.quantization_ != null) {
+ if (quantization_ == null) {
+ quantization_ = new global::Tensorflow.Models.ObjectDetection.Protos.Quantization();
+ }
+ Quantization.MergeFrom(other.Quantization);
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (quantization_ == null) {
+ quantization_ = new global::Tensorflow.Models.ObjectDetection.Protos.Quantization();
+ }
+ input.ReadMessage(quantization_);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Message for quantization options. See
+ /// tensorflow/contrib/quantize/python/quantize.py for details.
+ ///
+ public sealed partial class Quantization : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Quantization());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriterReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Quantization() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Quantization(Quantization other) : this() {
+ delay_ = other.delay_;
+ weightBits_ = other.weightBits_;
+ activationBits_ = other.activationBits_;
+ symmetric_ = other.symmetric_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Quantization Clone() {
+ return new Quantization(this);
+ }
+
+ /// Field number for the "delay" field.
+ public const int DelayFieldNumber = 1;
+ private int delay_;
+ ///
+ /// Number of steps to delay before quantization takes effect during training.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Delay {
+ get { return delay_; }
+ set {
+ delay_ = value;
+ }
+ }
+
+ /// Field number for the "weight_bits" field.
+ public const int WeightBitsFieldNumber = 2;
+ private int weightBits_;
+ ///
+ /// Number of bits to use for quantizing weights.
+ /// Only 8 bit is supported for now.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int WeightBits {
+ get { return weightBits_; }
+ set {
+ weightBits_ = value;
+ }
+ }
+
+ /// Field number for the "activation_bits" field.
+ public const int ActivationBitsFieldNumber = 3;
+ private int activationBits_;
+ ///
+ /// Number of bits to use for quantizing activations.
+ /// Only 8 bit is supported for now.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int ActivationBits {
+ get { return activationBits_; }
+ set {
+ activationBits_ = value;
+ }
+ }
+
+ /// Field number for the "symmetric" field.
+ public const int SymmetricFieldNumber = 4;
+ private bool symmetric_;
+ ///
+ /// Whether to use symmetric weight quantization.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Symmetric {
+ get { return symmetric_; }
+ set {
+ symmetric_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Quantization);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Quantization other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Delay != other.Delay) return false;
+ if (WeightBits != other.WeightBits) return false;
+ if (ActivationBits != other.ActivationBits) return false;
+ if (Symmetric != other.Symmetric) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Delay != 0) hash ^= Delay.GetHashCode();
+ if (WeightBits != 0) hash ^= WeightBits.GetHashCode();
+ if (ActivationBits != 0) hash ^= ActivationBits.GetHashCode();
+ if (Symmetric != false) hash ^= Symmetric.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Delay != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Delay);
+ }
+ if (WeightBits != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(WeightBits);
+ }
+ if (ActivationBits != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(ActivationBits);
+ }
+ if (Symmetric != false) {
+ output.WriteRawTag(32);
+ output.WriteBool(Symmetric);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Delay != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Delay);
+ }
+ if (WeightBits != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(WeightBits);
+ }
+ if (ActivationBits != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(ActivationBits);
+ }
+ if (Symmetric != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Quantization other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Delay != 0) {
+ Delay = other.Delay;
+ }
+ if (other.WeightBits != 0) {
+ WeightBits = other.WeightBits;
+ }
+ if (other.ActivationBits != 0) {
+ ActivationBits = other.ActivationBits;
+ }
+ if (other.Symmetric != false) {
+ Symmetric = other.Symmetric;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Delay = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ WeightBits = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ ActivationBits = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ Symmetric = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs
new file mode 100644
index 00000000..76b31e74
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs
@@ -0,0 +1,386 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/grid_anchor_generator.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/grid_anchor_generator.proto
+ public static partial class GridAnchorGeneratorReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/grid_anchor_generator.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static GridAnchorGeneratorReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CjNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9ncmlkX2FuY2hvcl9nZW5lcmF0",
+ "b3IucHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zIrUBChNHcmlkQW5j",
+ "aG9yR2VuZXJhdG9yEg4KBmhlaWdodBgBIAEoBRINCgV3aWR0aBgCIAEoBRIV",
+ "Cg1oZWlnaHRfc3RyaWRlGAMgASgFEhQKDHdpZHRoX3N0cmlkZRgEIAEoBRIV",
+ "Cg1oZWlnaHRfb2Zmc2V0GAUgASgFEhQKDHdpZHRoX29mZnNldBgGIAEoBRIO",
+ "CgZzY2FsZXMYByADKAISFQoNYXNwZWN0X3JhdGlvcxgIIAMoAmIGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator), global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGenerator.Parser, new[]{ "Height", "Width", "HeightStride", "WidthStride", "HeightOffset", "WidthOffset", "Scales", "AspectRatios" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for GridAnchorGenerator. See
+ /// anchor_generators/grid_anchor_generator.py for details.
+ ///
+ public sealed partial class GridAnchorGenerator : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GridAnchorGenerator());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.GridAnchorGeneratorReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GridAnchorGenerator() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GridAnchorGenerator(GridAnchorGenerator other) : this() {
+ height_ = other.height_;
+ width_ = other.width_;
+ heightStride_ = other.heightStride_;
+ widthStride_ = other.widthStride_;
+ heightOffset_ = other.heightOffset_;
+ widthOffset_ = other.widthOffset_;
+ scales_ = other.scales_.Clone();
+ aspectRatios_ = other.aspectRatios_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GridAnchorGenerator Clone() {
+ return new GridAnchorGenerator(this);
+ }
+
+ /// Field number for the "height" field.
+ public const int HeightFieldNumber = 1;
+ private int height_;
+ ///
+ /// Anchor height in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Height {
+ get { return height_; }
+ set {
+ height_ = value;
+ }
+ }
+
+ /// Field number for the "width" field.
+ public const int WidthFieldNumber = 2;
+ private int width_;
+ ///
+ /// Anchor width in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Width {
+ get { return width_; }
+ set {
+ width_ = value;
+ }
+ }
+
+ /// Field number for the "height_stride" field.
+ public const int HeightStrideFieldNumber = 3;
+ private int heightStride_;
+ ///
+ /// Anchor stride in height dimension in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int HeightStride {
+ get { return heightStride_; }
+ set {
+ heightStride_ = value;
+ }
+ }
+
+ /// Field number for the "width_stride" field.
+ public const int WidthStrideFieldNumber = 4;
+ private int widthStride_;
+ ///
+ /// Anchor stride in width dimension in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int WidthStride {
+ get { return widthStride_; }
+ set {
+ widthStride_ = value;
+ }
+ }
+
+ /// Field number for the "height_offset" field.
+ public const int HeightOffsetFieldNumber = 5;
+ private int heightOffset_;
+ ///
+ /// Anchor height offset in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int HeightOffset {
+ get { return heightOffset_; }
+ set {
+ heightOffset_ = value;
+ }
+ }
+
+ /// Field number for the "width_offset" field.
+ public const int WidthOffsetFieldNumber = 6;
+ private int widthOffset_;
+ ///
+ /// Anchor width offset in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int WidthOffset {
+ get { return widthOffset_; }
+ set {
+ widthOffset_ = value;
+ }
+ }
+
+ /// Field number for the "scales" field.
+ public const int ScalesFieldNumber = 7;
+ private static readonly pb::FieldCodec _repeated_scales_codec
+ = pb::FieldCodec.ForFloat(58);
+ private readonly pbc::RepeatedField scales_ = new pbc::RepeatedField();
+ ///
+ /// List of scales for the anchors.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField Scales {
+ get { return scales_; }
+ }
+
+ /// Field number for the "aspect_ratios" field.
+ public const int AspectRatiosFieldNumber = 8;
+ private static readonly pb::FieldCodec _repeated_aspectRatios_codec
+ = pb::FieldCodec.ForFloat(66);
+ private readonly pbc::RepeatedField aspectRatios_ = new pbc::RepeatedField();
+ ///
+ /// List of aspect ratios for the anchors.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField AspectRatios {
+ get { return aspectRatios_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as GridAnchorGenerator);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(GridAnchorGenerator other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Height != other.Height) return false;
+ if (Width != other.Width) return false;
+ if (HeightStride != other.HeightStride) return false;
+ if (WidthStride != other.WidthStride) return false;
+ if (HeightOffset != other.HeightOffset) return false;
+ if (WidthOffset != other.WidthOffset) return false;
+ if(!scales_.Equals(other.scales_)) return false;
+ if(!aspectRatios_.Equals(other.aspectRatios_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Height != 0) hash ^= Height.GetHashCode();
+ if (Width != 0) hash ^= Width.GetHashCode();
+ if (HeightStride != 0) hash ^= HeightStride.GetHashCode();
+ if (WidthStride != 0) hash ^= WidthStride.GetHashCode();
+ if (HeightOffset != 0) hash ^= HeightOffset.GetHashCode();
+ if (WidthOffset != 0) hash ^= WidthOffset.GetHashCode();
+ hash ^= scales_.GetHashCode();
+ hash ^= aspectRatios_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Height != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Height);
+ }
+ if (Width != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(Width);
+ }
+ if (HeightStride != 0) {
+ output.WriteRawTag(24);
+ output.WriteInt32(HeightStride);
+ }
+ if (WidthStride != 0) {
+ output.WriteRawTag(32);
+ output.WriteInt32(WidthStride);
+ }
+ if (HeightOffset != 0) {
+ output.WriteRawTag(40);
+ output.WriteInt32(HeightOffset);
+ }
+ if (WidthOffset != 0) {
+ output.WriteRawTag(48);
+ output.WriteInt32(WidthOffset);
+ }
+ scales_.WriteTo(output, _repeated_scales_codec);
+ aspectRatios_.WriteTo(output, _repeated_aspectRatios_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Height != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height);
+ }
+ if (Width != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width);
+ }
+ if (HeightStride != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(HeightStride);
+ }
+ if (WidthStride != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(WidthStride);
+ }
+ if (HeightOffset != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(HeightOffset);
+ }
+ if (WidthOffset != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(WidthOffset);
+ }
+ size += scales_.CalculateSize(_repeated_scales_codec);
+ size += aspectRatios_.CalculateSize(_repeated_aspectRatios_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(GridAnchorGenerator other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Height != 0) {
+ Height = other.Height;
+ }
+ if (other.Width != 0) {
+ Width = other.Width;
+ }
+ if (other.HeightStride != 0) {
+ HeightStride = other.HeightStride;
+ }
+ if (other.WidthStride != 0) {
+ WidthStride = other.WidthStride;
+ }
+ if (other.HeightOffset != 0) {
+ HeightOffset = other.HeightOffset;
+ }
+ if (other.WidthOffset != 0) {
+ WidthOffset = other.WidthOffset;
+ }
+ scales_.Add(other.scales_);
+ aspectRatios_.Add(other.aspectRatios_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Height = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ Width = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ HeightStride = input.ReadInt32();
+ break;
+ }
+ case 32: {
+ WidthStride = input.ReadInt32();
+ break;
+ }
+ case 40: {
+ HeightOffset = input.ReadInt32();
+ break;
+ }
+ case 48: {
+ WidthOffset = input.ReadInt32();
+ break;
+ }
+ case 58:
+ case 61: {
+ scales_.AddEntriesFrom(input, _repeated_scales_codec);
+ break;
+ }
+ case 66:
+ case 69: {
+ aspectRatios_.AddEntriesFrom(input, _repeated_aspectRatios_codec);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs
new file mode 100644
index 00000000..315b1c68
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs
@@ -0,0 +1,2106 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/hyperparams.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/hyperparams.proto
+ public static partial class HyperparamsReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/hyperparams.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static HyperparamsReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CilvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9oeXBlcnBhcmFtcy5wcm90bxIX",
+ "b2JqZWN0X2RldGVjdGlvbi5wcm90b3Mi8wMKC0h5cGVycGFyYW1zEjMKAm9w",
+ "GAEgASgOMicub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuSHlwZXJwYXJhbXMu",
+ "T3ASOQoLcmVndWxhcml6ZXIYAiABKAsyJC5vYmplY3RfZGV0ZWN0aW9uLnBy",
+ "b3Rvcy5SZWd1bGFyaXplchI5Cgtpbml0aWFsaXplchgDIAEoCzIkLm9iamVj",
+ "dF9kZXRlY3Rpb24ucHJvdG9zLkluaXRpYWxpemVyEkMKCmFjdGl2YXRpb24Y",
+ "BCABKA4yLy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5IeXBlcnBhcmFtcy5B",
+ "Y3RpdmF0aW9uEjgKCmJhdGNoX25vcm0YBSABKAsyIi5vYmplY3RfZGV0ZWN0",
+ "aW9uLnByb3Rvcy5CYXRjaE5vcm1IABI4Cgpncm91cF9ub3JtGAcgASgLMiIu",
+ "b2JqZWN0X2RldGVjdGlvbi5wcm90b3MuR3JvdXBOb3JtSAASHAoUcmVndWxh",
+ "cml6ZV9kZXB0aHdpc2UYBiABKAgiIAoCT3ASCAoETlVMTBAAEggKBENPTlYQ",
+ "ARIGCgJGQxACIiwKCkFjdGl2YXRpb24SCAoETk9ORRAAEggKBFJFTFUQARIK",
+ "CgZSRUxVXzYQAkISChBub3JtYWxpemVyX29uZW9mIqYBCgtSZWd1bGFyaXpl",
+ "chJACg5sMV9yZWd1bGFyaXplchgBIAEoCzImLm9iamVjdF9kZXRlY3Rpb24u",
+ "cHJvdG9zLkwxUmVndWxhcml6ZXJIABJACg5sMl9yZWd1bGFyaXplchgCIAEo",
+ "CzImLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLkwyUmVndWxhcml6ZXJIAEIT",
+ "ChFyZWd1bGFyaXplcl9vbmVvZiIfCg1MMVJlZ3VsYXJpemVyEg4KBndlaWdo",
+ "dBgBIAEoAiIfCg1MMlJlZ3VsYXJpemVyEg4KBndlaWdodBgBIAEoAiKzAgoL",
+ "SW5pdGlhbGl6ZXISWwocdHJ1bmNhdGVkX25vcm1hbF9pbml0aWFsaXplchgB",
+ "IAEoCzIzLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlRydW5jYXRlZE5vcm1h",
+ "bEluaXRpYWxpemVySAASWwocdmFyaWFuY2Vfc2NhbGluZ19pbml0aWFsaXpl",
+ "chgCIAEoCzIzLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlZhcmlhbmNlU2Nh",
+ "bGluZ0luaXRpYWxpemVySAASVQoZcmFuZG9tX25vcm1hbF9pbml0aWFsaXpl",
+ "chgDIAEoCzIwLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJhbmRvbU5vcm1h",
+ "bEluaXRpYWxpemVySABCEwoRaW5pdGlhbGl6ZXJfb25lb2YiOgoaVHJ1bmNh",
+ "dGVkTm9ybWFsSW5pdGlhbGl6ZXISDAoEbWVhbhgBIAEoAhIOCgZzdGRkZXYY",
+ "AiABKAIiswEKGlZhcmlhbmNlU2NhbGluZ0luaXRpYWxpemVyEg4KBmZhY3Rv",
+ "chgBIAEoAhIPCgd1bmlmb3JtGAIgASgIEkYKBG1vZGUYAyABKA4yOC5vYmpl",
+ "Y3RfZGV0ZWN0aW9uLnByb3Rvcy5WYXJpYW5jZVNjYWxpbmdJbml0aWFsaXpl",
+ "ci5Nb2RlIiwKBE1vZGUSCgoGRkFOX0lOEAASCwoHRkFOX09VVBABEgsKB0ZB",
+ "Tl9BVkcQAiI3ChdSYW5kb21Ob3JtYWxJbml0aWFsaXplchIMCgRtZWFuGAEg",
+ "ASgCEg4KBnN0ZGRldhgCIAEoAiJZCglCYXRjaE5vcm0SDQoFZGVjYXkYASAB",
+ "KAISDgoGY2VudGVyGAIgASgIEg0KBXNjYWxlGAMgASgIEg8KB2Vwc2lsb24Y",
+ "BCABKAISDQoFdHJhaW4YBSABKAgiCwoJR3JvdXBOb3JtYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams), global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Parser, new[]{ "Op", "Regularizer", "Initializer", "Activation", "BatchNorm", "GroupNorm", "RegularizeDepthwise" }, new[]{ "NormalizerOneof" }, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Op), typeof(global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Activation) }, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Regularizer), global::Tensorflow.Models.ObjectDetection.Protos.Regularizer.Parser, new[]{ "L1Regularizer", "L2Regularizer" }, new[]{ "RegularizerOneof" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer), global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer.Parser, new[]{ "Weight" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer), global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer.Parser, new[]{ "Weight" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Initializer), global::Tensorflow.Models.ObjectDetection.Protos.Initializer.Parser, new[]{ "TruncatedNormalInitializer", "VarianceScalingInitializer", "RandomNormalInitializer" }, new[]{ "InitializerOneof" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer), global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer.Parser, new[]{ "Mean", "Stddev" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer), global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer.Parser, new[]{ "Factor", "Uniform", "Mode" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer.Types.Mode) }, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer), global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer.Parser, new[]{ "Mean", "Stddev" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm), global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm.Parser, new[]{ "Decay", "Center", "Scale", "Epsilon", "Train" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm), global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm.Parser, null, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for the convolution op hyperparameters to use in the
+ /// object detection pipeline.
+ ///
+ public sealed partial class Hyperparams : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Hyperparams());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Hyperparams() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Hyperparams(Hyperparams other) : this() {
+ op_ = other.op_;
+ regularizer_ = other.regularizer_ != null ? other.regularizer_.Clone() : null;
+ initializer_ = other.initializer_ != null ? other.initializer_.Clone() : null;
+ activation_ = other.activation_;
+ regularizeDepthwise_ = other.regularizeDepthwise_;
+ switch (other.NormalizerOneofCase) {
+ case NormalizerOneofOneofCase.BatchNorm:
+ BatchNorm = other.BatchNorm.Clone();
+ break;
+ case NormalizerOneofOneofCase.GroupNorm:
+ GroupNorm = other.GroupNorm.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Hyperparams Clone() {
+ return new Hyperparams(this);
+ }
+
+ /// Field number for the "op" field.
+ public const int OpFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Op op_ = 0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Op Op {
+ get { return op_; }
+ set {
+ op_ = value;
+ }
+ }
+
+ /// Field number for the "regularizer" field.
+ public const int RegularizerFieldNumber = 2;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Regularizer regularizer_;
+ ///
+ /// Regularizer for the weights of the convolution op.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Regularizer Regularizer {
+ get { return regularizer_; }
+ set {
+ regularizer_ = value;
+ }
+ }
+
+ /// Field number for the "initializer" field.
+ public const int InitializerFieldNumber = 3;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Initializer initializer_;
+ ///
+ /// Initializer for the weights of the convolution op.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Initializer Initializer {
+ get { return initializer_; }
+ set {
+ initializer_ = value;
+ }
+ }
+
+ /// Field number for the "activation" field.
+ public const int ActivationFieldNumber = 4;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Activation activation_ = 0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Activation Activation {
+ get { return activation_; }
+ set {
+ activation_ = value;
+ }
+ }
+
+ /// Field number for the "batch_norm" field.
+ public const int BatchNormFieldNumber = 5;
+ ///
+ /// Note that if nothing below is selected, then no normalization is applied
+ /// BatchNorm hyperparameters.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm BatchNorm {
+ get { return normalizerOneofCase_ == NormalizerOneofOneofCase.BatchNorm ? (global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm) normalizerOneof_ : null; }
+ set {
+ normalizerOneof_ = value;
+ normalizerOneofCase_ = value == null ? NormalizerOneofOneofCase.None : NormalizerOneofOneofCase.BatchNorm;
+ }
+ }
+
+ /// Field number for the "group_norm" field.
+ public const int GroupNormFieldNumber = 7;
+ ///
+ /// GroupNorm hyperparameters. This is only supported on a subset of models.
+ /// Note that the current implementation of group norm instantiated in
+ /// tf.contrib.group.layers.group_norm() only supports fixed_size_resizer
+ /// for image preprocessing.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm GroupNorm {
+ get { return normalizerOneofCase_ == NormalizerOneofOneofCase.GroupNorm ? (global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm) normalizerOneof_ : null; }
+ set {
+ normalizerOneof_ = value;
+ normalizerOneofCase_ = value == null ? NormalizerOneofOneofCase.None : NormalizerOneofOneofCase.GroupNorm;
+ }
+ }
+
+ /// Field number for the "regularize_depthwise" field.
+ public const int RegularizeDepthwiseFieldNumber = 6;
+ private bool regularizeDepthwise_;
+ ///
+ /// Whether depthwise convolutions should be regularized. If this parameter is
+ /// NOT set then the conv hyperparams will default to the parent scope.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool RegularizeDepthwise {
+ get { return regularizeDepthwise_; }
+ set {
+ regularizeDepthwise_ = value;
+ }
+ }
+
+ private object normalizerOneof_;
+ /// Enum of possible cases for the "normalizer_oneof" oneof.
+ public enum NormalizerOneofOneofCase {
+ None = 0,
+ BatchNorm = 5,
+ GroupNorm = 7,
+ }
+ private NormalizerOneofOneofCase normalizerOneofCase_ = NormalizerOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public NormalizerOneofOneofCase NormalizerOneofCase {
+ get { return normalizerOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearNormalizerOneof() {
+ normalizerOneofCase_ = NormalizerOneofOneofCase.None;
+ normalizerOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Hyperparams);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Hyperparams other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Op != other.Op) return false;
+ if (!object.Equals(Regularizer, other.Regularizer)) return false;
+ if (!object.Equals(Initializer, other.Initializer)) return false;
+ if (Activation != other.Activation) return false;
+ if (!object.Equals(BatchNorm, other.BatchNorm)) return false;
+ if (!object.Equals(GroupNorm, other.GroupNorm)) return false;
+ if (RegularizeDepthwise != other.RegularizeDepthwise) return false;
+ if (NormalizerOneofCase != other.NormalizerOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Op != 0) hash ^= Op.GetHashCode();
+ if (regularizer_ != null) hash ^= Regularizer.GetHashCode();
+ if (initializer_ != null) hash ^= Initializer.GetHashCode();
+ if (Activation != 0) hash ^= Activation.GetHashCode();
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.BatchNorm) hash ^= BatchNorm.GetHashCode();
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.GroupNorm) hash ^= GroupNorm.GetHashCode();
+ if (RegularizeDepthwise != false) hash ^= RegularizeDepthwise.GetHashCode();
+ hash ^= (int) normalizerOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Op != 0) {
+ output.WriteRawTag(8);
+ output.WriteEnum((int) Op);
+ }
+ if (regularizer_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(Regularizer);
+ }
+ if (initializer_ != null) {
+ output.WriteRawTag(26);
+ output.WriteMessage(Initializer);
+ }
+ if (Activation != 0) {
+ output.WriteRawTag(32);
+ output.WriteEnum((int) Activation);
+ }
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.BatchNorm) {
+ output.WriteRawTag(42);
+ output.WriteMessage(BatchNorm);
+ }
+ if (RegularizeDepthwise != false) {
+ output.WriteRawTag(48);
+ output.WriteBool(RegularizeDepthwise);
+ }
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.GroupNorm) {
+ output.WriteRawTag(58);
+ output.WriteMessage(GroupNorm);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Op != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Op);
+ }
+ if (regularizer_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Regularizer);
+ }
+ if (initializer_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(Initializer);
+ }
+ if (Activation != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Activation);
+ }
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.BatchNorm) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(BatchNorm);
+ }
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.GroupNorm) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(GroupNorm);
+ }
+ if (RegularizeDepthwise != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Hyperparams other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Op != 0) {
+ Op = other.Op;
+ }
+ if (other.regularizer_ != null) {
+ if (regularizer_ == null) {
+ regularizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.Regularizer();
+ }
+ Regularizer.MergeFrom(other.Regularizer);
+ }
+ if (other.initializer_ != null) {
+ if (initializer_ == null) {
+ initializer_ = new global::Tensorflow.Models.ObjectDetection.Protos.Initializer();
+ }
+ Initializer.MergeFrom(other.Initializer);
+ }
+ if (other.Activation != 0) {
+ Activation = other.Activation;
+ }
+ if (other.RegularizeDepthwise != false) {
+ RegularizeDepthwise = other.RegularizeDepthwise;
+ }
+ switch (other.NormalizerOneofCase) {
+ case NormalizerOneofOneofCase.BatchNorm:
+ if (BatchNorm == null) {
+ BatchNorm = new global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm();
+ }
+ BatchNorm.MergeFrom(other.BatchNorm);
+ break;
+ case NormalizerOneofOneofCase.GroupNorm:
+ if (GroupNorm == null) {
+ GroupNorm = new global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm();
+ }
+ GroupNorm.MergeFrom(other.GroupNorm);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ op_ = (global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Op) input.ReadEnum();
+ break;
+ }
+ case 18: {
+ if (regularizer_ == null) {
+ regularizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.Regularizer();
+ }
+ input.ReadMessage(regularizer_);
+ break;
+ }
+ case 26: {
+ if (initializer_ == null) {
+ initializer_ = new global::Tensorflow.Models.ObjectDetection.Protos.Initializer();
+ }
+ input.ReadMessage(initializer_);
+ break;
+ }
+ case 32: {
+ activation_ = (global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams.Types.Activation) input.ReadEnum();
+ break;
+ }
+ case 42: {
+ global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.BatchNorm();
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.BatchNorm) {
+ subBuilder.MergeFrom(BatchNorm);
+ }
+ input.ReadMessage(subBuilder);
+ BatchNorm = subBuilder;
+ break;
+ }
+ case 48: {
+ RegularizeDepthwise = input.ReadBool();
+ break;
+ }
+ case 58: {
+ global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.GroupNorm();
+ if (normalizerOneofCase_ == NormalizerOneofOneofCase.GroupNorm) {
+ subBuilder.MergeFrom(GroupNorm);
+ }
+ input.ReadMessage(subBuilder);
+ GroupNorm = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the Hyperparams message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ ///
+ /// Operations affected by hyperparameters.
+ ///
+ public enum Op {
+ ///
+ /// Use None
+ ///
+ [pbr::OriginalName("NULL")] Null = 0,
+ ///
+ /// Convolution, Separable Convolution, Convolution transpose.
+ ///
+ [pbr::OriginalName("CONV")] Conv = 1,
+ ///
+ /// Fully connected
+ ///
+ [pbr::OriginalName("FC")] Fc = 2,
+ }
+
+ ///
+ /// Type of activation to apply after convolution.
+ ///
+ public enum Activation {
+ ///
+ /// Use None (no activation)
+ ///
+ [pbr::OriginalName("NONE")] None = 0,
+ ///
+ /// Use tf.nn.relu
+ ///
+ [pbr::OriginalName("RELU")] Relu = 1,
+ ///
+ /// Use tf.nn.relu6
+ ///
+ [pbr::OriginalName("RELU_6")] Relu6 = 2,
+ }
+
+ }
+ #endregion
+
+ }
+
+ ///
+ /// Proto with one-of field for regularizers.
+ ///
+ public sealed partial class Regularizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Regularizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Regularizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Regularizer(Regularizer other) : this() {
+ switch (other.RegularizerOneofCase) {
+ case RegularizerOneofOneofCase.L1Regularizer:
+ L1Regularizer = other.L1Regularizer.Clone();
+ break;
+ case RegularizerOneofOneofCase.L2Regularizer:
+ L2Regularizer = other.L2Regularizer.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Regularizer Clone() {
+ return new Regularizer(this);
+ }
+
+ /// Field number for the "l1_regularizer" field.
+ public const int L1RegularizerFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer L1Regularizer {
+ get { return regularizerOneofCase_ == RegularizerOneofOneofCase.L1Regularizer ? (global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer) regularizerOneof_ : null; }
+ set {
+ regularizerOneof_ = value;
+ regularizerOneofCase_ = value == null ? RegularizerOneofOneofCase.None : RegularizerOneofOneofCase.L1Regularizer;
+ }
+ }
+
+ /// Field number for the "l2_regularizer" field.
+ public const int L2RegularizerFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer L2Regularizer {
+ get { return regularizerOneofCase_ == RegularizerOneofOneofCase.L2Regularizer ? (global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer) regularizerOneof_ : null; }
+ set {
+ regularizerOneof_ = value;
+ regularizerOneofCase_ = value == null ? RegularizerOneofOneofCase.None : RegularizerOneofOneofCase.L2Regularizer;
+ }
+ }
+
+ private object regularizerOneof_;
+ /// Enum of possible cases for the "regularizer_oneof" oneof.
+ public enum RegularizerOneofOneofCase {
+ None = 0,
+ L1Regularizer = 1,
+ L2Regularizer = 2,
+ }
+ private RegularizerOneofOneofCase regularizerOneofCase_ = RegularizerOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RegularizerOneofOneofCase RegularizerOneofCase {
+ get { return regularizerOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearRegularizerOneof() {
+ regularizerOneofCase_ = RegularizerOneofOneofCase.None;
+ regularizerOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Regularizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Regularizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(L1Regularizer, other.L1Regularizer)) return false;
+ if (!object.Equals(L2Regularizer, other.L2Regularizer)) return false;
+ if (RegularizerOneofCase != other.RegularizerOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L1Regularizer) hash ^= L1Regularizer.GetHashCode();
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L2Regularizer) hash ^= L2Regularizer.GetHashCode();
+ hash ^= (int) regularizerOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L1Regularizer) {
+ output.WriteRawTag(10);
+ output.WriteMessage(L1Regularizer);
+ }
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L2Regularizer) {
+ output.WriteRawTag(18);
+ output.WriteMessage(L2Regularizer);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L1Regularizer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(L1Regularizer);
+ }
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L2Regularizer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(L2Regularizer);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Regularizer other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.RegularizerOneofCase) {
+ case RegularizerOneofOneofCase.L1Regularizer:
+ if (L1Regularizer == null) {
+ L1Regularizer = new global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer();
+ }
+ L1Regularizer.MergeFrom(other.L1Regularizer);
+ break;
+ case RegularizerOneofOneofCase.L2Regularizer:
+ if (L2Regularizer == null) {
+ L2Regularizer = new global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer();
+ }
+ L2Regularizer.MergeFrom(other.L2Regularizer);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.L1Regularizer();
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L1Regularizer) {
+ subBuilder.MergeFrom(L1Regularizer);
+ }
+ input.ReadMessage(subBuilder);
+ L1Regularizer = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.L2Regularizer();
+ if (regularizerOneofCase_ == RegularizerOneofOneofCase.L2Regularizer) {
+ subBuilder.MergeFrom(L2Regularizer);
+ }
+ input.ReadMessage(subBuilder);
+ L2Regularizer = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for L1 Regularizer.
+ /// See https://www.tensorflow.org/api_docs/python/tf/contrib/layers/l1_regularizer
+ ///
+ public sealed partial class L1Regularizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new L1Regularizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public L1Regularizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public L1Regularizer(L1Regularizer other) : this() {
+ weight_ = other.weight_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public L1Regularizer Clone() {
+ return new L1Regularizer(this);
+ }
+
+ /// Field number for the "weight" field.
+ public const int WeightFieldNumber = 1;
+ private float weight_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Weight {
+ get { return weight_; }
+ set {
+ weight_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as L1Regularizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(L1Regularizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Weight, other.Weight)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Weight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Weight);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Weight != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Weight);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Weight != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(L1Regularizer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Weight != 0F) {
+ Weight = other.Weight;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Weight = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for L2 Regularizer.
+ /// See https://www.tensorflow.org/api_docs/python/tf/contrib/layers/l2_regularizer
+ ///
+ public sealed partial class L2Regularizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new L2Regularizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public L2Regularizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public L2Regularizer(L2Regularizer other) : this() {
+ weight_ = other.weight_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public L2Regularizer Clone() {
+ return new L2Regularizer(this);
+ }
+
+ /// Field number for the "weight" field.
+ public const int WeightFieldNumber = 1;
+ private float weight_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Weight {
+ get { return weight_; }
+ set {
+ weight_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as L2Regularizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(L2Regularizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Weight, other.Weight)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Weight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Weight);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Weight != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Weight);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Weight != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(L2Regularizer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Weight != 0F) {
+ Weight = other.Weight;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Weight = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Proto with one-of field for initializers.
+ ///
+ public sealed partial class Initializer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Initializer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Initializer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Initializer(Initializer other) : this() {
+ switch (other.InitializerOneofCase) {
+ case InitializerOneofOneofCase.TruncatedNormalInitializer:
+ TruncatedNormalInitializer = other.TruncatedNormalInitializer.Clone();
+ break;
+ case InitializerOneofOneofCase.VarianceScalingInitializer:
+ VarianceScalingInitializer = other.VarianceScalingInitializer.Clone();
+ break;
+ case InitializerOneofOneofCase.RandomNormalInitializer:
+ RandomNormalInitializer = other.RandomNormalInitializer.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Initializer Clone() {
+ return new Initializer(this);
+ }
+
+ /// Field number for the "truncated_normal_initializer" field.
+ public const int TruncatedNormalInitializerFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer TruncatedNormalInitializer {
+ get { return initializerOneofCase_ == InitializerOneofOneofCase.TruncatedNormalInitializer ? (global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer) initializerOneof_ : null; }
+ set {
+ initializerOneof_ = value;
+ initializerOneofCase_ = value == null ? InitializerOneofOneofCase.None : InitializerOneofOneofCase.TruncatedNormalInitializer;
+ }
+ }
+
+ /// Field number for the "variance_scaling_initializer" field.
+ public const int VarianceScalingInitializerFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer VarianceScalingInitializer {
+ get { return initializerOneofCase_ == InitializerOneofOneofCase.VarianceScalingInitializer ? (global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer) initializerOneof_ : null; }
+ set {
+ initializerOneof_ = value;
+ initializerOneofCase_ = value == null ? InitializerOneofOneofCase.None : InitializerOneofOneofCase.VarianceScalingInitializer;
+ }
+ }
+
+ /// Field number for the "random_normal_initializer" field.
+ public const int RandomNormalInitializerFieldNumber = 3;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer RandomNormalInitializer {
+ get { return initializerOneofCase_ == InitializerOneofOneofCase.RandomNormalInitializer ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer) initializerOneof_ : null; }
+ set {
+ initializerOneof_ = value;
+ initializerOneofCase_ = value == null ? InitializerOneofOneofCase.None : InitializerOneofOneofCase.RandomNormalInitializer;
+ }
+ }
+
+ private object initializerOneof_;
+ /// Enum of possible cases for the "initializer_oneof" oneof.
+ public enum InitializerOneofOneofCase {
+ None = 0,
+ TruncatedNormalInitializer = 1,
+ VarianceScalingInitializer = 2,
+ RandomNormalInitializer = 3,
+ }
+ private InitializerOneofOneofCase initializerOneofCase_ = InitializerOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public InitializerOneofOneofCase InitializerOneofCase {
+ get { return initializerOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearInitializerOneof() {
+ initializerOneofCase_ = InitializerOneofOneofCase.None;
+ initializerOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Initializer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Initializer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(TruncatedNormalInitializer, other.TruncatedNormalInitializer)) return false;
+ if (!object.Equals(VarianceScalingInitializer, other.VarianceScalingInitializer)) return false;
+ if (!object.Equals(RandomNormalInitializer, other.RandomNormalInitializer)) return false;
+ if (InitializerOneofCase != other.InitializerOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (initializerOneofCase_ == InitializerOneofOneofCase.TruncatedNormalInitializer) hash ^= TruncatedNormalInitializer.GetHashCode();
+ if (initializerOneofCase_ == InitializerOneofOneofCase.VarianceScalingInitializer) hash ^= VarianceScalingInitializer.GetHashCode();
+ if (initializerOneofCase_ == InitializerOneofOneofCase.RandomNormalInitializer) hash ^= RandomNormalInitializer.GetHashCode();
+ hash ^= (int) initializerOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (initializerOneofCase_ == InitializerOneofOneofCase.TruncatedNormalInitializer) {
+ output.WriteRawTag(10);
+ output.WriteMessage(TruncatedNormalInitializer);
+ }
+ if (initializerOneofCase_ == InitializerOneofOneofCase.VarianceScalingInitializer) {
+ output.WriteRawTag(18);
+ output.WriteMessage(VarianceScalingInitializer);
+ }
+ if (initializerOneofCase_ == InitializerOneofOneofCase.RandomNormalInitializer) {
+ output.WriteRawTag(26);
+ output.WriteMessage(RandomNormalInitializer);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (initializerOneofCase_ == InitializerOneofOneofCase.TruncatedNormalInitializer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TruncatedNormalInitializer);
+ }
+ if (initializerOneofCase_ == InitializerOneofOneofCase.VarianceScalingInitializer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(VarianceScalingInitializer);
+ }
+ if (initializerOneofCase_ == InitializerOneofOneofCase.RandomNormalInitializer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomNormalInitializer);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Initializer other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.InitializerOneofCase) {
+ case InitializerOneofOneofCase.TruncatedNormalInitializer:
+ if (TruncatedNormalInitializer == null) {
+ TruncatedNormalInitializer = new global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer();
+ }
+ TruncatedNormalInitializer.MergeFrom(other.TruncatedNormalInitializer);
+ break;
+ case InitializerOneofOneofCase.VarianceScalingInitializer:
+ if (VarianceScalingInitializer == null) {
+ VarianceScalingInitializer = new global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer();
+ }
+ VarianceScalingInitializer.MergeFrom(other.VarianceScalingInitializer);
+ break;
+ case InitializerOneofOneofCase.RandomNormalInitializer:
+ if (RandomNormalInitializer == null) {
+ RandomNormalInitializer = new global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer();
+ }
+ RandomNormalInitializer.MergeFrom(other.RandomNormalInitializer);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.TruncatedNormalInitializer();
+ if (initializerOneofCase_ == InitializerOneofOneofCase.TruncatedNormalInitializer) {
+ subBuilder.MergeFrom(TruncatedNormalInitializer);
+ }
+ input.ReadMessage(subBuilder);
+ TruncatedNormalInitializer = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer();
+ if (initializerOneofCase_ == InitializerOneofOneofCase.VarianceScalingInitializer) {
+ subBuilder.MergeFrom(VarianceScalingInitializer);
+ }
+ input.ReadMessage(subBuilder);
+ VarianceScalingInitializer = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomNormalInitializer();
+ if (initializerOneofCase_ == InitializerOneofOneofCase.RandomNormalInitializer) {
+ subBuilder.MergeFrom(RandomNormalInitializer);
+ }
+ input.ReadMessage(subBuilder);
+ RandomNormalInitializer = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for truncated normal initializer. See
+ /// https://www.tensorflow.org/api_docs/python/tf/truncated_normal_initializer
+ ///
+ public sealed partial class TruncatedNormalInitializer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TruncatedNormalInitializer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[5]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TruncatedNormalInitializer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TruncatedNormalInitializer(TruncatedNormalInitializer other) : this() {
+ mean_ = other.mean_;
+ stddev_ = other.stddev_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TruncatedNormalInitializer Clone() {
+ return new TruncatedNormalInitializer(this);
+ }
+
+ /// Field number for the "mean" field.
+ public const int MeanFieldNumber = 1;
+ private float mean_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Mean {
+ get { return mean_; }
+ set {
+ mean_ = value;
+ }
+ }
+
+ /// Field number for the "stddev" field.
+ public const int StddevFieldNumber = 2;
+ private float stddev_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Stddev {
+ get { return stddev_; }
+ set {
+ stddev_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as TruncatedNormalInitializer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(TruncatedNormalInitializer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Mean, other.Mean)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Stddev, other.Stddev)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Mean != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Mean);
+ if (Stddev != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Stddev);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Mean != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Mean);
+ }
+ if (Stddev != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(Stddev);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Mean != 0F) {
+ size += 1 + 4;
+ }
+ if (Stddev != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(TruncatedNormalInitializer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Mean != 0F) {
+ Mean = other.Mean;
+ }
+ if (other.Stddev != 0F) {
+ Stddev = other.Stddev;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Mean = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ Stddev = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for variance scaling initializer. See
+ /// https://www.tensorflow.org/api_docs/python/tf/contrib/layers/
+ /// variance_scaling_initializer
+ ///
+ public sealed partial class VarianceScalingInitializer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new VarianceScalingInitializer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[6]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public VarianceScalingInitializer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public VarianceScalingInitializer(VarianceScalingInitializer other) : this() {
+ factor_ = other.factor_;
+ uniform_ = other.uniform_;
+ mode_ = other.mode_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public VarianceScalingInitializer Clone() {
+ return new VarianceScalingInitializer(this);
+ }
+
+ /// Field number for the "factor" field.
+ public const int FactorFieldNumber = 1;
+ private float factor_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Factor {
+ get { return factor_; }
+ set {
+ factor_ = value;
+ }
+ }
+
+ /// Field number for the "uniform" field.
+ public const int UniformFieldNumber = 2;
+ private bool uniform_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Uniform {
+ get { return uniform_; }
+ set {
+ uniform_ = value;
+ }
+ }
+
+ /// Field number for the "mode" field.
+ public const int ModeFieldNumber = 3;
+ private global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer.Types.Mode mode_ = 0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer.Types.Mode Mode {
+ get { return mode_; }
+ set {
+ mode_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as VarianceScalingInitializer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(VarianceScalingInitializer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Factor, other.Factor)) return false;
+ if (Uniform != other.Uniform) return false;
+ if (Mode != other.Mode) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Factor != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Factor);
+ if (Uniform != false) hash ^= Uniform.GetHashCode();
+ if (Mode != 0) hash ^= Mode.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Factor != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Factor);
+ }
+ if (Uniform != false) {
+ output.WriteRawTag(16);
+ output.WriteBool(Uniform);
+ }
+ if (Mode != 0) {
+ output.WriteRawTag(24);
+ output.WriteEnum((int) Mode);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Factor != 0F) {
+ size += 1 + 4;
+ }
+ if (Uniform != false) {
+ size += 1 + 1;
+ }
+ if (Mode != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Mode);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(VarianceScalingInitializer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Factor != 0F) {
+ Factor = other.Factor;
+ }
+ if (other.Uniform != false) {
+ Uniform = other.Uniform;
+ }
+ if (other.Mode != 0) {
+ Mode = other.Mode;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Factor = input.ReadFloat();
+ break;
+ }
+ case 16: {
+ Uniform = input.ReadBool();
+ break;
+ }
+ case 24: {
+ mode_ = (global::Tensorflow.Models.ObjectDetection.Protos.VarianceScalingInitializer.Types.Mode) input.ReadEnum();
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the VarianceScalingInitializer message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ public enum Mode {
+ [pbr::OriginalName("FAN_IN")] FanIn = 0,
+ [pbr::OriginalName("FAN_OUT")] FanOut = 1,
+ [pbr::OriginalName("FAN_AVG")] FanAvg = 2,
+ }
+
+ }
+ #endregion
+
+ }
+
+ ///
+ /// Configuration proto for random normal initializer. See
+ /// https://www.tensorflow.org/api_docs/python/tf/random_normal_initializer
+ ///
+ public sealed partial class RandomNormalInitializer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomNormalInitializer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[7]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RandomNormalInitializer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RandomNormalInitializer(RandomNormalInitializer other) : this() {
+ mean_ = other.mean_;
+ stddev_ = other.stddev_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public RandomNormalInitializer Clone() {
+ return new RandomNormalInitializer(this);
+ }
+
+ /// Field number for the "mean" field.
+ public const int MeanFieldNumber = 1;
+ private float mean_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Mean {
+ get { return mean_; }
+ set {
+ mean_ = value;
+ }
+ }
+
+ /// Field number for the "stddev" field.
+ public const int StddevFieldNumber = 2;
+ private float stddev_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Stddev {
+ get { return stddev_; }
+ set {
+ stddev_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as RandomNormalInitializer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(RandomNormalInitializer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Mean, other.Mean)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Stddev, other.Stddev)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Mean != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Mean);
+ if (Stddev != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Stddev);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Mean != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Mean);
+ }
+ if (Stddev != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(Stddev);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Mean != 0F) {
+ size += 1 + 4;
+ }
+ if (Stddev != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(RandomNormalInitializer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Mean != 0F) {
+ Mean = other.Mean;
+ }
+ if (other.Stddev != 0F) {
+ Stddev = other.Stddev;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Mean = input.ReadFloat();
+ break;
+ }
+ case 21: {
+ Stddev = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for batch norm to apply after convolution op. See
+ /// https://www.tensorflow.org/api_docs/python/tf/contrib/layers/batch_norm
+ ///
+ public sealed partial class BatchNorm : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BatchNorm());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[8]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BatchNorm() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BatchNorm(BatchNorm other) : this() {
+ decay_ = other.decay_;
+ center_ = other.center_;
+ scale_ = other.scale_;
+ epsilon_ = other.epsilon_;
+ train_ = other.train_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public BatchNorm Clone() {
+ return new BatchNorm(this);
+ }
+
+ /// Field number for the "decay" field.
+ public const int DecayFieldNumber = 1;
+ private float decay_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Decay {
+ get { return decay_; }
+ set {
+ decay_ = value;
+ }
+ }
+
+ /// Field number for the "center" field.
+ public const int CenterFieldNumber = 2;
+ private bool center_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Center {
+ get { return center_; }
+ set {
+ center_ = value;
+ }
+ }
+
+ /// Field number for the "scale" field.
+ public const int ScaleFieldNumber = 3;
+ private bool scale_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Scale {
+ get { return scale_; }
+ set {
+ scale_ = value;
+ }
+ }
+
+ /// Field number for the "epsilon" field.
+ public const int EpsilonFieldNumber = 4;
+ private float epsilon_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Epsilon {
+ get { return epsilon_; }
+ set {
+ epsilon_ = value;
+ }
+ }
+
+ /// Field number for the "train" field.
+ public const int TrainFieldNumber = 5;
+ private bool train_;
+ ///
+ /// Whether to train the batch norm variables. If this is set to false during
+ /// training, the current value of the batch_norm variables are used for
+ /// forward pass but they are never updated.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Train {
+ get { return train_; }
+ set {
+ train_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as BatchNorm);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(BatchNorm other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Decay, other.Decay)) return false;
+ if (Center != other.Center) return false;
+ if (Scale != other.Scale) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Epsilon, other.Epsilon)) return false;
+ if (Train != other.Train) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Decay != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Decay);
+ if (Center != false) hash ^= Center.GetHashCode();
+ if (Scale != false) hash ^= Scale.GetHashCode();
+ if (Epsilon != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Epsilon);
+ if (Train != false) hash ^= Train.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Decay != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Decay);
+ }
+ if (Center != false) {
+ output.WriteRawTag(16);
+ output.WriteBool(Center);
+ }
+ if (Scale != false) {
+ output.WriteRawTag(24);
+ output.WriteBool(Scale);
+ }
+ if (Epsilon != 0F) {
+ output.WriteRawTag(37);
+ output.WriteFloat(Epsilon);
+ }
+ if (Train != false) {
+ output.WriteRawTag(40);
+ output.WriteBool(Train);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Decay != 0F) {
+ size += 1 + 4;
+ }
+ if (Center != false) {
+ size += 1 + 1;
+ }
+ if (Scale != false) {
+ size += 1 + 1;
+ }
+ if (Epsilon != 0F) {
+ size += 1 + 4;
+ }
+ if (Train != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(BatchNorm other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Decay != 0F) {
+ Decay = other.Decay;
+ }
+ if (other.Center != false) {
+ Center = other.Center;
+ }
+ if (other.Scale != false) {
+ Scale = other.Scale;
+ }
+ if (other.Epsilon != 0F) {
+ Epsilon = other.Epsilon;
+ }
+ if (other.Train != false) {
+ Train = other.Train;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Decay = input.ReadFloat();
+ break;
+ }
+ case 16: {
+ Center = input.ReadBool();
+ break;
+ }
+ case 24: {
+ Scale = input.ReadBool();
+ break;
+ }
+ case 37: {
+ Epsilon = input.ReadFloat();
+ break;
+ }
+ case 40: {
+ Train = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for group normalization to apply after convolution op.
+ /// https://arxiv.org/abs/1803.08494
+ ///
+ public sealed partial class GroupNorm : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GroupNorm());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.HyperparamsReflection.Descriptor.MessageTypes[9]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GroupNorm() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GroupNorm(GroupNorm other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public GroupNorm Clone() {
+ return new GroupNorm(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as GroupNorm);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(GroupNorm other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(GroupNorm other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs
new file mode 100644
index 00000000..8f10a4bb
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs
@@ -0,0 +1,1255 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/image_resizer.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/image_resizer.proto
+ public static partial class ImageResizerReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/image_resizer.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static ImageResizerReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CitvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9pbWFnZV9yZXNpemVyLnByb3Rv",
+ "EhdvYmplY3RfZGV0ZWN0aW9uLnByb3RvcyLjAgoMSW1hZ2VSZXNpemVyElQK",
+ "GWtlZXBfYXNwZWN0X3JhdGlvX3Jlc2l6ZXIYASABKAsyLy5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5LZWVwQXNwZWN0UmF0aW9SZXNpemVySAASSQoTZml4",
+ "ZWRfc2hhcGVfcmVzaXplchgCIAEoCzIqLm9iamVjdF9kZXRlY3Rpb24ucHJv",
+ "dG9zLkZpeGVkU2hhcGVSZXNpemVySAASRAoQaWRlbnRpdHlfcmVzaXplchgD",
+ "IAEoCzIoLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLklkZW50aXR5UmVzaXpl",
+ "ckgAElUKGWNvbmRpdGlvbmFsX3NoYXBlX3Jlc2l6ZXIYBCABKAsyMC5vYmpl",
+ "Y3RfZGV0ZWN0aW9uLnByb3Rvcy5Db25kaXRpb25hbFNoYXBlUmVzaXplckgA",
+ "QhUKE2ltYWdlX3Jlc2l6ZXJfb25lb2YiEQoPSWRlbnRpdHlSZXNpemVyIt0B",
+ "ChZLZWVwQXNwZWN0UmF0aW9SZXNpemVyEhUKDW1pbl9kaW1lbnNpb24YASAB",
+ "KAUSFQoNbWF4X2RpbWVuc2lvbhgCIAEoBRI6Cg1yZXNpemVfbWV0aG9kGAMg",
+ "ASgOMiMub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuUmVzaXplVHlwZRIcChRw",
+ "YWRfdG9fbWF4X2RpbWVuc2lvbhgEIAEoCBIcChRjb252ZXJ0X3RvX2dyYXlz",
+ "Y2FsZRgFIAEoCBIdChVwZXJfY2hhbm5lbF9wYWRfdmFsdWUYBiADKAIijAEK",
+ "EUZpeGVkU2hhcGVSZXNpemVyEg4KBmhlaWdodBgBIAEoBRINCgV3aWR0aBgC",
+ "IAEoBRI6Cg1yZXNpemVfbWV0aG9kGAMgASgOMiMub2JqZWN0X2RldGVjdGlv",
+ "bi5wcm90b3MuUmVzaXplVHlwZRIcChRjb252ZXJ0X3RvX2dyYXlzY2FsZRgE",
+ "IAEoCCKaAgoXQ29uZGl0aW9uYWxTaGFwZVJlc2l6ZXISUwoJY29uZGl0aW9u",
+ "GAEgASgOMkAub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuQ29uZGl0aW9uYWxT",
+ "aGFwZVJlc2l6ZXIuUmVzaXplQ29uZGl0aW9uEhYKDnNpemVfdGhyZXNob2xk",
+ "GAIgASgFEjoKDXJlc2l6ZV9tZXRob2QYAyABKA4yIy5vYmplY3RfZGV0ZWN0",
+ "aW9uLnByb3Rvcy5SZXNpemVUeXBlEhwKFGNvbnZlcnRfdG9fZ3JheXNjYWxl",
+ "GAQgASgIIjgKD1Jlc2l6ZUNvbmRpdGlvbhILCgdJTlZBTElEEAASCwoHR1JF",
+ "QVRFUhABEgsKB1NNQUxMRVIQAipHCgpSZXNpemVUeXBlEgwKCEJJTElORUFS",
+ "EAASFAoQTkVBUkVTVF9ORUlHSEJPUhABEgsKB0JJQ1VCSUMQAhIICgRBUkVB",
+ "EANiBnByb3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.Models.ObjectDetection.Protos.ResizeType), }, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer), global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer.Parser, new[]{ "KeepAspectRatioResizer", "FixedShapeResizer", "IdentityResizer", "ConditionalShapeResizer" }, new[]{ "ImageResizerOneof" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer), global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer.Parser, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer), global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer.Parser, new[]{ "MinDimension", "MaxDimension", "ResizeMethod", "PadToMaxDimension", "ConvertToGrayscale", "PerChannelPadValue" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer), global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer.Parser, new[]{ "Height", "Width", "ResizeMethod", "ConvertToGrayscale" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer), global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer.Parser, new[]{ "Condition", "SizeThreshold", "ResizeMethod", "ConvertToGrayscale" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer.Types.ResizeCondition) }, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Enums
+ ///
+ /// Enumeration type for image resizing methods provided in TensorFlow.
+ ///
+ public enum ResizeType {
+ ///
+ /// Corresponds to tf.image.ResizeMethod.BILINEAR
+ ///
+ [pbr::OriginalName("BILINEAR")] Bilinear = 0,
+ ///
+ /// Corresponds to tf.image.ResizeMethod.NEAREST_NEIGHBOR
+ ///
+ [pbr::OriginalName("NEAREST_NEIGHBOR")] NearestNeighbor = 1,
+ ///
+ /// Corresponds to tf.image.ResizeMethod.BICUBIC
+ ///
+ [pbr::OriginalName("BICUBIC")] Bicubic = 2,
+ ///
+ /// Corresponds to tf.image.ResizeMethod.AREA
+ ///
+ [pbr::OriginalName("AREA")] Area = 3,
+ }
+
+ #endregion
+
+ #region Messages
+ ///
+ /// Configuration proto for image resizing operations.
+ /// See builders/image_resizer_builder.py for details.
+ ///
+ public sealed partial class ImageResizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ImageResizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ImageResizerReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ImageResizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ImageResizer(ImageResizer other) : this() {
+ switch (other.ImageResizerOneofCase) {
+ case ImageResizerOneofOneofCase.KeepAspectRatioResizer:
+ KeepAspectRatioResizer = other.KeepAspectRatioResizer.Clone();
+ break;
+ case ImageResizerOneofOneofCase.FixedShapeResizer:
+ FixedShapeResizer = other.FixedShapeResizer.Clone();
+ break;
+ case ImageResizerOneofOneofCase.IdentityResizer:
+ IdentityResizer = other.IdentityResizer.Clone();
+ break;
+ case ImageResizerOneofOneofCase.ConditionalShapeResizer:
+ ConditionalShapeResizer = other.ConditionalShapeResizer.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ImageResizer Clone() {
+ return new ImageResizer(this);
+ }
+
+ /// Field number for the "keep_aspect_ratio_resizer" field.
+ public const int KeepAspectRatioResizerFieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer KeepAspectRatioResizer {
+ get { return imageResizerOneofCase_ == ImageResizerOneofOneofCase.KeepAspectRatioResizer ? (global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer) imageResizerOneof_ : null; }
+ set {
+ imageResizerOneof_ = value;
+ imageResizerOneofCase_ = value == null ? ImageResizerOneofOneofCase.None : ImageResizerOneofOneofCase.KeepAspectRatioResizer;
+ }
+ }
+
+ /// Field number for the "fixed_shape_resizer" field.
+ public const int FixedShapeResizerFieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer FixedShapeResizer {
+ get { return imageResizerOneofCase_ == ImageResizerOneofOneofCase.FixedShapeResizer ? (global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer) imageResizerOneof_ : null; }
+ set {
+ imageResizerOneof_ = value;
+ imageResizerOneofCase_ = value == null ? ImageResizerOneofOneofCase.None : ImageResizerOneofOneofCase.FixedShapeResizer;
+ }
+ }
+
+ /// Field number for the "identity_resizer" field.
+ public const int IdentityResizerFieldNumber = 3;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer IdentityResizer {
+ get { return imageResizerOneofCase_ == ImageResizerOneofOneofCase.IdentityResizer ? (global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer) imageResizerOneof_ : null; }
+ set {
+ imageResizerOneof_ = value;
+ imageResizerOneofCase_ = value == null ? ImageResizerOneofOneofCase.None : ImageResizerOneofOneofCase.IdentityResizer;
+ }
+ }
+
+ /// Field number for the "conditional_shape_resizer" field.
+ public const int ConditionalShapeResizerFieldNumber = 4;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer ConditionalShapeResizer {
+ get { return imageResizerOneofCase_ == ImageResizerOneofOneofCase.ConditionalShapeResizer ? (global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer) imageResizerOneof_ : null; }
+ set {
+ imageResizerOneof_ = value;
+ imageResizerOneofCase_ = value == null ? ImageResizerOneofOneofCase.None : ImageResizerOneofOneofCase.ConditionalShapeResizer;
+ }
+ }
+
+ private object imageResizerOneof_;
+ /// Enum of possible cases for the "image_resizer_oneof" oneof.
+ public enum ImageResizerOneofOneofCase {
+ None = 0,
+ KeepAspectRatioResizer = 1,
+ FixedShapeResizer = 2,
+ IdentityResizer = 3,
+ ConditionalShapeResizer = 4,
+ }
+ private ImageResizerOneofOneofCase imageResizerOneofCase_ = ImageResizerOneofOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ImageResizerOneofOneofCase ImageResizerOneofCase {
+ get { return imageResizerOneofCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearImageResizerOneof() {
+ imageResizerOneofCase_ = ImageResizerOneofOneofCase.None;
+ imageResizerOneof_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ImageResizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ImageResizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(KeepAspectRatioResizer, other.KeepAspectRatioResizer)) return false;
+ if (!object.Equals(FixedShapeResizer, other.FixedShapeResizer)) return false;
+ if (!object.Equals(IdentityResizer, other.IdentityResizer)) return false;
+ if (!object.Equals(ConditionalShapeResizer, other.ConditionalShapeResizer)) return false;
+ if (ImageResizerOneofCase != other.ImageResizerOneofCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.KeepAspectRatioResizer) hash ^= KeepAspectRatioResizer.GetHashCode();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.FixedShapeResizer) hash ^= FixedShapeResizer.GetHashCode();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.IdentityResizer) hash ^= IdentityResizer.GetHashCode();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.ConditionalShapeResizer) hash ^= ConditionalShapeResizer.GetHashCode();
+ hash ^= (int) imageResizerOneofCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.KeepAspectRatioResizer) {
+ output.WriteRawTag(10);
+ output.WriteMessage(KeepAspectRatioResizer);
+ }
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.FixedShapeResizer) {
+ output.WriteRawTag(18);
+ output.WriteMessage(FixedShapeResizer);
+ }
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.IdentityResizer) {
+ output.WriteRawTag(26);
+ output.WriteMessage(IdentityResizer);
+ }
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.ConditionalShapeResizer) {
+ output.WriteRawTag(34);
+ output.WriteMessage(ConditionalShapeResizer);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.KeepAspectRatioResizer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(KeepAspectRatioResizer);
+ }
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.FixedShapeResizer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(FixedShapeResizer);
+ }
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.IdentityResizer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(IdentityResizer);
+ }
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.ConditionalShapeResizer) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConditionalShapeResizer);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ImageResizer other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.ImageResizerOneofCase) {
+ case ImageResizerOneofOneofCase.KeepAspectRatioResizer:
+ if (KeepAspectRatioResizer == null) {
+ KeepAspectRatioResizer = new global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer();
+ }
+ KeepAspectRatioResizer.MergeFrom(other.KeepAspectRatioResizer);
+ break;
+ case ImageResizerOneofOneofCase.FixedShapeResizer:
+ if (FixedShapeResizer == null) {
+ FixedShapeResizer = new global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer();
+ }
+ FixedShapeResizer.MergeFrom(other.FixedShapeResizer);
+ break;
+ case ImageResizerOneofOneofCase.IdentityResizer:
+ if (IdentityResizer == null) {
+ IdentityResizer = new global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer();
+ }
+ IdentityResizer.MergeFrom(other.IdentityResizer);
+ break;
+ case ImageResizerOneofOneofCase.ConditionalShapeResizer:
+ if (ConditionalShapeResizer == null) {
+ ConditionalShapeResizer = new global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer();
+ }
+ ConditionalShapeResizer.MergeFrom(other.ConditionalShapeResizer);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.KeepAspectRatioResizer();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.KeepAspectRatioResizer) {
+ subBuilder.MergeFrom(KeepAspectRatioResizer);
+ }
+ input.ReadMessage(subBuilder);
+ KeepAspectRatioResizer = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.FixedShapeResizer();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.FixedShapeResizer) {
+ subBuilder.MergeFrom(FixedShapeResizer);
+ }
+ input.ReadMessage(subBuilder);
+ FixedShapeResizer = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.IdentityResizer();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.IdentityResizer) {
+ subBuilder.MergeFrom(IdentityResizer);
+ }
+ input.ReadMessage(subBuilder);
+ IdentityResizer = subBuilder;
+ break;
+ }
+ case 34: {
+ global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer();
+ if (imageResizerOneofCase_ == ImageResizerOneofOneofCase.ConditionalShapeResizer) {
+ subBuilder.MergeFrom(ConditionalShapeResizer);
+ }
+ input.ReadMessage(subBuilder);
+ ConditionalShapeResizer = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ public sealed partial class IdentityResizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IdentityResizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ImageResizerReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public IdentityResizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public IdentityResizer(IdentityResizer other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public IdentityResizer Clone() {
+ return new IdentityResizer(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as IdentityResizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(IdentityResizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(IdentityResizer other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for image resizer that keeps aspect ratio.
+ ///
+ public sealed partial class KeepAspectRatioResizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeepAspectRatioResizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ImageResizerReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public KeepAspectRatioResizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public KeepAspectRatioResizer(KeepAspectRatioResizer other) : this() {
+ minDimension_ = other.minDimension_;
+ maxDimension_ = other.maxDimension_;
+ resizeMethod_ = other.resizeMethod_;
+ padToMaxDimension_ = other.padToMaxDimension_;
+ convertToGrayscale_ = other.convertToGrayscale_;
+ perChannelPadValue_ = other.perChannelPadValue_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public KeepAspectRatioResizer Clone() {
+ return new KeepAspectRatioResizer(this);
+ }
+
+ /// Field number for the "min_dimension" field.
+ public const int MinDimensionFieldNumber = 1;
+ private int minDimension_;
+ ///
+ /// Desired size of the smaller image dimension in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MinDimension {
+ get { return minDimension_; }
+ set {
+ minDimension_ = value;
+ }
+ }
+
+ /// Field number for the "max_dimension" field.
+ public const int MaxDimensionFieldNumber = 2;
+ private int maxDimension_;
+ ///
+ /// Desired size of the larger image dimension in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaxDimension {
+ get { return maxDimension_; }
+ set {
+ maxDimension_ = value;
+ }
+ }
+
+ /// Field number for the "resize_method" field.
+ public const int ResizeMethodFieldNumber = 3;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ResizeType resizeMethod_ = 0;
+ ///
+ /// Desired method when resizing image.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ResizeType ResizeMethod {
+ get { return resizeMethod_; }
+ set {
+ resizeMethod_ = value;
+ }
+ }
+
+ /// Field number for the "pad_to_max_dimension" field.
+ public const int PadToMaxDimensionFieldNumber = 4;
+ private bool padToMaxDimension_;
+ ///
+ /// Whether to pad the image with zeros so the output spatial size is
+ /// [max_dimension, max_dimension]. Note that the zeros are padded to the
+ /// bottom and the right of the resized image.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool PadToMaxDimension {
+ get { return padToMaxDimension_; }
+ set {
+ padToMaxDimension_ = value;
+ }
+ }
+
+ /// Field number for the "convert_to_grayscale" field.
+ public const int ConvertToGrayscaleFieldNumber = 5;
+ private bool convertToGrayscale_;
+ ///
+ /// Whether to also resize the image channels from 3 to 1 (RGB to grayscale).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ConvertToGrayscale {
+ get { return convertToGrayscale_; }
+ set {
+ convertToGrayscale_ = value;
+ }
+ }
+
+ /// Field number for the "per_channel_pad_value" field.
+ public const int PerChannelPadValueFieldNumber = 6;
+ private static readonly pb::FieldCodec _repeated_perChannelPadValue_codec
+ = pb::FieldCodec.ForFloat(50);
+ private readonly pbc::RepeatedField perChannelPadValue_ = new pbc::RepeatedField();
+ ///
+ /// Per-channel pad value. This is only used when pad_to_max_dimension is True.
+ /// If unspecified, a default pad value of 0 is applied to all channels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField PerChannelPadValue {
+ get { return perChannelPadValue_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as KeepAspectRatioResizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(KeepAspectRatioResizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (MinDimension != other.MinDimension) return false;
+ if (MaxDimension != other.MaxDimension) return false;
+ if (ResizeMethod != other.ResizeMethod) return false;
+ if (PadToMaxDimension != other.PadToMaxDimension) return false;
+ if (ConvertToGrayscale != other.ConvertToGrayscale) return false;
+ if(!perChannelPadValue_.Equals(other.perChannelPadValue_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (MinDimension != 0) hash ^= MinDimension.GetHashCode();
+ if (MaxDimension != 0) hash ^= MaxDimension.GetHashCode();
+ if (ResizeMethod != 0) hash ^= ResizeMethod.GetHashCode();
+ if (PadToMaxDimension != false) hash ^= PadToMaxDimension.GetHashCode();
+ if (ConvertToGrayscale != false) hash ^= ConvertToGrayscale.GetHashCode();
+ hash ^= perChannelPadValue_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (MinDimension != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(MinDimension);
+ }
+ if (MaxDimension != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(MaxDimension);
+ }
+ if (ResizeMethod != 0) {
+ output.WriteRawTag(24);
+ output.WriteEnum((int) ResizeMethod);
+ }
+ if (PadToMaxDimension != false) {
+ output.WriteRawTag(32);
+ output.WriteBool(PadToMaxDimension);
+ }
+ if (ConvertToGrayscale != false) {
+ output.WriteRawTag(40);
+ output.WriteBool(ConvertToGrayscale);
+ }
+ perChannelPadValue_.WriteTo(output, _repeated_perChannelPadValue_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (MinDimension != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinDimension);
+ }
+ if (MaxDimension != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxDimension);
+ }
+ if (ResizeMethod != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResizeMethod);
+ }
+ if (PadToMaxDimension != false) {
+ size += 1 + 1;
+ }
+ if (ConvertToGrayscale != false) {
+ size += 1 + 1;
+ }
+ size += perChannelPadValue_.CalculateSize(_repeated_perChannelPadValue_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(KeepAspectRatioResizer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.MinDimension != 0) {
+ MinDimension = other.MinDimension;
+ }
+ if (other.MaxDimension != 0) {
+ MaxDimension = other.MaxDimension;
+ }
+ if (other.ResizeMethod != 0) {
+ ResizeMethod = other.ResizeMethod;
+ }
+ if (other.PadToMaxDimension != false) {
+ PadToMaxDimension = other.PadToMaxDimension;
+ }
+ if (other.ConvertToGrayscale != false) {
+ ConvertToGrayscale = other.ConvertToGrayscale;
+ }
+ perChannelPadValue_.Add(other.perChannelPadValue_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ MinDimension = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ MaxDimension = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ resizeMethod_ = (global::Tensorflow.Models.ObjectDetection.Protos.ResizeType) input.ReadEnum();
+ break;
+ }
+ case 32: {
+ PadToMaxDimension = input.ReadBool();
+ break;
+ }
+ case 40: {
+ ConvertToGrayscale = input.ReadBool();
+ break;
+ }
+ case 50:
+ case 53: {
+ perChannelPadValue_.AddEntriesFrom(input, _repeated_perChannelPadValue_codec);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for image resizer that resizes to a fixed shape.
+ ///
+ public sealed partial class FixedShapeResizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FixedShapeResizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ImageResizerReflection.Descriptor.MessageTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FixedShapeResizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FixedShapeResizer(FixedShapeResizer other) : this() {
+ height_ = other.height_;
+ width_ = other.width_;
+ resizeMethod_ = other.resizeMethod_;
+ convertToGrayscale_ = other.convertToGrayscale_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public FixedShapeResizer Clone() {
+ return new FixedShapeResizer(this);
+ }
+
+ /// Field number for the "height" field.
+ public const int HeightFieldNumber = 1;
+ private int height_;
+ ///
+ /// Desired height of image in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Height {
+ get { return height_; }
+ set {
+ height_ = value;
+ }
+ }
+
+ /// Field number for the "width" field.
+ public const int WidthFieldNumber = 2;
+ private int width_;
+ ///
+ /// Desired width of image in pixels.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Width {
+ get { return width_; }
+ set {
+ width_ = value;
+ }
+ }
+
+ /// Field number for the "resize_method" field.
+ public const int ResizeMethodFieldNumber = 3;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ResizeType resizeMethod_ = 0;
+ ///
+ /// Desired method when resizing image.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ResizeType ResizeMethod {
+ get { return resizeMethod_; }
+ set {
+ resizeMethod_ = value;
+ }
+ }
+
+ /// Field number for the "convert_to_grayscale" field.
+ public const int ConvertToGrayscaleFieldNumber = 4;
+ private bool convertToGrayscale_;
+ ///
+ /// Whether to also resize the image channels from 3 to 1 (RGB to grayscale).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ConvertToGrayscale {
+ get { return convertToGrayscale_; }
+ set {
+ convertToGrayscale_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as FixedShapeResizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(FixedShapeResizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Height != other.Height) return false;
+ if (Width != other.Width) return false;
+ if (ResizeMethod != other.ResizeMethod) return false;
+ if (ConvertToGrayscale != other.ConvertToGrayscale) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Height != 0) hash ^= Height.GetHashCode();
+ if (Width != 0) hash ^= Width.GetHashCode();
+ if (ResizeMethod != 0) hash ^= ResizeMethod.GetHashCode();
+ if (ConvertToGrayscale != false) hash ^= ConvertToGrayscale.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Height != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(Height);
+ }
+ if (Width != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(Width);
+ }
+ if (ResizeMethod != 0) {
+ output.WriteRawTag(24);
+ output.WriteEnum((int) ResizeMethod);
+ }
+ if (ConvertToGrayscale != false) {
+ output.WriteRawTag(32);
+ output.WriteBool(ConvertToGrayscale);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Height != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Height);
+ }
+ if (Width != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width);
+ }
+ if (ResizeMethod != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResizeMethod);
+ }
+ if (ConvertToGrayscale != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(FixedShapeResizer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Height != 0) {
+ Height = other.Height;
+ }
+ if (other.Width != 0) {
+ Width = other.Width;
+ }
+ if (other.ResizeMethod != 0) {
+ ResizeMethod = other.ResizeMethod;
+ }
+ if (other.ConvertToGrayscale != false) {
+ ConvertToGrayscale = other.ConvertToGrayscale;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Height = input.ReadInt32();
+ break;
+ }
+ case 16: {
+ Width = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ resizeMethod_ = (global::Tensorflow.Models.ObjectDetection.Protos.ResizeType) input.ReadEnum();
+ break;
+ }
+ case 32: {
+ ConvertToGrayscale = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// Configuration proto for image resizer that resizes only if input image height
+ /// or width is greater or smaller than a certain size.
+ /// Aspect ratio is maintained.
+ ///
+ public sealed partial class ConditionalShapeResizer : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConditionalShapeResizer());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.ImageResizerReflection.Descriptor.MessageTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ConditionalShapeResizer() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ConditionalShapeResizer(ConditionalShapeResizer other) : this() {
+ condition_ = other.condition_;
+ sizeThreshold_ = other.sizeThreshold_;
+ resizeMethod_ = other.resizeMethod_;
+ convertToGrayscale_ = other.convertToGrayscale_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ConditionalShapeResizer Clone() {
+ return new ConditionalShapeResizer(this);
+ }
+
+ /// Field number for the "condition" field.
+ public const int ConditionFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer.Types.ResizeCondition condition_ = 0;
+ ///
+ /// Condition which must be true to resize the image.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer.Types.ResizeCondition Condition {
+ get { return condition_; }
+ set {
+ condition_ = value;
+ }
+ }
+
+ /// Field number for the "size_threshold" field.
+ public const int SizeThresholdFieldNumber = 2;
+ private int sizeThreshold_;
+ ///
+ /// Threshold for the image size. If any image dimension is above or below this
+ /// (as specified by condition) the image will be resized so that it meets the
+ /// threshold.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int SizeThreshold {
+ get { return sizeThreshold_; }
+ set {
+ sizeThreshold_ = value;
+ }
+ }
+
+ /// Field number for the "resize_method" field.
+ public const int ResizeMethodFieldNumber = 3;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ResizeType resizeMethod_ = 0;
+ ///
+ /// Desired method when resizing image.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ResizeType ResizeMethod {
+ get { return resizeMethod_; }
+ set {
+ resizeMethod_ = value;
+ }
+ }
+
+ /// Field number for the "convert_to_grayscale" field.
+ public const int ConvertToGrayscaleFieldNumber = 4;
+ private bool convertToGrayscale_;
+ ///
+ /// Whether to also resize the image channels from 3 to 1 (RGB to grayscale).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool ConvertToGrayscale {
+ get { return convertToGrayscale_; }
+ set {
+ convertToGrayscale_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ConditionalShapeResizer);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ConditionalShapeResizer other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Condition != other.Condition) return false;
+ if (SizeThreshold != other.SizeThreshold) return false;
+ if (ResizeMethod != other.ResizeMethod) return false;
+ if (ConvertToGrayscale != other.ConvertToGrayscale) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Condition != 0) hash ^= Condition.GetHashCode();
+ if (SizeThreshold != 0) hash ^= SizeThreshold.GetHashCode();
+ if (ResizeMethod != 0) hash ^= ResizeMethod.GetHashCode();
+ if (ConvertToGrayscale != false) hash ^= ConvertToGrayscale.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Condition != 0) {
+ output.WriteRawTag(8);
+ output.WriteEnum((int) Condition);
+ }
+ if (SizeThreshold != 0) {
+ output.WriteRawTag(16);
+ output.WriteInt32(SizeThreshold);
+ }
+ if (ResizeMethod != 0) {
+ output.WriteRawTag(24);
+ output.WriteEnum((int) ResizeMethod);
+ }
+ if (ConvertToGrayscale != false) {
+ output.WriteRawTag(32);
+ output.WriteBool(ConvertToGrayscale);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Condition != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Condition);
+ }
+ if (SizeThreshold != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(SizeThreshold);
+ }
+ if (ResizeMethod != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResizeMethod);
+ }
+ if (ConvertToGrayscale != false) {
+ size += 1 + 1;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ConditionalShapeResizer other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Condition != 0) {
+ Condition = other.Condition;
+ }
+ if (other.SizeThreshold != 0) {
+ SizeThreshold = other.SizeThreshold;
+ }
+ if (other.ResizeMethod != 0) {
+ ResizeMethod = other.ResizeMethod;
+ }
+ if (other.ConvertToGrayscale != false) {
+ ConvertToGrayscale = other.ConvertToGrayscale;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ condition_ = (global::Tensorflow.Models.ObjectDetection.Protos.ConditionalShapeResizer.Types.ResizeCondition) input.ReadEnum();
+ break;
+ }
+ case 16: {
+ SizeThreshold = input.ReadInt32();
+ break;
+ }
+ case 24: {
+ resizeMethod_ = (global::Tensorflow.Models.ObjectDetection.Protos.ResizeType) input.ReadEnum();
+ break;
+ }
+ case 32: {
+ ConvertToGrayscale = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the ConditionalShapeResizer message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ ///
+ /// Enumeration for the condition on which to resize an image.
+ ///
+ public enum ResizeCondition {
+ ///
+ /// Default value.
+ ///
+ [pbr::OriginalName("INVALID")] Invalid = 0,
+ ///
+ /// Resizes image if a dimension is greater than specified size.
+ ///
+ [pbr::OriginalName("GREATER")] Greater = 1,
+ ///
+ /// Resizes image if a dimension is smaller than specified size.
+ ///
+ [pbr::OriginalName("SMALLER")] Smaller = 2,
+ }
+
+ }
+ #endregion
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs
new file mode 100644
index 00000000..90f7ae1b
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs
@@ -0,0 +1,1225 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/input_reader.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/input_reader.proto
+ public static partial class InputReaderReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/input_reader.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static InputReaderReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CipvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9pbnB1dF9yZWFkZXIucHJvdG8S",
+ "F29iamVjdF9kZXRlY3Rpb24ucHJvdG9zIqsGCgtJbnB1dFJlYWRlchIMCgRu",
+ "YW1lGBcgASgJEhYKDmxhYmVsX21hcF9wYXRoGAEgASgJEg8KB3NodWZmbGUY",
+ "AiABKAgSGwoTc2h1ZmZsZV9idWZmZXJfc2l6ZRgLIAEoDRIlCh1maWxlbmFt",
+ "ZXNfc2h1ZmZsZV9idWZmZXJfc2l6ZRgMIAEoDRISCgpudW1fZXBvY2hzGAUg",
+ "ASgNEh4KFnNhbXBsZV8xX29mX25fZXhhbXBsZXMYFiABKA0SEwoLbnVtX3Jl",
+ "YWRlcnMYBiABKA0SHAoUbnVtX3BhcmFsbGVsX2JhdGNoZXMYEyABKA0SHAoU",
+ "bnVtX3ByZWZldGNoX2JhdGNoZXMYFCABKAUSFgoOcXVldWVfY2FwYWNpdHkY",
+ "AyABKA0SGQoRbWluX2FmdGVyX2RlcXVldWUYBCABKA0SGQoRcmVhZF9ibG9j",
+ "a19sZW5ndGgYDyABKA0SFQoNcHJlZmV0Y2hfc2l6ZRgNIAEoDRIeChZudW1f",
+ "cGFyYWxsZWxfbWFwX2NhbGxzGA4gASgNEh8KF251bV9hZGRpdGlvbmFsX2No",
+ "YW5uZWxzGBIgASgFEhUKDW51bV9rZXlwb2ludHMYECABKA0SGwoTbWF4X251",
+ "bWJlcl9vZl9ib3hlcxgVIAEoBRIeChZsb2FkX211bHRpY2xhc3Nfc2NvcmVz",
+ "GBggASgIEhsKE2xvYWRfaW5zdGFuY2VfbWFza3MYByABKAgSPAoJbWFza190",
+ "eXBlGAogASgOMikub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuSW5zdGFuY2VN",
+ "YXNrVHlwZRIYChB1c2VfZGlzcGxheV9uYW1lGBEgASgIEk4KFnRmX3JlY29y",
+ "ZF9pbnB1dF9yZWFkZXIYCCABKAsyLC5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv",
+ "cy5URlJlY29yZElucHV0UmVhZGVySAASTQoVZXh0ZXJuYWxfaW5wdXRfcmVh",
+ "ZGVyGAkgASgLMiwub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuRXh0ZXJuYWxJ",
+ "bnB1dFJlYWRlckgAQg4KDGlucHV0X3JlYWRlciIpChNURlJlY29yZElucHV0",
+ "UmVhZGVyEhIKCmlucHV0X3BhdGgYASADKAkiFQoTRXh0ZXJuYWxJbnB1dFJl",
+ "YWRlcipDChBJbnN0YW5jZU1hc2tUeXBlEgsKB0RFRkFVTFQQABITCg9OVU1F",
+ "UklDQUxfTUFTS1MQARINCglQTkdfTUFTS1MQAmIGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tensorflow.Models.ObjectDetection.Protos.InstanceMaskType), }, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.InputReader), global::Tensorflow.Models.ObjectDetection.Protos.InputReader.Parser, new[]{ "Name", "LabelMapPath", "Shuffle", "ShuffleBufferSize", "FilenamesShuffleBufferSize", "NumEpochs", "Sample1OfNExamples", "NumReaders", "NumParallelBatches", "NumPrefetchBatches", "QueueCapacity", "MinAfterDequeue", "ReadBlockLength", "PrefetchSize", "NumParallelMapCalls", "NumAdditionalChannels", "NumKeypoints", "MaxNumberOfBoxes", "LoadMulticlassScores", "LoadInstanceMasks", "MaskType", "UseDisplayName", "TfRecordInputReader", "ExternalInputReader" }, new[]{ "InputReader" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader), global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader.Parser, new[]{ "InputPath" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader), global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader.Parser, null, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Enums
+ ///
+ /// Instance mask format. Note that PNG masks are much more space efficient.
+ ///
+ public enum InstanceMaskType {
+ ///
+ /// Default implementation, currently NUMERICAL_MASKS
+ ///
+ [pbr::OriginalName("DEFAULT")] Default = 0,
+ ///
+ /// [num_masks, H, W] float32 binary masks.
+ ///
+ [pbr::OriginalName("NUMERICAL_MASKS")] NumericalMasks = 1,
+ ///
+ /// Encoded PNG masks.
+ ///
+ [pbr::OriginalName("PNG_MASKS")] PngMasks = 2,
+ }
+
+ #endregion
+
+ #region Messages
+ ///
+ /// Next id: 25
+ ///
+ public sealed partial class InputReader : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new InputReader());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.InputReaderReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public InputReader() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public InputReader(InputReader other) : this() {
+ name_ = other.name_;
+ labelMapPath_ = other.labelMapPath_;
+ shuffle_ = other.shuffle_;
+ shuffleBufferSize_ = other.shuffleBufferSize_;
+ filenamesShuffleBufferSize_ = other.filenamesShuffleBufferSize_;
+ numEpochs_ = other.numEpochs_;
+ sample1OfNExamples_ = other.sample1OfNExamples_;
+ numReaders_ = other.numReaders_;
+ numParallelBatches_ = other.numParallelBatches_;
+ numPrefetchBatches_ = other.numPrefetchBatches_;
+ queueCapacity_ = other.queueCapacity_;
+ minAfterDequeue_ = other.minAfterDequeue_;
+ readBlockLength_ = other.readBlockLength_;
+ prefetchSize_ = other.prefetchSize_;
+ numParallelMapCalls_ = other.numParallelMapCalls_;
+ numAdditionalChannels_ = other.numAdditionalChannels_;
+ numKeypoints_ = other.numKeypoints_;
+ maxNumberOfBoxes_ = other.maxNumberOfBoxes_;
+ loadMulticlassScores_ = other.loadMulticlassScores_;
+ loadInstanceMasks_ = other.loadInstanceMasks_;
+ maskType_ = other.maskType_;
+ useDisplayName_ = other.useDisplayName_;
+ switch (other.InputReaderCase) {
+ case InputReaderOneofCase.TfRecordInputReader:
+ TfRecordInputReader = other.TfRecordInputReader.Clone();
+ break;
+ case InputReaderOneofCase.ExternalInputReader:
+ ExternalInputReader = other.ExternalInputReader.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public InputReader Clone() {
+ return new InputReader(this);
+ }
+
+ /// Field number for the "name" field.
+ public const int NameFieldNumber = 23;
+ private string name_ = "";
+ ///
+ /// Name of input reader. Typically used to describe the dataset that is read
+ /// by this input reader.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string Name {
+ get { return name_; }
+ set {
+ name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "label_map_path" field.
+ public const int LabelMapPathFieldNumber = 1;
+ private string labelMapPath_ = "";
+ ///
+ /// Path to StringIntLabelMap pbtxt file specifying the mapping from string
+ /// labels to integer ids.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public string LabelMapPath {
+ get { return labelMapPath_; }
+ set {
+ labelMapPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "shuffle" field.
+ public const int ShuffleFieldNumber = 2;
+ private bool shuffle_;
+ ///
+ /// Whether data should be processed in the order they are read in, or
+ /// shuffled randomly.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Shuffle {
+ get { return shuffle_; }
+ set {
+ shuffle_ = value;
+ }
+ }
+
+ /// Field number for the "shuffle_buffer_size" field.
+ public const int ShuffleBufferSizeFieldNumber = 11;
+ private uint shuffleBufferSize_;
+ ///
+ /// Buffer size to be used when shuffling.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint ShuffleBufferSize {
+ get { return shuffleBufferSize_; }
+ set {
+ shuffleBufferSize_ = value;
+ }
+ }
+
+ /// Field number for the "filenames_shuffle_buffer_size" field.
+ public const int FilenamesShuffleBufferSizeFieldNumber = 12;
+ private uint filenamesShuffleBufferSize_;
+ ///
+ /// Buffer size to be used when shuffling file names.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint FilenamesShuffleBufferSize {
+ get { return filenamesShuffleBufferSize_; }
+ set {
+ filenamesShuffleBufferSize_ = value;
+ }
+ }
+
+ /// Field number for the "num_epochs" field.
+ public const int NumEpochsFieldNumber = 5;
+ private uint numEpochs_;
+ ///
+ /// The number of times a data source is read. If set to zero, the data source
+ /// will be reused indefinitely.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumEpochs {
+ get { return numEpochs_; }
+ set {
+ numEpochs_ = value;
+ }
+ }
+
+ /// Field number for the "sample_1_of_n_examples" field.
+ public const int Sample1OfNExamplesFieldNumber = 22;
+ private uint sample1OfNExamples_;
+ ///
+ /// Integer representing how often an example should be sampled. To feed
+ /// only 1/3 of your data into your model, set `sample_1_of_n_examples` to 3.
+ /// This is particularly useful for evaluation, where you might not prefer to
+ /// evaluate all of your samples.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint Sample1OfNExamples {
+ get { return sample1OfNExamples_; }
+ set {
+ sample1OfNExamples_ = value;
+ }
+ }
+
+ /// Field number for the "num_readers" field.
+ public const int NumReadersFieldNumber = 6;
+ private uint numReaders_;
+ ///
+ /// Number of file shards to read in parallel.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumReaders {
+ get { return numReaders_; }
+ set {
+ numReaders_ = value;
+ }
+ }
+
+ /// Field number for the "num_parallel_batches" field.
+ public const int NumParallelBatchesFieldNumber = 19;
+ private uint numParallelBatches_;
+ ///
+ /// Number of batches to produce in parallel. If this is run on a 2x2 TPU set
+ /// this to 8.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumParallelBatches {
+ get { return numParallelBatches_; }
+ set {
+ numParallelBatches_ = value;
+ }
+ }
+
+ /// Field number for the "num_prefetch_batches" field.
+ public const int NumPrefetchBatchesFieldNumber = 20;
+ private int numPrefetchBatches_;
+ ///
+ /// Number of batches to prefetch. Prefetch decouples input pipeline and
+ /// model so they can be pipelined resulting in higher throughput. Set this
+ /// to a small constant and increment linearly until the improvements become
+ /// marginal or you exceed your cpu memory budget. Setting this to -1,
+ /// automatically tunes this value for you.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumPrefetchBatches {
+ get { return numPrefetchBatches_; }
+ set {
+ numPrefetchBatches_ = value;
+ }
+ }
+
+ /// Field number for the "queue_capacity" field.
+ public const int QueueCapacityFieldNumber = 3;
+ private uint queueCapacity_;
+ ///
+ /// Maximum number of records to keep in reader queue.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint QueueCapacity {
+ get { return queueCapacity_; }
+ set {
+ queueCapacity_ = value;
+ }
+ }
+
+ /// Field number for the "min_after_dequeue" field.
+ public const int MinAfterDequeueFieldNumber = 4;
+ private uint minAfterDequeue_;
+ ///
+ /// Minimum number of records to keep in reader queue. A large value is needed
+ /// to generate a good random shuffle.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint MinAfterDequeue {
+ get { return minAfterDequeue_; }
+ set {
+ minAfterDequeue_ = value;
+ }
+ }
+
+ /// Field number for the "read_block_length" field.
+ public const int ReadBlockLengthFieldNumber = 15;
+ private uint readBlockLength_;
+ ///
+ /// Number of records to read from each reader at once.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint ReadBlockLength {
+ get { return readBlockLength_; }
+ set {
+ readBlockLength_ = value;
+ }
+ }
+
+ /// Field number for the "prefetch_size" field.
+ public const int PrefetchSizeFieldNumber = 13;
+ private uint prefetchSize_;
+ ///
+ /// Number of decoded records to prefetch before batching.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint PrefetchSize {
+ get { return prefetchSize_; }
+ set {
+ prefetchSize_ = value;
+ }
+ }
+
+ /// Field number for the "num_parallel_map_calls" field.
+ public const int NumParallelMapCallsFieldNumber = 14;
+ private uint numParallelMapCalls_;
+ ///
+ /// Number of parallel decode ops to apply.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumParallelMapCalls {
+ get { return numParallelMapCalls_; }
+ set {
+ numParallelMapCalls_ = value;
+ }
+ }
+
+ /// Field number for the "num_additional_channels" field.
+ public const int NumAdditionalChannelsFieldNumber = 18;
+ private int numAdditionalChannels_;
+ ///
+ /// If positive, TfExampleDecoder will try to decode rasters of additional
+ /// channels from tf.Examples.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumAdditionalChannels {
+ get { return numAdditionalChannels_; }
+ set {
+ numAdditionalChannels_ = value;
+ }
+ }
+
+ /// Field number for the "num_keypoints" field.
+ public const int NumKeypointsFieldNumber = 16;
+ private uint numKeypoints_;
+ ///
+ /// Number of groundtruth keypoints per object.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public uint NumKeypoints {
+ get { return numKeypoints_; }
+ set {
+ numKeypoints_ = value;
+ }
+ }
+
+ /// Field number for the "max_number_of_boxes" field.
+ public const int MaxNumberOfBoxesFieldNumber = 21;
+ private int maxNumberOfBoxes_;
+ ///
+ /// Maximum number of boxes to pad to during training / evaluation.
+ /// Set this to at least the maximum amount of boxes in the input data,
+ /// otherwise some groundtruth boxes may be clipped.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int MaxNumberOfBoxes {
+ get { return maxNumberOfBoxes_; }
+ set {
+ maxNumberOfBoxes_ = value;
+ }
+ }
+
+ /// Field number for the "load_multiclass_scores" field.
+ public const int LoadMulticlassScoresFieldNumber = 24;
+ private bool loadMulticlassScores_;
+ ///
+ /// Whether to load multiclass scores from the dataset.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool LoadMulticlassScores {
+ get { return loadMulticlassScores_; }
+ set {
+ loadMulticlassScores_ = value;
+ }
+ }
+
+ /// Field number for the "load_instance_masks" field.
+ public const int LoadInstanceMasksFieldNumber = 7;
+ private bool loadInstanceMasks_;
+ ///
+ /// Whether to load groundtruth instance masks.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool LoadInstanceMasks {
+ get { return loadInstanceMasks_; }
+ set {
+ loadInstanceMasks_ = value;
+ }
+ }
+
+ /// Field number for the "mask_type" field.
+ public const int MaskTypeFieldNumber = 10;
+ private global::Tensorflow.Models.ObjectDetection.Protos.InstanceMaskType maskType_ = 0;
+ ///
+ /// Type of instance mask.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.InstanceMaskType MaskType {
+ get { return maskType_; }
+ set {
+ maskType_ = value;
+ }
+ }
+
+ /// Field number for the "use_display_name" field.
+ public const int UseDisplayNameFieldNumber = 17;
+ private bool useDisplayName_;
+ ///
+ /// Whether to use the display name when decoding examples. This is only used
+ /// when mapping class text strings to integers.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool UseDisplayName {
+ get { return useDisplayName_; }
+ set {
+ useDisplayName_ = value;
+ }
+ }
+
+ /// Field number for the "tf_record_input_reader" field.
+ public const int TfRecordInputReaderFieldNumber = 8;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader TfRecordInputReader {
+ get { return inputReaderCase_ == InputReaderOneofCase.TfRecordInputReader ? (global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader) inputReader_ : null; }
+ set {
+ inputReader_ = value;
+ inputReaderCase_ = value == null ? InputReaderOneofCase.None : InputReaderOneofCase.TfRecordInputReader;
+ }
+ }
+
+ /// Field number for the "external_input_reader" field.
+ public const int ExternalInputReaderFieldNumber = 9;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader ExternalInputReader {
+ get { return inputReaderCase_ == InputReaderOneofCase.ExternalInputReader ? (global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader) inputReader_ : null; }
+ set {
+ inputReader_ = value;
+ inputReaderCase_ = value == null ? InputReaderOneofCase.None : InputReaderOneofCase.ExternalInputReader;
+ }
+ }
+
+ private object inputReader_;
+ /// Enum of possible cases for the "input_reader" oneof.
+ public enum InputReaderOneofCase {
+ None = 0,
+ TfRecordInputReader = 8,
+ ExternalInputReader = 9,
+ }
+ private InputReaderOneofCase inputReaderCase_ = InputReaderOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public InputReaderOneofCase InputReaderCase {
+ get { return inputReaderCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearInputReader() {
+ inputReaderCase_ = InputReaderOneofCase.None;
+ inputReader_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as InputReader);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(InputReader other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Name != other.Name) return false;
+ if (LabelMapPath != other.LabelMapPath) return false;
+ if (Shuffle != other.Shuffle) return false;
+ if (ShuffleBufferSize != other.ShuffleBufferSize) return false;
+ if (FilenamesShuffleBufferSize != other.FilenamesShuffleBufferSize) return false;
+ if (NumEpochs != other.NumEpochs) return false;
+ if (Sample1OfNExamples != other.Sample1OfNExamples) return false;
+ if (NumReaders != other.NumReaders) return false;
+ if (NumParallelBatches != other.NumParallelBatches) return false;
+ if (NumPrefetchBatches != other.NumPrefetchBatches) return false;
+ if (QueueCapacity != other.QueueCapacity) return false;
+ if (MinAfterDequeue != other.MinAfterDequeue) return false;
+ if (ReadBlockLength != other.ReadBlockLength) return false;
+ if (PrefetchSize != other.PrefetchSize) return false;
+ if (NumParallelMapCalls != other.NumParallelMapCalls) return false;
+ if (NumAdditionalChannels != other.NumAdditionalChannels) return false;
+ if (NumKeypoints != other.NumKeypoints) return false;
+ if (MaxNumberOfBoxes != other.MaxNumberOfBoxes) return false;
+ if (LoadMulticlassScores != other.LoadMulticlassScores) return false;
+ if (LoadInstanceMasks != other.LoadInstanceMasks) return false;
+ if (MaskType != other.MaskType) return false;
+ if (UseDisplayName != other.UseDisplayName) return false;
+ if (!object.Equals(TfRecordInputReader, other.TfRecordInputReader)) return false;
+ if (!object.Equals(ExternalInputReader, other.ExternalInputReader)) return false;
+ if (InputReaderCase != other.InputReaderCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Name.Length != 0) hash ^= Name.GetHashCode();
+ if (LabelMapPath.Length != 0) hash ^= LabelMapPath.GetHashCode();
+ if (Shuffle != false) hash ^= Shuffle.GetHashCode();
+ if (ShuffleBufferSize != 0) hash ^= ShuffleBufferSize.GetHashCode();
+ if (FilenamesShuffleBufferSize != 0) hash ^= FilenamesShuffleBufferSize.GetHashCode();
+ if (NumEpochs != 0) hash ^= NumEpochs.GetHashCode();
+ if (Sample1OfNExamples != 0) hash ^= Sample1OfNExamples.GetHashCode();
+ if (NumReaders != 0) hash ^= NumReaders.GetHashCode();
+ if (NumParallelBatches != 0) hash ^= NumParallelBatches.GetHashCode();
+ if (NumPrefetchBatches != 0) hash ^= NumPrefetchBatches.GetHashCode();
+ if (QueueCapacity != 0) hash ^= QueueCapacity.GetHashCode();
+ if (MinAfterDequeue != 0) hash ^= MinAfterDequeue.GetHashCode();
+ if (ReadBlockLength != 0) hash ^= ReadBlockLength.GetHashCode();
+ if (PrefetchSize != 0) hash ^= PrefetchSize.GetHashCode();
+ if (NumParallelMapCalls != 0) hash ^= NumParallelMapCalls.GetHashCode();
+ if (NumAdditionalChannels != 0) hash ^= NumAdditionalChannels.GetHashCode();
+ if (NumKeypoints != 0) hash ^= NumKeypoints.GetHashCode();
+ if (MaxNumberOfBoxes != 0) hash ^= MaxNumberOfBoxes.GetHashCode();
+ if (LoadMulticlassScores != false) hash ^= LoadMulticlassScores.GetHashCode();
+ if (LoadInstanceMasks != false) hash ^= LoadInstanceMasks.GetHashCode();
+ if (MaskType != 0) hash ^= MaskType.GetHashCode();
+ if (UseDisplayName != false) hash ^= UseDisplayName.GetHashCode();
+ if (inputReaderCase_ == InputReaderOneofCase.TfRecordInputReader) hash ^= TfRecordInputReader.GetHashCode();
+ if (inputReaderCase_ == InputReaderOneofCase.ExternalInputReader) hash ^= ExternalInputReader.GetHashCode();
+ hash ^= (int) inputReaderCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (LabelMapPath.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(LabelMapPath);
+ }
+ if (Shuffle != false) {
+ output.WriteRawTag(16);
+ output.WriteBool(Shuffle);
+ }
+ if (QueueCapacity != 0) {
+ output.WriteRawTag(24);
+ output.WriteUInt32(QueueCapacity);
+ }
+ if (MinAfterDequeue != 0) {
+ output.WriteRawTag(32);
+ output.WriteUInt32(MinAfterDequeue);
+ }
+ if (NumEpochs != 0) {
+ output.WriteRawTag(40);
+ output.WriteUInt32(NumEpochs);
+ }
+ if (NumReaders != 0) {
+ output.WriteRawTag(48);
+ output.WriteUInt32(NumReaders);
+ }
+ if (LoadInstanceMasks != false) {
+ output.WriteRawTag(56);
+ output.WriteBool(LoadInstanceMasks);
+ }
+ if (inputReaderCase_ == InputReaderOneofCase.TfRecordInputReader) {
+ output.WriteRawTag(66);
+ output.WriteMessage(TfRecordInputReader);
+ }
+ if (inputReaderCase_ == InputReaderOneofCase.ExternalInputReader) {
+ output.WriteRawTag(74);
+ output.WriteMessage(ExternalInputReader);
+ }
+ if (MaskType != 0) {
+ output.WriteRawTag(80);
+ output.WriteEnum((int) MaskType);
+ }
+ if (ShuffleBufferSize != 0) {
+ output.WriteRawTag(88);
+ output.WriteUInt32(ShuffleBufferSize);
+ }
+ if (FilenamesShuffleBufferSize != 0) {
+ output.WriteRawTag(96);
+ output.WriteUInt32(FilenamesShuffleBufferSize);
+ }
+ if (PrefetchSize != 0) {
+ output.WriteRawTag(104);
+ output.WriteUInt32(PrefetchSize);
+ }
+ if (NumParallelMapCalls != 0) {
+ output.WriteRawTag(112);
+ output.WriteUInt32(NumParallelMapCalls);
+ }
+ if (ReadBlockLength != 0) {
+ output.WriteRawTag(120);
+ output.WriteUInt32(ReadBlockLength);
+ }
+ if (NumKeypoints != 0) {
+ output.WriteRawTag(128, 1);
+ output.WriteUInt32(NumKeypoints);
+ }
+ if (UseDisplayName != false) {
+ output.WriteRawTag(136, 1);
+ output.WriteBool(UseDisplayName);
+ }
+ if (NumAdditionalChannels != 0) {
+ output.WriteRawTag(144, 1);
+ output.WriteInt32(NumAdditionalChannels);
+ }
+ if (NumParallelBatches != 0) {
+ output.WriteRawTag(152, 1);
+ output.WriteUInt32(NumParallelBatches);
+ }
+ if (NumPrefetchBatches != 0) {
+ output.WriteRawTag(160, 1);
+ output.WriteInt32(NumPrefetchBatches);
+ }
+ if (MaxNumberOfBoxes != 0) {
+ output.WriteRawTag(168, 1);
+ output.WriteInt32(MaxNumberOfBoxes);
+ }
+ if (Sample1OfNExamples != 0) {
+ output.WriteRawTag(176, 1);
+ output.WriteUInt32(Sample1OfNExamples);
+ }
+ if (Name.Length != 0) {
+ output.WriteRawTag(186, 1);
+ output.WriteString(Name);
+ }
+ if (LoadMulticlassScores != false) {
+ output.WriteRawTag(192, 1);
+ output.WriteBool(LoadMulticlassScores);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Name.Length != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeStringSize(Name);
+ }
+ if (LabelMapPath.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(LabelMapPath);
+ }
+ if (Shuffle != false) {
+ size += 1 + 1;
+ }
+ if (ShuffleBufferSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ShuffleBufferSize);
+ }
+ if (FilenamesShuffleBufferSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(FilenamesShuffleBufferSize);
+ }
+ if (NumEpochs != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumEpochs);
+ }
+ if (Sample1OfNExamples != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeUInt32Size(Sample1OfNExamples);
+ }
+ if (NumReaders != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumReaders);
+ }
+ if (NumParallelBatches != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeUInt32Size(NumParallelBatches);
+ }
+ if (NumPrefetchBatches != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(NumPrefetchBatches);
+ }
+ if (QueueCapacity != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(QueueCapacity);
+ }
+ if (MinAfterDequeue != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MinAfterDequeue);
+ }
+ if (ReadBlockLength != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ReadBlockLength);
+ }
+ if (PrefetchSize != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(PrefetchSize);
+ }
+ if (NumParallelMapCalls != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumParallelMapCalls);
+ }
+ if (NumAdditionalChannels != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(NumAdditionalChannels);
+ }
+ if (NumKeypoints != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeUInt32Size(NumKeypoints);
+ }
+ if (MaxNumberOfBoxes != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxNumberOfBoxes);
+ }
+ if (LoadMulticlassScores != false) {
+ size += 2 + 1;
+ }
+ if (LoadInstanceMasks != false) {
+ size += 1 + 1;
+ }
+ if (MaskType != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) MaskType);
+ }
+ if (UseDisplayName != false) {
+ size += 2 + 1;
+ }
+ if (inputReaderCase_ == InputReaderOneofCase.TfRecordInputReader) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TfRecordInputReader);
+ }
+ if (inputReaderCase_ == InputReaderOneofCase.ExternalInputReader) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExternalInputReader);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(InputReader other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Name.Length != 0) {
+ Name = other.Name;
+ }
+ if (other.LabelMapPath.Length != 0) {
+ LabelMapPath = other.LabelMapPath;
+ }
+ if (other.Shuffle != false) {
+ Shuffle = other.Shuffle;
+ }
+ if (other.ShuffleBufferSize != 0) {
+ ShuffleBufferSize = other.ShuffleBufferSize;
+ }
+ if (other.FilenamesShuffleBufferSize != 0) {
+ FilenamesShuffleBufferSize = other.FilenamesShuffleBufferSize;
+ }
+ if (other.NumEpochs != 0) {
+ NumEpochs = other.NumEpochs;
+ }
+ if (other.Sample1OfNExamples != 0) {
+ Sample1OfNExamples = other.Sample1OfNExamples;
+ }
+ if (other.NumReaders != 0) {
+ NumReaders = other.NumReaders;
+ }
+ if (other.NumParallelBatches != 0) {
+ NumParallelBatches = other.NumParallelBatches;
+ }
+ if (other.NumPrefetchBatches != 0) {
+ NumPrefetchBatches = other.NumPrefetchBatches;
+ }
+ if (other.QueueCapacity != 0) {
+ QueueCapacity = other.QueueCapacity;
+ }
+ if (other.MinAfterDequeue != 0) {
+ MinAfterDequeue = other.MinAfterDequeue;
+ }
+ if (other.ReadBlockLength != 0) {
+ ReadBlockLength = other.ReadBlockLength;
+ }
+ if (other.PrefetchSize != 0) {
+ PrefetchSize = other.PrefetchSize;
+ }
+ if (other.NumParallelMapCalls != 0) {
+ NumParallelMapCalls = other.NumParallelMapCalls;
+ }
+ if (other.NumAdditionalChannels != 0) {
+ NumAdditionalChannels = other.NumAdditionalChannels;
+ }
+ if (other.NumKeypoints != 0) {
+ NumKeypoints = other.NumKeypoints;
+ }
+ if (other.MaxNumberOfBoxes != 0) {
+ MaxNumberOfBoxes = other.MaxNumberOfBoxes;
+ }
+ if (other.LoadMulticlassScores != false) {
+ LoadMulticlassScores = other.LoadMulticlassScores;
+ }
+ if (other.LoadInstanceMasks != false) {
+ LoadInstanceMasks = other.LoadInstanceMasks;
+ }
+ if (other.MaskType != 0) {
+ MaskType = other.MaskType;
+ }
+ if (other.UseDisplayName != false) {
+ UseDisplayName = other.UseDisplayName;
+ }
+ switch (other.InputReaderCase) {
+ case InputReaderOneofCase.TfRecordInputReader:
+ if (TfRecordInputReader == null) {
+ TfRecordInputReader = new global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader();
+ }
+ TfRecordInputReader.MergeFrom(other.TfRecordInputReader);
+ break;
+ case InputReaderOneofCase.ExternalInputReader:
+ if (ExternalInputReader == null) {
+ ExternalInputReader = new global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader();
+ }
+ ExternalInputReader.MergeFrom(other.ExternalInputReader);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ LabelMapPath = input.ReadString();
+ break;
+ }
+ case 16: {
+ Shuffle = input.ReadBool();
+ break;
+ }
+ case 24: {
+ QueueCapacity = input.ReadUInt32();
+ break;
+ }
+ case 32: {
+ MinAfterDequeue = input.ReadUInt32();
+ break;
+ }
+ case 40: {
+ NumEpochs = input.ReadUInt32();
+ break;
+ }
+ case 48: {
+ NumReaders = input.ReadUInt32();
+ break;
+ }
+ case 56: {
+ LoadInstanceMasks = input.ReadBool();
+ break;
+ }
+ case 66: {
+ global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.TFRecordInputReader();
+ if (inputReaderCase_ == InputReaderOneofCase.TfRecordInputReader) {
+ subBuilder.MergeFrom(TfRecordInputReader);
+ }
+ input.ReadMessage(subBuilder);
+ TfRecordInputReader = subBuilder;
+ break;
+ }
+ case 74: {
+ global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ExternalInputReader();
+ if (inputReaderCase_ == InputReaderOneofCase.ExternalInputReader) {
+ subBuilder.MergeFrom(ExternalInputReader);
+ }
+ input.ReadMessage(subBuilder);
+ ExternalInputReader = subBuilder;
+ break;
+ }
+ case 80: {
+ maskType_ = (global::Tensorflow.Models.ObjectDetection.Protos.InstanceMaskType) input.ReadEnum();
+ break;
+ }
+ case 88: {
+ ShuffleBufferSize = input.ReadUInt32();
+ break;
+ }
+ case 96: {
+ FilenamesShuffleBufferSize = input.ReadUInt32();
+ break;
+ }
+ case 104: {
+ PrefetchSize = input.ReadUInt32();
+ break;
+ }
+ case 112: {
+ NumParallelMapCalls = input.ReadUInt32();
+ break;
+ }
+ case 120: {
+ ReadBlockLength = input.ReadUInt32();
+ break;
+ }
+ case 128: {
+ NumKeypoints = input.ReadUInt32();
+ break;
+ }
+ case 136: {
+ UseDisplayName = input.ReadBool();
+ break;
+ }
+ case 144: {
+ NumAdditionalChannels = input.ReadInt32();
+ break;
+ }
+ case 152: {
+ NumParallelBatches = input.ReadUInt32();
+ break;
+ }
+ case 160: {
+ NumPrefetchBatches = input.ReadInt32();
+ break;
+ }
+ case 168: {
+ MaxNumberOfBoxes = input.ReadInt32();
+ break;
+ }
+ case 176: {
+ Sample1OfNExamples = input.ReadUInt32();
+ break;
+ }
+ case 186: {
+ Name = input.ReadString();
+ break;
+ }
+ case 192: {
+ LoadMulticlassScores = input.ReadBool();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// An input reader that reads TF Example protos from local TFRecord files.
+ ///
+ public sealed partial class TFRecordInputReader : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TFRecordInputReader());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.InputReaderReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TFRecordInputReader() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TFRecordInputReader(TFRecordInputReader other) : this() {
+ inputPath_ = other.inputPath_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public TFRecordInputReader Clone() {
+ return new TFRecordInputReader(this);
+ }
+
+ /// Field number for the "input_path" field.
+ public const int InputPathFieldNumber = 1;
+ private static readonly pb::FieldCodec _repeated_inputPath_codec
+ = pb::FieldCodec.ForString(10);
+ private readonly pbc::RepeatedField inputPath_ = new pbc::RepeatedField();
+ ///
+ /// Path(s) to `TFRecordFile`s.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField InputPath {
+ get { return inputPath_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as TFRecordInputReader);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(TFRecordInputReader other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if(!inputPath_.Equals(other.inputPath_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ hash ^= inputPath_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ inputPath_.WriteTo(output, _repeated_inputPath_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ size += inputPath_.CalculateSize(_repeated_inputPath_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(TFRecordInputReader other) {
+ if (other == null) {
+ return;
+ }
+ inputPath_.Add(other.inputPath_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ inputPath_.AddEntriesFrom(input, _repeated_inputPath_codec);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// An externally defined input reader. Users may define an extension to this
+ /// proto to interface their own input readers.
+ ///
+ public sealed partial class ExternalInputReader : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExternalInputReader());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.InputReaderReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ExternalInputReader() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ExternalInputReader(ExternalInputReader other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public ExternalInputReader Clone() {
+ return new ExternalInputReader(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as ExternalInputReader);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(ExternalInputReader other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(ExternalInputReader other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs
new file mode 100644
index 00000000..bf1f76bd
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs
@@ -0,0 +1,300 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/keypoint_box_coder.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/keypoint_box_coder.proto
+ public static partial class KeypointBoxCoderReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/keypoint_box_coder.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static KeypointBoxCoderReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CjBvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9rZXlwb2ludF9ib3hfY29kZXIu",
+ "cHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zInYKEEtleXBvaW50Qm94",
+ "Q29kZXISFQoNbnVtX2tleXBvaW50cxgBIAEoBRIPCgd5X3NjYWxlGAIgASgC",
+ "Eg8KB3hfc2NhbGUYAyABKAISFAoMaGVpZ2h0X3NjYWxlGAQgASgCEhMKC3dp",
+ "ZHRoX3NjYWxlGAUgASgCYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder), global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoder.Parser, new[]{ "NumKeypoints", "YScale", "XScale", "HeightScale", "WidthScale" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Configuration proto for KeypointBoxCoder. See
+ /// box_coders/keypoint_box_coder.py for details.
+ ///
+ public sealed partial class KeypointBoxCoder : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new KeypointBoxCoder());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.KeypointBoxCoderReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public KeypointBoxCoder() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public KeypointBoxCoder(KeypointBoxCoder other) : this() {
+ numKeypoints_ = other.numKeypoints_;
+ yScale_ = other.yScale_;
+ xScale_ = other.xScale_;
+ heightScale_ = other.heightScale_;
+ widthScale_ = other.widthScale_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public KeypointBoxCoder Clone() {
+ return new KeypointBoxCoder(this);
+ }
+
+ /// Field number for the "num_keypoints" field.
+ public const int NumKeypointsFieldNumber = 1;
+ private int numKeypoints_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int NumKeypoints {
+ get { return numKeypoints_; }
+ set {
+ numKeypoints_ = value;
+ }
+ }
+
+ /// Field number for the "y_scale" field.
+ public const int YScaleFieldNumber = 2;
+ private float yScale_;
+ ///
+ /// Scale factor for anchor encoded box center and keypoints.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float YScale {
+ get { return yScale_; }
+ set {
+ yScale_ = value;
+ }
+ }
+
+ /// Field number for the "x_scale" field.
+ public const int XScaleFieldNumber = 3;
+ private float xScale_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float XScale {
+ get { return xScale_; }
+ set {
+ xScale_ = value;
+ }
+ }
+
+ /// Field number for the "height_scale" field.
+ public const int HeightScaleFieldNumber = 4;
+ private float heightScale_;
+ ///
+ /// Scale factor for anchor encoded box height.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float HeightScale {
+ get { return heightScale_; }
+ set {
+ heightScale_ = value;
+ }
+ }
+
+ /// Field number for the "width_scale" field.
+ public const int WidthScaleFieldNumber = 5;
+ private float widthScale_;
+ ///
+ /// Scale factor for anchor encoded box width.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float WidthScale {
+ get { return widthScale_; }
+ set {
+ widthScale_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as KeypointBoxCoder);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(KeypointBoxCoder other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (NumKeypoints != other.NumKeypoints) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(YScale, other.YScale)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(XScale, other.XScale)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(HeightScale, other.HeightScale)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WidthScale, other.WidthScale)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (NumKeypoints != 0) hash ^= NumKeypoints.GetHashCode();
+ if (YScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(YScale);
+ if (XScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(XScale);
+ if (HeightScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(HeightScale);
+ if (WidthScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WidthScale);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (NumKeypoints != 0) {
+ output.WriteRawTag(8);
+ output.WriteInt32(NumKeypoints);
+ }
+ if (YScale != 0F) {
+ output.WriteRawTag(21);
+ output.WriteFloat(YScale);
+ }
+ if (XScale != 0F) {
+ output.WriteRawTag(29);
+ output.WriteFloat(XScale);
+ }
+ if (HeightScale != 0F) {
+ output.WriteRawTag(37);
+ output.WriteFloat(HeightScale);
+ }
+ if (WidthScale != 0F) {
+ output.WriteRawTag(45);
+ output.WriteFloat(WidthScale);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (NumKeypoints != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumKeypoints);
+ }
+ if (YScale != 0F) {
+ size += 1 + 4;
+ }
+ if (XScale != 0F) {
+ size += 1 + 4;
+ }
+ if (HeightScale != 0F) {
+ size += 1 + 4;
+ }
+ if (WidthScale != 0F) {
+ size += 1 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(KeypointBoxCoder other) {
+ if (other == null) {
+ return;
+ }
+ if (other.NumKeypoints != 0) {
+ NumKeypoints = other.NumKeypoints;
+ }
+ if (other.YScale != 0F) {
+ YScale = other.YScale;
+ }
+ if (other.XScale != 0F) {
+ XScale = other.XScale;
+ }
+ if (other.HeightScale != 0F) {
+ HeightScale = other.HeightScale;
+ }
+ if (other.WidthScale != 0F) {
+ WidthScale = other.WidthScale;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ NumKeypoints = input.ReadInt32();
+ break;
+ }
+ case 21: {
+ YScale = input.ReadFloat();
+ break;
+ }
+ case 29: {
+ XScale = input.ReadFloat();
+ break;
+ }
+ case 37: {
+ HeightScale = input.ReadFloat();
+ break;
+ }
+ case 45: {
+ WidthScale = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs
new file mode 100644
index 00000000..e34ed91b
--- /dev/null
+++ b/src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs
@@ -0,0 +1,3009 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: object_detection/protos/losses.proto
+//
+#pragma warning disable 1591, 0612, 3021
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Tensorflow.Models.ObjectDetection.Protos {
+
+ /// Holder for reflection information generated from object_detection/protos/losses.proto
+ public static partial class LossesReflection {
+
+ #region Descriptor
+ /// File descriptor for object_detection/protos/losses.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static LossesReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CiRvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9sb3NzZXMucHJvdG8SF29iamVj",
+ "dF9kZXRlY3Rpb24ucHJvdG9zIukFCgRMb3NzEkQKEWxvY2FsaXphdGlvbl9s",
+ "b3NzGAEgASgLMikub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuTG9jYWxpemF0",
+ "aW9uTG9zcxJIChNjbGFzc2lmaWNhdGlvbl9sb3NzGAIgASgLMisub2JqZWN0",
+ "X2RldGVjdGlvbi5wcm90b3MuQ2xhc3NpZmljYXRpb25Mb3NzEkUKEmhhcmRf",
+ "ZXhhbXBsZV9taW5lchgDIAEoCzIpLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9z",
+ "LkhhcmRFeGFtcGxlTWluZXISHQoVY2xhc3NpZmljYXRpb25fd2VpZ2h0GAQg",
+ "ASgCEhsKE2xvY2FsaXphdGlvbl93ZWlnaHQYBSABKAISTQoWcmFuZG9tX2V4",
+ "YW1wbGVfc2FtcGxlchgGIAEoCzItLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9z",
+ "LlJhbmRvbUV4YW1wbGVTYW1wbGVyEkkKEWVxdWFsaXphdGlvbl9sb3NzGAcg",
+ "ASgLMi4ub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuTG9zcy5FcXVhbGl6YXRp",
+ "b25Mb3NzElAKFWV4cGVjdGVkX2xvc3Nfd2VpZ2h0cxgSIAEoDjIxLm9iamVj",
+ "dF9kZXRlY3Rpb24ucHJvdG9zLkxvc3MuRXhwZWN0ZWRMb3NzV2VpZ2h0cxIg",
+ "ChhtaW5fbnVtX25lZ2F0aXZlX3NhbXBsZXMYEyABKAISJwofZGVzaXJlZF9u",
+ "ZWdhdGl2ZV9zYW1wbGluZ19yYXRpbxgUIAEoAho8ChBFcXVhbGl6YXRpb25M",
+ "b3NzEg4KBndlaWdodBgBIAEoAhIYChBleGNsdWRlX3ByZWZpeGVzGAIgAygJ",
+ "IlkKE0V4cGVjdGVkTG9zc1dlaWdodHMSCAoETk9ORRAAEhUKEUVYUEVDVEVE",
+ "X1NBTVBMSU5HEAESIQodUkVXRUlHSFRJTkdfVU5NQVRDSEVEX0FOQ0hPUlMQ",
+ "AiKaAgoQTG9jYWxpemF0aW9uTG9zcxJKCgt3ZWlnaHRlZF9sMhgBIAEoCzIz",
+ "Lm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLldlaWdodGVkTDJMb2NhbGl6YXRp",
+ "b25Mb3NzSAASVwoSd2VpZ2h0ZWRfc21vb3RoX2wxGAIgASgLMjkub2JqZWN0",
+ "X2RldGVjdGlvbi5wcm90b3MuV2VpZ2h0ZWRTbW9vdGhMMUxvY2FsaXphdGlv",
+ "bkxvc3NIABJMCgx3ZWlnaHRlZF9pb3UYAyABKAsyNC5vYmplY3RfZGV0ZWN0",
+ "aW9uLnByb3Rvcy5XZWlnaHRlZElPVUxvY2FsaXphdGlvbkxvc3NIAEITChFs",
+ "b2NhbGl6YXRpb25fbG9zcyI3ChpXZWlnaHRlZEwyTG9jYWxpemF0aW9uTG9z",
+ "cxIZChFhbmNob3J3aXNlX291dHB1dBgBIAEoCCJMCiBXZWlnaHRlZFNtb290",
+ "aEwxTG9jYWxpemF0aW9uTG9zcxIZChFhbmNob3J3aXNlX291dHB1dBgBIAEo",
+ "CBINCgVkZWx0YRgCIAEoAiIdChtXZWlnaHRlZElPVUxvY2FsaXphdGlvbkxv",
+ "c3MiggQKEkNsYXNzaWZpY2F0aW9uTG9zcxJWChB3ZWlnaHRlZF9zaWdtb2lk",
+ "GAEgASgLMjoub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuV2VpZ2h0ZWRTaWdt",
+ "b2lkQ2xhc3NpZmljYXRpb25Mb3NzSAASVgoQd2VpZ2h0ZWRfc29mdG1heBgC",
+ "IAEoCzI6Lm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLldlaWdodGVkU29mdG1h",
+ "eENsYXNzaWZpY2F0aW9uTG9zc0gAEmoKF3dlaWdodGVkX2xvZ2l0c19zb2Z0",
+ "bWF4GAUgASgLMkcub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuV2VpZ2h0ZWRT",
+ "b2Z0bWF4Q2xhc3NpZmljYXRpb25BZ2FpbnN0TG9naXRzTG9zc0gAEl4KFGJv",
+ "b3RzdHJhcHBlZF9zaWdtb2lkGAMgASgLMj4ub2JqZWN0X2RldGVjdGlvbi5w",
+ "cm90b3MuQm9vdHN0cmFwcGVkU2lnbW9pZENsYXNzaWZpY2F0aW9uTG9zc0gA",
+ "ElkKFndlaWdodGVkX3NpZ21vaWRfZm9jYWwYBCABKAsyNy5vYmplY3RfZGV0",
+ "ZWN0aW9uLnByb3Rvcy5TaWdtb2lkRm9jYWxDbGFzc2lmaWNhdGlvbkxvc3NI",
+ "AEIVChNjbGFzc2lmaWNhdGlvbl9sb3NzIj4KIVdlaWdodGVkU2lnbW9pZENs",
+ "YXNzaWZpY2F0aW9uTG9zcxIZChFhbmNob3J3aXNlX291dHB1dBgBIAEoCCJZ",
+ "Ch5TaWdtb2lkRm9jYWxDbGFzc2lmaWNhdGlvbkxvc3MSGQoRYW5jaG9yd2lz",
+ "ZV9vdXRwdXQYASABKAgSDQoFZ2FtbWEYAiABKAISDQoFYWxwaGEYAyABKAIi",
+ "UwohV2VpZ2h0ZWRTb2Z0bWF4Q2xhc3NpZmljYXRpb25Mb3NzEhkKEWFuY2hv",
+ "cndpc2Vfb3V0cHV0GAEgASgIEhMKC2xvZ2l0X3NjYWxlGAIgASgCImAKLldl",
+ "aWdodGVkU29mdG1heENsYXNzaWZpY2F0aW9uQWdhaW5zdExvZ2l0c0xvc3MS",
+ "GQoRYW5jaG9yd2lzZV9vdXRwdXQYASABKAgSEwoLbG9naXRfc2NhbGUYAiAB",
+ "KAIiaQolQm9vdHN0cmFwcGVkU2lnbW9pZENsYXNzaWZpY2F0aW9uTG9zcxIN",
+ "CgVhbHBoYRgBIAEoAhIWCg5oYXJkX2Jvb3RzdHJhcBgCIAEoCBIZChFhbmNo",
+ "b3J3aXNlX291dHB1dBgDIAEoCCKMAgoQSGFyZEV4YW1wbGVNaW5lchIZChFu",
+ "dW1faGFyZF9leGFtcGxlcxgBIAEoBRIVCg1pb3VfdGhyZXNob2xkGAIgASgC",
+ "EkUKCWxvc3NfdHlwZRgDIAEoDjIyLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9z",
+ "LkhhcmRFeGFtcGxlTWluZXIuTG9zc1R5cGUSIgoabWF4X25lZ2F0aXZlc19w",
+ "ZXJfcG9zaXRpdmUYBCABKAUSHwoXbWluX25lZ2F0aXZlc19wZXJfaW1hZ2UY",
+ "BSABKAUiOgoITG9zc1R5cGUSCAoEQk9USBAAEhIKDkNMQVNTSUZJQ0FUSU9O",
+ "EAESEAoMTE9DQUxJWkFUSU9OEAIiOAoUUmFuZG9tRXhhbXBsZVNhbXBsZXIS",
+ "IAoYcG9zaXRpdmVfc2FtcGxlX2ZyYWN0aW9uGAEgASgCYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Loss), global::Tensorflow.Models.ObjectDetection.Protos.Loss.Parser, new[]{ "LocalizationLoss", "ClassificationLoss", "HardExampleMiner", "ClassificationWeight", "LocalizationWeight", "RandomExampleSampler", "EqualizationLoss", "ExpectedLossWeights", "MinNumNegativeSamples", "DesiredNegativeSamplingRatio" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.ExpectedLossWeights) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.EqualizationLoss), global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.EqualizationLoss.Parser, new[]{ "Weight", "ExcludePrefixes" }, null, null, null)}),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.LocalizationLoss), global::Tensorflow.Models.ObjectDetection.Protos.LocalizationLoss.Parser, new[]{ "WeightedL2", "WeightedSmoothL1", "WeightedIou" }, new[]{ "LocalizationLoss" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss), global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss.Parser, new[]{ "AnchorwiseOutput" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss), global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss.Parser, new[]{ "AnchorwiseOutput", "Delta" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss), global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss.Parser, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss), global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss.Parser, new[]{ "WeightedSigmoid", "WeightedSoftmax", "WeightedLogitsSoftmax", "BootstrappedSigmoid", "WeightedSigmoidFocal" }, new[]{ "ClassificationLoss" }, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightedSigmoidClassificationLoss), global::Tensorflow.Models.ObjectDetection.Protos.WeightedSigmoidClassificationLoss.Parser, new[]{ "AnchorwiseOutput" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss), global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss.Parser, new[]{ "AnchorwiseOutput", "Gamma", "Alpha" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss), global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss.Parser, new[]{ "AnchorwiseOutput", "LogitScale" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss), global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss.Parser, new[]{ "AnchorwiseOutput", "LogitScale" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss), global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss.Parser, new[]{ "Alpha", "HardBootstrap", "AnchorwiseOutput" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner), global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner.Parser, new[]{ "NumHardExamples", "IouThreshold", "LossType", "MaxNegativesPerPositive", "MinNegativesPerImage" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner.Types.LossType) }, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomExampleSampler), global::Tensorflow.Models.ObjectDetection.Protos.RandomExampleSampler.Parser, new[]{ "PositiveSampleFraction" }, null, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Message for configuring the localization loss, classification loss and hard
+ /// example miner used for training object detection models. See core/losses.py
+ /// for details
+ ///
+ public sealed partial class Loss : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Loss());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.LossesReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Loss() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Loss(Loss other) : this() {
+ localizationLoss_ = other.localizationLoss_ != null ? other.localizationLoss_.Clone() : null;
+ classificationLoss_ = other.classificationLoss_ != null ? other.classificationLoss_.Clone() : null;
+ hardExampleMiner_ = other.hardExampleMiner_ != null ? other.hardExampleMiner_.Clone() : null;
+ classificationWeight_ = other.classificationWeight_;
+ localizationWeight_ = other.localizationWeight_;
+ randomExampleSampler_ = other.randomExampleSampler_ != null ? other.randomExampleSampler_.Clone() : null;
+ equalizationLoss_ = other.equalizationLoss_ != null ? other.equalizationLoss_.Clone() : null;
+ expectedLossWeights_ = other.expectedLossWeights_;
+ minNumNegativeSamples_ = other.minNumNegativeSamples_;
+ desiredNegativeSamplingRatio_ = other.desiredNegativeSamplingRatio_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public Loss Clone() {
+ return new Loss(this);
+ }
+
+ /// Field number for the "localization_loss" field.
+ public const int LocalizationLossFieldNumber = 1;
+ private global::Tensorflow.Models.ObjectDetection.Protos.LocalizationLoss localizationLoss_;
+ ///
+ /// Localization loss to use.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.LocalizationLoss LocalizationLoss {
+ get { return localizationLoss_; }
+ set {
+ localizationLoss_ = value;
+ }
+ }
+
+ /// Field number for the "classification_loss" field.
+ public const int ClassificationLossFieldNumber = 2;
+ private global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss classificationLoss_;
+ ///
+ /// Classification loss to use.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss ClassificationLoss {
+ get { return classificationLoss_; }
+ set {
+ classificationLoss_ = value;
+ }
+ }
+
+ /// Field number for the "hard_example_miner" field.
+ public const int HardExampleMinerFieldNumber = 3;
+ private global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner hardExampleMiner_;
+ ///
+ /// If not left to default, applies hard example mining.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner HardExampleMiner {
+ get { return hardExampleMiner_; }
+ set {
+ hardExampleMiner_ = value;
+ }
+ }
+
+ /// Field number for the "classification_weight" field.
+ public const int ClassificationWeightFieldNumber = 4;
+ private float classificationWeight_;
+ ///
+ /// Classification loss weight.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float ClassificationWeight {
+ get { return classificationWeight_; }
+ set {
+ classificationWeight_ = value;
+ }
+ }
+
+ /// Field number for the "localization_weight" field.
+ public const int LocalizationWeightFieldNumber = 5;
+ private float localizationWeight_;
+ ///
+ /// Localization loss weight.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float LocalizationWeight {
+ get { return localizationWeight_; }
+ set {
+ localizationWeight_ = value;
+ }
+ }
+
+ /// Field number for the "random_example_sampler" field.
+ public const int RandomExampleSamplerFieldNumber = 6;
+ private global::Tensorflow.Models.ObjectDetection.Protos.RandomExampleSampler randomExampleSampler_;
+ ///
+ /// If not left to default, applies random example sampling.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.RandomExampleSampler RandomExampleSampler {
+ get { return randomExampleSampler_; }
+ set {
+ randomExampleSampler_ = value;
+ }
+ }
+
+ /// Field number for the "equalization_loss" field.
+ public const int EqualizationLossFieldNumber = 7;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.EqualizationLoss equalizationLoss_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.EqualizationLoss EqualizationLoss {
+ get { return equalizationLoss_; }
+ set {
+ equalizationLoss_ = value;
+ }
+ }
+
+ /// Field number for the "expected_loss_weights" field.
+ public const int ExpectedLossWeightsFieldNumber = 18;
+ private global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.ExpectedLossWeights expectedLossWeights_ = 0;
+ ///
+ /// Method to compute expected loss weights with respect to balanced
+ /// positive/negative sampling scheme. If NONE, use explicit sampling.
+ /// TODO(birdbrain): Move under ExpectedLossWeights.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.ExpectedLossWeights ExpectedLossWeights {
+ get { return expectedLossWeights_; }
+ set {
+ expectedLossWeights_ = value;
+ }
+ }
+
+ /// Field number for the "min_num_negative_samples" field.
+ public const int MinNumNegativeSamplesFieldNumber = 19;
+ private float minNumNegativeSamples_;
+ ///
+ /// Minimum number of effective negative samples.
+ /// Only applies if expected_loss_weights is not NONE.
+ /// TODO(birdbrain): Move under ExpectedLossWeights.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float MinNumNegativeSamples {
+ get { return minNumNegativeSamples_; }
+ set {
+ minNumNegativeSamples_ = value;
+ }
+ }
+
+ /// Field number for the "desired_negative_sampling_ratio" field.
+ public const int DesiredNegativeSamplingRatioFieldNumber = 20;
+ private float desiredNegativeSamplingRatio_;
+ ///
+ /// Desired number of effective negative samples per positive sample.
+ /// Only applies if expected_loss_weights is not NONE.
+ /// TODO(birdbrain): Move under ExpectedLossWeights.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float DesiredNegativeSamplingRatio {
+ get { return desiredNegativeSamplingRatio_; }
+ set {
+ desiredNegativeSamplingRatio_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as Loss);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(Loss other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(LocalizationLoss, other.LocalizationLoss)) return false;
+ if (!object.Equals(ClassificationLoss, other.ClassificationLoss)) return false;
+ if (!object.Equals(HardExampleMiner, other.HardExampleMiner)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ClassificationWeight, other.ClassificationWeight)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LocalizationWeight, other.LocalizationWeight)) return false;
+ if (!object.Equals(RandomExampleSampler, other.RandomExampleSampler)) return false;
+ if (!object.Equals(EqualizationLoss, other.EqualizationLoss)) return false;
+ if (ExpectedLossWeights != other.ExpectedLossWeights) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinNumNegativeSamples, other.MinNumNegativeSamples)) return false;
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DesiredNegativeSamplingRatio, other.DesiredNegativeSamplingRatio)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (localizationLoss_ != null) hash ^= LocalizationLoss.GetHashCode();
+ if (classificationLoss_ != null) hash ^= ClassificationLoss.GetHashCode();
+ if (hardExampleMiner_ != null) hash ^= HardExampleMiner.GetHashCode();
+ if (ClassificationWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ClassificationWeight);
+ if (LocalizationWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LocalizationWeight);
+ if (randomExampleSampler_ != null) hash ^= RandomExampleSampler.GetHashCode();
+ if (equalizationLoss_ != null) hash ^= EqualizationLoss.GetHashCode();
+ if (ExpectedLossWeights != 0) hash ^= ExpectedLossWeights.GetHashCode();
+ if (MinNumNegativeSamples != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinNumNegativeSamples);
+ if (DesiredNegativeSamplingRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DesiredNegativeSamplingRatio);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (localizationLoss_ != null) {
+ output.WriteRawTag(10);
+ output.WriteMessage(LocalizationLoss);
+ }
+ if (classificationLoss_ != null) {
+ output.WriteRawTag(18);
+ output.WriteMessage(ClassificationLoss);
+ }
+ if (hardExampleMiner_ != null) {
+ output.WriteRawTag(26);
+ output.WriteMessage(HardExampleMiner);
+ }
+ if (ClassificationWeight != 0F) {
+ output.WriteRawTag(37);
+ output.WriteFloat(ClassificationWeight);
+ }
+ if (LocalizationWeight != 0F) {
+ output.WriteRawTag(45);
+ output.WriteFloat(LocalizationWeight);
+ }
+ if (randomExampleSampler_ != null) {
+ output.WriteRawTag(50);
+ output.WriteMessage(RandomExampleSampler);
+ }
+ if (equalizationLoss_ != null) {
+ output.WriteRawTag(58);
+ output.WriteMessage(EqualizationLoss);
+ }
+ if (ExpectedLossWeights != 0) {
+ output.WriteRawTag(144, 1);
+ output.WriteEnum((int) ExpectedLossWeights);
+ }
+ if (MinNumNegativeSamples != 0F) {
+ output.WriteRawTag(157, 1);
+ output.WriteFloat(MinNumNegativeSamples);
+ }
+ if (DesiredNegativeSamplingRatio != 0F) {
+ output.WriteRawTag(165, 1);
+ output.WriteFloat(DesiredNegativeSamplingRatio);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (localizationLoss_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(LocalizationLoss);
+ }
+ if (classificationLoss_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(ClassificationLoss);
+ }
+ if (hardExampleMiner_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(HardExampleMiner);
+ }
+ if (ClassificationWeight != 0F) {
+ size += 1 + 4;
+ }
+ if (LocalizationWeight != 0F) {
+ size += 1 + 4;
+ }
+ if (randomExampleSampler_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomExampleSampler);
+ }
+ if (equalizationLoss_ != null) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(EqualizationLoss);
+ }
+ if (ExpectedLossWeights != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeEnumSize((int) ExpectedLossWeights);
+ }
+ if (MinNumNegativeSamples != 0F) {
+ size += 2 + 4;
+ }
+ if (DesiredNegativeSamplingRatio != 0F) {
+ size += 2 + 4;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(Loss other) {
+ if (other == null) {
+ return;
+ }
+ if (other.localizationLoss_ != null) {
+ if (localizationLoss_ == null) {
+ localizationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.LocalizationLoss();
+ }
+ LocalizationLoss.MergeFrom(other.LocalizationLoss);
+ }
+ if (other.classificationLoss_ != null) {
+ if (classificationLoss_ == null) {
+ classificationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss();
+ }
+ ClassificationLoss.MergeFrom(other.ClassificationLoss);
+ }
+ if (other.hardExampleMiner_ != null) {
+ if (hardExampleMiner_ == null) {
+ hardExampleMiner_ = new global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner();
+ }
+ HardExampleMiner.MergeFrom(other.HardExampleMiner);
+ }
+ if (other.ClassificationWeight != 0F) {
+ ClassificationWeight = other.ClassificationWeight;
+ }
+ if (other.LocalizationWeight != 0F) {
+ LocalizationWeight = other.LocalizationWeight;
+ }
+ if (other.randomExampleSampler_ != null) {
+ if (randomExampleSampler_ == null) {
+ randomExampleSampler_ = new global::Tensorflow.Models.ObjectDetection.Protos.RandomExampleSampler();
+ }
+ RandomExampleSampler.MergeFrom(other.RandomExampleSampler);
+ }
+ if (other.equalizationLoss_ != null) {
+ if (equalizationLoss_ == null) {
+ equalizationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.EqualizationLoss();
+ }
+ EqualizationLoss.MergeFrom(other.EqualizationLoss);
+ }
+ if (other.ExpectedLossWeights != 0) {
+ ExpectedLossWeights = other.ExpectedLossWeights;
+ }
+ if (other.MinNumNegativeSamples != 0F) {
+ MinNumNegativeSamples = other.MinNumNegativeSamples;
+ }
+ if (other.DesiredNegativeSamplingRatio != 0F) {
+ DesiredNegativeSamplingRatio = other.DesiredNegativeSamplingRatio;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ if (localizationLoss_ == null) {
+ localizationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.LocalizationLoss();
+ }
+ input.ReadMessage(localizationLoss_);
+ break;
+ }
+ case 18: {
+ if (classificationLoss_ == null) {
+ classificationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.ClassificationLoss();
+ }
+ input.ReadMessage(classificationLoss_);
+ break;
+ }
+ case 26: {
+ if (hardExampleMiner_ == null) {
+ hardExampleMiner_ = new global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner();
+ }
+ input.ReadMessage(hardExampleMiner_);
+ break;
+ }
+ case 37: {
+ ClassificationWeight = input.ReadFloat();
+ break;
+ }
+ case 45: {
+ LocalizationWeight = input.ReadFloat();
+ break;
+ }
+ case 50: {
+ if (randomExampleSampler_ == null) {
+ randomExampleSampler_ = new global::Tensorflow.Models.ObjectDetection.Protos.RandomExampleSampler();
+ }
+ input.ReadMessage(randomExampleSampler_);
+ break;
+ }
+ case 58: {
+ if (equalizationLoss_ == null) {
+ equalizationLoss_ = new global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.EqualizationLoss();
+ }
+ input.ReadMessage(equalizationLoss_);
+ break;
+ }
+ case 144: {
+ expectedLossWeights_ = (global::Tensorflow.Models.ObjectDetection.Protos.Loss.Types.ExpectedLossWeights) input.ReadEnum();
+ break;
+ }
+ case 157: {
+ MinNumNegativeSamples = input.ReadFloat();
+ break;
+ }
+ case 165: {
+ DesiredNegativeSamplingRatio = input.ReadFloat();
+ break;
+ }
+ }
+ }
+ }
+
+ #region Nested types
+ /// Container for nested types declared in the Loss message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static partial class Types {
+ public enum ExpectedLossWeights {
+ [pbr::OriginalName("NONE")] None = 0,
+ ///
+ /// Use expected_classification_loss_by_expected_sampling
+ /// from third_party/tensorflow_models/object_detection/utils/ops.py
+ ///
+ [pbr::OriginalName("EXPECTED_SAMPLING")] ExpectedSampling = 1,
+ ///
+ /// Use expected_classification_loss_by_reweighting_unmatched_anchors
+ /// from third_party/tensorflow_models/object_detection/utils/ops.py
+ ///
+ [pbr::OriginalName("REWEIGHTING_UNMATCHED_ANCHORS")] ReweightingUnmatchedAnchors = 2,
+ }
+
+ ///
+ /// Equalization loss.
+ ///
+ public sealed partial class EqualizationLoss : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EqualizationLoss());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.Loss.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EqualizationLoss() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EqualizationLoss(EqualizationLoss other) : this() {
+ weight_ = other.weight_;
+ excludePrefixes_ = other.excludePrefixes_.Clone();
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public EqualizationLoss Clone() {
+ return new EqualizationLoss(this);
+ }
+
+ /// Field number for the "weight" field.
+ public const int WeightFieldNumber = 1;
+ private float weight_;
+ ///
+ /// Weight equalization loss strength.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public float Weight {
+ get { return weight_; }
+ set {
+ weight_ = value;
+ }
+ }
+
+ /// Field number for the "exclude_prefixes" field.
+ public const int ExcludePrefixesFieldNumber = 2;
+ private static readonly pb::FieldCodec _repeated_excludePrefixes_codec
+ = pb::FieldCodec.ForString(18);
+ private readonly pbc::RepeatedField excludePrefixes_ = new pbc::RepeatedField();
+ ///
+ /// When computing equalization loss, ops that start with
+ /// equalization_exclude_prefixes will be ignored. Only used when
+ /// equalization_weight > 0.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public pbc::RepeatedField ExcludePrefixes {
+ get { return excludePrefixes_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as EqualizationLoss);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(EqualizationLoss other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Weight, other.Weight)) return false;
+ if(!excludePrefixes_.Equals(other.excludePrefixes_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Weight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Weight);
+ hash ^= excludePrefixes_.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (Weight != 0F) {
+ output.WriteRawTag(13);
+ output.WriteFloat(Weight);
+ }
+ excludePrefixes_.WriteTo(output, _repeated_excludePrefixes_codec);
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (Weight != 0F) {
+ size += 1 + 4;
+ }
+ size += excludePrefixes_.CalculateSize(_repeated_excludePrefixes_codec);
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(EqualizationLoss other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Weight != 0F) {
+ Weight = other.Weight;
+ }
+ excludePrefixes_.Add(other.excludePrefixes_);
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 13: {
+ Weight = input.ReadFloat();
+ break;
+ }
+ case 18: {
+ excludePrefixes_.AddEntriesFrom(input, _repeated_excludePrefixes_codec);
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ }
+ #endregion
+
+ }
+
+ ///
+ /// Configuration for bounding box localization loss function.
+ ///
+ public sealed partial class LocalizationLoss : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LocalizationLoss());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.LossesReflection.Descriptor.MessageTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public LocalizationLoss() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public LocalizationLoss(LocalizationLoss other) : this() {
+ switch (other.LocalizationLossCase) {
+ case LocalizationLossOneofCase.WeightedL2:
+ WeightedL2 = other.WeightedL2.Clone();
+ break;
+ case LocalizationLossOneofCase.WeightedSmoothL1:
+ WeightedSmoothL1 = other.WeightedSmoothL1.Clone();
+ break;
+ case LocalizationLossOneofCase.WeightedIou:
+ WeightedIou = other.WeightedIou.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public LocalizationLoss Clone() {
+ return new LocalizationLoss(this);
+ }
+
+ /// Field number for the "weighted_l2" field.
+ public const int WeightedL2FieldNumber = 1;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss WeightedL2 {
+ get { return localizationLossCase_ == LocalizationLossOneofCase.WeightedL2 ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss) localizationLoss_ : null; }
+ set {
+ localizationLoss_ = value;
+ localizationLossCase_ = value == null ? LocalizationLossOneofCase.None : LocalizationLossOneofCase.WeightedL2;
+ }
+ }
+
+ /// Field number for the "weighted_smooth_l1" field.
+ public const int WeightedSmoothL1FieldNumber = 2;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss WeightedSmoothL1 {
+ get { return localizationLossCase_ == LocalizationLossOneofCase.WeightedSmoothL1 ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss) localizationLoss_ : null; }
+ set {
+ localizationLoss_ = value;
+ localizationLossCase_ = value == null ? LocalizationLossOneofCase.None : LocalizationLossOneofCase.WeightedSmoothL1;
+ }
+ }
+
+ /// Field number for the "weighted_iou" field.
+ public const int WeightedIouFieldNumber = 3;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss WeightedIou {
+ get { return localizationLossCase_ == LocalizationLossOneofCase.WeightedIou ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss) localizationLoss_ : null; }
+ set {
+ localizationLoss_ = value;
+ localizationLossCase_ = value == null ? LocalizationLossOneofCase.None : LocalizationLossOneofCase.WeightedIou;
+ }
+ }
+
+ private object localizationLoss_;
+ /// Enum of possible cases for the "localization_loss" oneof.
+ public enum LocalizationLossOneofCase {
+ None = 0,
+ WeightedL2 = 1,
+ WeightedSmoothL1 = 2,
+ WeightedIou = 3,
+ }
+ private LocalizationLossOneofCase localizationLossCase_ = LocalizationLossOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public LocalizationLossOneofCase LocalizationLossCase {
+ get { return localizationLossCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void ClearLocalizationLoss() {
+ localizationLossCase_ = LocalizationLossOneofCase.None;
+ localizationLoss_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override bool Equals(object other) {
+ return Equals(other as LocalizationLoss);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public bool Equals(LocalizationLoss other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!object.Equals(WeightedL2, other.WeightedL2)) return false;
+ if (!object.Equals(WeightedSmoothL1, other.WeightedSmoothL1)) return false;
+ if (!object.Equals(WeightedIou, other.WeightedIou)) return false;
+ if (LocalizationLossCase != other.LocalizationLossCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedL2) hash ^= WeightedL2.GetHashCode();
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedSmoothL1) hash ^= WeightedSmoothL1.GetHashCode();
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedIou) hash ^= WeightedIou.GetHashCode();
+ hash ^= (int) localizationLossCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void WriteTo(pb::CodedOutputStream output) {
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedL2) {
+ output.WriteRawTag(10);
+ output.WriteMessage(WeightedL2);
+ }
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedSmoothL1) {
+ output.WriteRawTag(18);
+ output.WriteMessage(WeightedSmoothL1);
+ }
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedIou) {
+ output.WriteRawTag(26);
+ output.WriteMessage(WeightedIou);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int CalculateSize() {
+ int size = 0;
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedL2) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedL2);
+ }
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedSmoothL1) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedSmoothL1);
+ }
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedIou) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedIou);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(LocalizationLoss other) {
+ if (other == null) {
+ return;
+ }
+ switch (other.LocalizationLossCase) {
+ case LocalizationLossOneofCase.WeightedL2:
+ if (WeightedL2 == null) {
+ WeightedL2 = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss();
+ }
+ WeightedL2.MergeFrom(other.WeightedL2);
+ break;
+ case LocalizationLossOneofCase.WeightedSmoothL1:
+ if (WeightedSmoothL1 == null) {
+ WeightedSmoothL1 = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss();
+ }
+ WeightedSmoothL1.MergeFrom(other.WeightedSmoothL1);
+ break;
+ case LocalizationLossOneofCase.WeightedIou:
+ if (WeightedIou == null) {
+ WeightedIou = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss();
+ }
+ WeightedIou.MergeFrom(other.WeightedIou);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public void MergeFrom(pb::CodedInputStream input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedL2LocalizationLoss();
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedL2) {
+ subBuilder.MergeFrom(WeightedL2);
+ }
+ input.ReadMessage(subBuilder);
+ WeightedL2 = subBuilder;
+ break;
+ }
+ case 18: {
+ global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSmoothL1LocalizationLoss();
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedSmoothL1) {
+ subBuilder.MergeFrom(WeightedSmoothL1);
+ }
+ input.ReadMessage(subBuilder);
+ WeightedSmoothL1 = subBuilder;
+ break;
+ }
+ case 26: {
+ global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedIOULocalizationLoss();
+ if (localizationLossCase_ == LocalizationLossOneofCase.WeightedIou) {
+ subBuilder.MergeFrom(WeightedIou);
+ }
+ input.ReadMessage(subBuilder);
+ WeightedIou = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+
+ ///
+ /// L2 location loss: 0.5 * ||weight * (a - b)|| ^ 2
+ ///
+ public sealed partial class WeightedL2LocalizationLoss : pb::IMessage {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedL2LocalizationLoss());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Tensorflow.Models.ObjectDetection.Protos.LossesReflection.Descriptor.MessageTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public WeightedL2LocalizationLoss() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public WeightedL2LocalizationLoss(WeightedL2LocalizationLoss other) : this() {
+ anchorwiseOutput_ = other.anchorwiseOutput_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public WeightedL2LocalizationLoss Clone() {
+ return new WeightedL2LocalizationLoss(this);
+ }
+
+ ///