From 2394a8014e3ed349e4bdab8fe5d17e6fd1adf540 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 7 Nov 2019 07:50:33 -0600 Subject: [PATCH 01/24] IsWhileContext returns false. --- .../Operations/ControlFlows/ControlFlowContext.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/TensorFlowNET.Core/Operations/ControlFlows/ControlFlowContext.cs b/src/TensorFlowNET.Core/Operations/ControlFlows/ControlFlowContext.cs index 00c395a3..0d2665e1 100644 --- a/src/TensorFlowNET.Core/Operations/ControlFlows/ControlFlowContext.cs +++ b/src/TensorFlowNET.Core/Operations/ControlFlows/ControlFlowContext.cs @@ -305,9 +305,7 @@ namespace Tensorflow.Operations } public virtual bool IsWhileContext() - { - throw new NotImplementedException("IsWhileContext"); - } + => false; public virtual bool IsCondContext() => false; From ddd23e31e3a379c0b0298e46d4322c4075c4f2e8 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 7 Nov 2019 07:51:12 -0600 Subject: [PATCH 02/24] CheckInputFromValidContext when while_ctxt is null. --- .../Operations/control_flow_util.py.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/TensorFlowNET.Core/Operations/control_flow_util.py.cs b/src/TensorFlowNET.Core/Operations/control_flow_util.py.cs index 5f3bc15c..20dc0f26 100644 --- a/src/TensorFlowNET.Core/Operations/control_flow_util.py.cs +++ b/src/TensorFlowNET.Core/Operations/control_flow_util.py.cs @@ -132,7 +132,18 @@ namespace Tensorflow if (while_ctxt == null) { - throw new NotImplementedException("CheckInputFromValidContext"); + // Neither op nor input_op is in a while loop, but one or both are in + // conds. We allow this, although execution will fail if the branch + // corresponding to input_op's cond context isn't taken. + if (input_while_ctxt == null) + valid = true; + // Invalid if op isn't in a while loop and input_op is. Unless... + if (IsLoopEnter(op)) + // WhileContext._BuildLoop clears context for Enter nodes. + valid = true; + if (IsSwitch(op)) + // CondContext.AddValue clears context for Switch nodes. + valid = true; } else if (IsContainingContext(while_ctxt, input_while_ctxt)) { From a5bf2f4f9fed7e00dbc6a68b71da333ecf2d054d Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 7 Nov 2019 07:51:44 -0600 Subject: [PATCH 03/24] add context_t.ExitResult for control_flow_ops.cond --- .../Operations/control_flow_ops.cs | 82 +++++++++---------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/src/TensorFlowNET.Core/Operations/control_flow_ops.cs b/src/TensorFlowNET.Core/Operations/control_flow_ops.cs index b8360939..ffa0675b 100644 --- a/src/TensorFlowNET.Core/Operations/control_flow_ops.cs +++ b/src/TensorFlowNET.Core/Operations/control_flow_ops.cs @@ -376,19 +376,9 @@ namespace Tensorflow { return tf_with(ops.name_scope(name, "cond", new { pred }), delegate { - // TODO: here a chunk of original code is missing - /* - with ops.name_scope(name, "cond", [pred]): - if context.executing_eagerly(): - if pred: - return _UnpackIfSingleton(true_fn()) - return _UnpackIfSingleton(false_fn()) - */ - // Add the Switch to the graph. var switch_result= @switch(pred, pred); - var p_2=switch_result[0]; - var p_1 = switch_result[1]; + var (p_2, p_1 )= (switch_result[0], switch_result[1]); var pivot_1 = array_ops.identity(p_1, name: "switch_t"); var pivot_2 = array_ops.identity(p_2, name: "switch_f"); pred = array_ops.identity(pred, name: "pred_id"); @@ -405,6 +395,7 @@ namespace Tensorflow { context_t.Enter(); (orig_res_t, res_t) = context_t.BuildCondBranch(true_fn); + context_t.ExitResult(new[] { res_t }); } finally { @@ -418,46 +409,36 @@ namespace Tensorflow { context_f.Enter(); (orig_res_f, res_f) = context_f.BuildCondBranch(false_fn); + context_f.ExitResult(new[] { res_f }); } finally { context_f.Exit(); } - //TODO: missing original code - //if not strict: - // orig_res_t = _UnpackIfSingleton(orig_res_t) - // orig_res_f = _UnpackIfSingleton(orig_res_f) - /* - # Check that the return values of the two branches have the same structure. - try: - nest.assert_same_structure(orig_res_t, orig_res_f) - except TypeError as e: - raise TypeError( - "Incompatible return types of true_fn and false_fn: {}".format(e)) - except ValueError as e: - raise ValueError( - "Incompatible return values of true_fn and false_fn: {}".format(e))*/ - var res_t_flat = new Tensor[] { res_t }; var res_f_flat = new Tensor[] { res_f }; - foreach(var (val_x, val_y) in zip(res_t_flat, res_f_flat)) - { - - } - var merges = zip(res_f_flat, res_t_flat) - .Select(pair => merge(new Tensor[] { pair.Item1, pair.Item2 })) - .Select(m => (Tensor)m) + .Select(pair => merge(new Tensor[] { pair.Item1, pair.Item2 })[0]) .ToArray(); - var merges2 = _convert_flows_to_tensorarrays(new ITensorOrTensorArray[] { (Tensor)orig_res_t }, merges); + if (orig_res_t is Tensor orig_res_tensor) + merges = _convert_flows_to_tensorarrays(new[] { orig_res_tensor }, merges) + .Select(x => x as Tensor) + .ToArray(); + else + { - ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_t); - ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_f); + } - return new Tensor(IntPtr.Zero); + if(context_t.outer_context == null) + { + ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_t); + ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_f); + } + + return merges[0]; }); } @@ -485,28 +466,43 @@ namespace Tensorflow var context_t = new CondContext(pred: pred, pivot: pivot_1, branch: 1); context_t.Enter(); var (orig_res_t, res_t) = context_t.BuildCondBranch(true_fn); + context_t.ExitResult(res_t); context_t.Exit(); // Build the graph for the false branch in a new context. var context_f = new CondContext(pred: pred, pivot: pivot_2, branch: 0); context_f.Enter(); var (orig_res_f, res_f) = context_f.BuildCondBranch(false_fn); + context_f.ExitResult(res_f); context_f.Exit(); var res_t_flat = res_t; var res_f_flat = res_f; var merges = zip(res_f_flat, res_t_flat) - .Select(pair => merge(new [] { pair.Item1, pair.Item2 })) - .Select(m => (Tensor)m) + .Select(pair => merge(new [] { pair.Item1, pair.Item2 })[0]) .ToArray(); - var merges2 = _convert_flows_to_tensorarrays(orig_res_t.Select(x => (ITensorOrTensorArray)x).ToArray(), merges); + if (orig_res_t is Tensor[] orig_res_tensor) + merges = _convert_flows_to_tensorarrays(orig_res_tensor, merges) + .Select(x => x as Tensor) + .ToArray(); + else if (orig_res_t is float[] orig_res_float) + { - ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_t); - ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_f); + } + else + { + + } + + if(context_t.outer_context == null) + { + ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_t); + ops.add_to_collection(tf.GraphKeys.COND_CONTEXT, context_f); + } - return new[] { new Tensor(IntPtr.Zero) }; + return merges; }); } From 9c71cb84a58efaa9a4b54a646d5d71b51da18e9d Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 7 Nov 2019 07:53:24 -0600 Subject: [PATCH 04/24] change div to truediv --- .../Tensors/Tensor.Operators.cs | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs index ae14958f..5a3d6f79 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs @@ -129,31 +129,31 @@ namespace Tensorflow public static Tensor operator *(double lhs, Tensor rhs) => BinaryOpWrapper("mul", lhs, rhs); public static Tensor operator *(Tensor lhs, Complex rhs) => BinaryOpWrapper("mul", lhs, rhs); public static Tensor operator *(Complex lhs, Tensor rhs) => BinaryOpWrapper("mul", lhs, rhs); - public static Tensor operator /(Tensor lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, NDArray rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(NDArray lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, sbyte rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(sbyte lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, byte rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(byte lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, short rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(short lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, ushort rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(ushort lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, int rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(int lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, uint rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(uint lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, ulong rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(ulong lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, long rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(long lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, float rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(float lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, double rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(double lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Tensor lhs, Complex rhs) => BinaryOpWrapper("div", lhs, rhs); - public static Tensor operator /(Complex lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, NDArray rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(NDArray lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, sbyte rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(sbyte lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, byte rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(byte lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, short rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(short lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, ushort rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(ushort lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, int rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(int lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, uint rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(uint lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, ulong rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(ulong lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, long rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(long lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, float rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(float lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, double rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(double lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, Complex rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Complex lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); public static Tensor operator %(Tensor lhs, Tensor rhs) => BinaryOpWrapper("mod", lhs, rhs); public static Tensor operator %(Tensor lhs, NDArray rhs) => BinaryOpWrapper("mod", lhs, rhs); public static Tensor operator %(NDArray lhs, Tensor rhs) => BinaryOpWrapper("mod", lhs, rhs); From fa4a931d5ae016a971b20386cd7a7650ffc0f212 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 7 Nov 2019 21:34:16 -0600 Subject: [PATCH 05/24] fix Incompatible shapes for node define_loss/bigger_box_loss/mul_13 #424 --- src/TensorFlowNET.Core/Graphs/Graph.cs | 4 +- .../Operations/Operation.Output.cs | 3 + .../Operations/Operation.cs | 9 +- .../Tensors/Tensor.Index.cs | 2 + .../Tensors/Tensor.Operators.cs | 84 ++++++++++++------- src/TensorFlowNET.Core/Tensors/Tensor.cs | 3 + 6 files changed, 68 insertions(+), 37 deletions(-) diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index c9ad6402..f8746f7f 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -75,9 +75,9 @@ namespace Tensorflow /// then create a TensorFlow session to run parts of the graph across a set of local and remote devices. /// /// https://www.tensorflow.org/guide/graphs

https://www.tensorflow.org/api_docs/python/tf/Graph
- public partial class Graph : DisposableObject, + public partial class Graph : DisposableObject #if !SERIALIZABLE - IEnumerable + ,IEnumerable #endif { private Dictionary _nodes_by_id; diff --git a/src/TensorFlowNET.Core/Operations/Operation.Output.cs b/src/TensorFlowNET.Core/Operations/Operation.Output.cs index 77bf68a1..abe8e9c1 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.Output.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.Output.cs @@ -60,6 +60,9 @@ namespace Tensorflow /// /// List this operation's output types. /// +#if SERIALIZABLE + [JsonIgnore] +#endif public TF_DataType[] _output_types { get diff --git a/src/TensorFlowNET.Core/Operations/Operation.cs b/src/TensorFlowNET.Core/Operations/Operation.cs index 0f9ed2eb..359dc870 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.cs @@ -78,7 +78,10 @@ namespace Tensorflow #if SERIALIZABLE [JsonIgnore] #endif - bool _is_stateful; + bool _is_stateful; +#if SERIALIZABLE + [JsonIgnore] +#endif public NodeDef node_def { get @@ -181,8 +184,8 @@ namespace Tensorflow // This will be set by self.inputs. if (op_def == null) - op_def = g.GetOpDef(node_def.Op); - + op_def = g.GetOpDef(node_def.Op); + var grouped_inputs = _reconstruct_sequence_inputs(op_def, inputs, node_def.Attr); _handle = ops._create_c_op(g, node_def, grouped_inputs, control_input_ops.ToArray()); _is_stateful = op_def.IsStateful; diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Index.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Index.cs index d916f624..26c251b0 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Index.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Index.cs @@ -79,6 +79,8 @@ namespace Tensorflow } strides.Add(s.Step); + if (s.IsIndex) + shrink_axis_mask |= (1 << index); } index += 1; diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs index 5a3d6f79..2a901e07 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs @@ -16,6 +16,7 @@ using NumSharp; using System; +using System.Collections.Generic; using System.Linq; using System.Numerics; using static Tensorflow.Binding; @@ -25,7 +26,7 @@ namespace Tensorflow public partial class Tensor { #if _REGEN - #region Compute + #region Compute %operators = ["add", "sub", "mul", "div", "mod"] %operators_sign = ["+", "-", "*", "/", "%"] %operators_comparers = [">", "<", ">=", "<="] @@ -49,11 +50,11 @@ namespace Tensorflow % % public static Tensor operator -(Tensor x) => gen_math_ops.neg(x); - #endregion + #endregion #else - #region Compute + #region Compute + - public static Tensor operator +(Tensor lhs, Tensor rhs) => BinaryOpWrapper("add", lhs, rhs); public static Tensor operator +(Tensor lhs, NDArray rhs) => BinaryOpWrapper("add", lhs, rhs); public static Tensor operator +(NDArray lhs, Tensor rhs) => BinaryOpWrapper("add", lhs, rhs); @@ -129,31 +130,31 @@ namespace Tensorflow public static Tensor operator *(double lhs, Tensor rhs) => BinaryOpWrapper("mul", lhs, rhs); public static Tensor operator *(Tensor lhs, Complex rhs) => BinaryOpWrapper("mul", lhs, rhs); public static Tensor operator *(Complex lhs, Tensor rhs) => BinaryOpWrapper("mul", lhs, rhs); - public static Tensor operator /(Tensor lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, NDArray rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(NDArray lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, sbyte rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(sbyte lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, byte rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(byte lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, short rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(short lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, ushort rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(ushort lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, int rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(int lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, uint rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(uint lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, ulong rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(ulong lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, long rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(long lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, float rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(float lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, double rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(double lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Tensor lhs, Complex rhs) => BinaryOpWrapper("truediv", lhs, rhs); - public static Tensor operator /(Complex lhs, Tensor rhs) => BinaryOpWrapper("truediv", lhs, rhs); + public static Tensor operator /(Tensor lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, NDArray rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(NDArray lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, sbyte rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(sbyte lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, byte rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(byte lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, short rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(short lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, ushort rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(ushort lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, int rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(int lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, uint rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(uint lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, ulong rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(ulong lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, long rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(long lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, float rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(float lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, double rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(double lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Tensor lhs, Complex rhs) => BinaryOpWrapper("div", lhs, rhs); + public static Tensor operator /(Complex lhs, Tensor rhs) => BinaryOpWrapper("div", lhs, rhs); public static Tensor operator %(Tensor lhs, Tensor rhs) => BinaryOpWrapper("mod", lhs, rhs); public static Tensor operator %(Tensor lhs, NDArray rhs) => BinaryOpWrapper("mod", lhs, rhs); public static Tensor operator %(NDArray lhs, Tensor rhs) => BinaryOpWrapper("mod", lhs, rhs); @@ -281,24 +282,43 @@ namespace Tensorflow public static Tensor operator <=(Tensor lhs, Complex rhs) => gen_math_ops.less_equal(lhs, rhs); public static Tensor operator <=(Complex lhs, Tensor rhs) => gen_math_ops.less_equal(lhs, rhs); public static Tensor operator -(Tensor x) => gen_math_ops.neg(x); - #endregion + #endregion #endif - + private static readonly TF_DataType[] _intTfDataTypes = { TF_DataType.TF_INT8, TF_DataType.TF_INT16, TF_DataType.TF_INT32, TF_DataType.TF_INT64, TF_DataType.TF_QINT8, TF_DataType.TF_QINT16, TF_DataType.TF_QINT32, TF_DataType.TF_UINT8, TF_DataType.TF_UINT16, TF_DataType.TF_UINT32, TF_DataType.TF_UINT64 }; + private static string div_or_truediv(string name, Tx x, Ty y) + { + bool is_floating = false; + var types = new List(); + + if (x is Tensor t1) + types.add(t1.dtype.is_floating()); + + if (y is Tensor t2) + types.add(t2.dtype.is_floating()); + + is_floating = types.Contains(true); + + return is_floating ? "truediv" : name; + } + private static Tensor BinaryOpWrapper(string name, Tx x, Ty y) { TF_DataType dtype = TF_DataType.DtInvalid; - + if (x is Tensor tl) dtype = tl.dtype.as_base_dtype(); if (y is Tensor tr) dtype = tr.dtype.as_base_dtype(); + if (name == "div") + name = div_or_truediv(name, x, y); + return tf_with(ops.name_scope(null, name, new { x, y }), scope => { Tensor result; diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.cs b/src/TensorFlowNET.Core/Tensors/Tensor.cs index 9f505419..67474eb9 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.cs @@ -102,6 +102,9 @@ namespace Tensorflow [JsonIgnore] #endif public ulong size => _handle == IntPtr.Zero ? 0 : bytesize / itemsize; +#if SERIALIZABLE + [JsonIgnore] +#endif public IntPtr buffer => _handle == IntPtr.Zero ? IntPtr.Zero : c_api.TF_TensorData(_handle); public int num_consumers(TF_Output oper_out) => _handle == IntPtr.Zero ? 0 : c_api.TF_OperationOutputNumConsumers(oper_out); #if SERIALIZABLE From 62b426797420a8d95f509b86de3f924812bef42a Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 7 Nov 2019 22:34:39 -0600 Subject: [PATCH 06/24] add net472 target #436 --- src/TensorFlowNET.Core/TensorFlowNET.Core.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj index de6e92cf..b94203d2 100644 --- a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj +++ b/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj @@ -1,10 +1,10 @@  - netstandard2.0 + net472;netstandard2.0 TensorFlow.NET Tensorflow - 1.14.0 + 1.14.1 0.12.0 Haiping Chen, Meinrad Recheis, Eli Belash SciSharp STACK From 5808e34ff7a98db815258b0f8c4d4e47880c0937 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Sat, 9 Nov 2019 12:30:12 -0600 Subject: [PATCH 07/24] fixed Repeated Abs name #442 --- src/TensorFlowNET.Core/APIs/tf.math.cs | 5 +++- .../Operations/Operation.cs | 5 ++++ .../Operations/gen_math_ops.cs | 13 +++-------- src/TensorFlowNET.Core/Operations/math_ops.cs | 23 ++++++++++++++++--- .../Tensors/Tensor.Operators.cs | 8 +++---- 5 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index cba05d0e..e3b9e257 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -441,7 +441,7 @@ namespace Tensorflow return math_ops.reduce_sum(input, keepdims: keepdims, name: name); } - public Tensor reduce_sum(Tensor input, int[] axis, int? reduction_indices = null, + public Tensor reduce_sum(Tensor input, TensorShape axis, int? reduction_indices = null, bool keepdims = false, string name = null) => math_ops.reduce_sum(input, axis, keepdims: keepdims, name: name); @@ -456,6 +456,9 @@ namespace Tensorflow public Tensor reduce_max(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) => math_ops.reduce_max(input_tensor, axis, keepdims, name); + public Tensor reduce_max(Tensor input_tensor, int axis, bool keepdims = false, string name = null) + => math_ops.reduce_max(input_tensor, axis, keepdims, name); + public Tensor reduce_min(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) => math_ops.reduce_min(input_tensor, axis, keepdims, name); diff --git a/src/TensorFlowNET.Core/Operations/Operation.cs b/src/TensorFlowNET.Core/Operations/Operation.cs index 359dc870..0ee72c39 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.cs @@ -186,6 +186,11 @@ namespace Tensorflow if (op_def == null) op_def = g.GetOpDef(node_def.Op); + if (node_def.Name.Equals("learn_rate/cond/pred_id")) + { + + } + var grouped_inputs = _reconstruct_sequence_inputs(op_def, inputs, node_def.Attr); _handle = ops._create_c_op(g, node_def, grouped_inputs, control_input_ops.ToArray()); _is_stateful = op_def.IsStateful; diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index 7e54349f..e4a8d175 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -629,9 +629,9 @@ namespace Tensorflow public static Tensor _abs(Tensor x, string name = null) { - var _op = _op_def_lib._apply_op_helper("Abs", name, new { x }); + var _op = _op_def_lib._apply_op_helper("Abs", name, args: new { x }); - return _op.outputs[0]; + return _op.output; } public static Tensor _any(Tx input, Ty axis, bool keep_dims = false, string name = null) @@ -662,14 +662,7 @@ namespace Tensorflow return _op.outputs[0]; } - public static Tensor _sum(Tensor input, Tensor axis = null, bool keep_dims = false, string name = null) - { - var _op = _op_def_lib._apply_op_helper("Sum", name, args: new { input, reduction_indices = axis, keep_dims }); - - return _op.outputs[0]; - } - - public static Tensor _sum(Tensor input, int axis, bool keep_dims = false, string name = null) + public static Tensor _sum(Tx input, Ty axis = default, bool keep_dims = false, string name = null) { var _op = _op_def_lib._apply_op_helper("Sum", name, args: new { input, reduction_indices = axis, keep_dims }); diff --git a/src/TensorFlowNET.Core/Operations/math_ops.cs b/src/TensorFlowNET.Core/Operations/math_ops.cs index f158ffb1..fd73dd0f 100644 --- a/src/TensorFlowNET.Core/Operations/math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/math_ops.cs @@ -31,6 +31,7 @@ namespace Tensorflow { return tf_with(ops.name_scope(name, "Abs", new { x }), scope => { + name = scope; x = ops.convert_to_tensor(x, name: "x"); if (x.dtype.is_complex()) throw new NotImplementedException("math_ops.abs for dtype.is_complex"); @@ -379,6 +380,13 @@ namespace Tensorflow return _may_reduce_to_scalar(keepdims, axis, max); } + public static Tensor reduce_max(Tensor input_tensor, int axis, bool keepdims = false, string name = null) + { + var r = _ReductionDims(input_tensor, axis); + var max = gen_math_ops._max(input_tensor, r, keepdims, name); + return _may_reduce_to_scalar(keepdims, axis, max); + } + public static Tensor reduce_min(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null) { var r = _ReductionDims(input_tensor, axis); @@ -434,15 +442,14 @@ namespace Tensorflow public static Tensor reduce_sum(Tensor input_tensor, int[] axis, bool keepdims = false, string name = null) { - var r = _ReductionDims(input_tensor, axis); - var m = gen_math_ops._sum(input_tensor, r, keep_dims: keepdims, name: name); + var m = gen_math_ops._sum(input_tensor, axis, keep_dims: keepdims, name: name); return _may_reduce_to_scalar(keepdims, axis, m); } public static Tensor reduce_sum(Tensor input_tensor, int axis, bool keepdims = false, string name = null) { var m = gen_math_ops._sum(input_tensor, axis, keep_dims: keepdims, name: name); - return _may_reduce_to_scalar(keepdims, new int[] { axis }, m); + return _may_reduce_to_scalar(keepdims, axis, m); } private static Tensor _may_reduce_to_scalar(bool keepdims, Tensor axis, Tensor output) @@ -464,6 +471,11 @@ namespace Tensorflow return output; } + private static Tensor _may_reduce_to_scalar(bool keepdims, int axis, Tensor output) + { + return output; + } + private static Tensor _ReductionDims(Tensor x, Tensor axis) { if (axis != null) @@ -477,6 +489,11 @@ namespace Tensorflow } } + private static int _ReductionDims(Tensor x, int axis) + { + return axis; + } + private static Tensor _ReductionDims(Tensor x, int[] axis) { if (axis != null) diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs index 2a901e07..b205674d 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Operators.cs @@ -328,18 +328,16 @@ namespace Tensorflow switch (name.ToLowerInvariant()) { case "add": - result = gen_math_ops.add(x1, y1, name: scope); + result = math_ops.add(x1, y1, name: scope); break; case "div": - result = _intTfDataTypes.Contains(x1.dtype) || _intTfDataTypes.Contains(y1.dtype) - ? gen_math_ops.floor_div(x1, y1, name: scope) - : gen_math_ops.real_div(x1, y1, name: scope); + result = math_ops.div(x1, y1, name: scope); break; case "floordiv": result = gen_math_ops.floor_div(x1, y1, name: scope); break; case "truediv": - result = gen_math_ops.real_div(x1, y1, name: scope); + result = math_ops.truediv(x1, y1, name: scope); break; case "mul": result = gen_math_ops.mul(x1, y1, name: scope); From 884b9687ae480fb665f2e08a465238f5e87bd58e Mon Sep 17 00:00:00 2001 From: "Mascha, Philipp" Date: Tue, 12 Nov 2019 10:51:48 +0100 Subject: [PATCH 08/24] Added the crop and resize method from the c++ library. --- .../Operations/image_ops_impl.cs | 49 +++++++++++------ .../img_test/TestCrop.cs | 53 +++++++++++++++++++ 2 files changed, 86 insertions(+), 16 deletions(-) create mode 100644 test/TensorFlowNET.UnitTest/img_test/TestCrop.cs diff --git a/src/TensorFlowNET.Core/Operations/image_ops_impl.cs b/src/TensorFlowNET.Core/Operations/image_ops_impl.cs index b7573b92..fd252790 100644 --- a/src/TensorFlowNET.Core/Operations/image_ops_impl.cs +++ b/src/TensorFlowNET.Core/Operations/image_ops_impl.cs @@ -14,9 +14,11 @@ limitations under the License. ******************************************************************************/ +using NumSharp; using System; using System.Collections.Generic; using System.Text; +using Tensorflow.Operations; using static Tensorflow.Binding; namespace Tensorflow @@ -102,6 +104,37 @@ namespace Tensorflow }); } + internal static Tensor resize_images(Tensor images, Tensor size, ResizeMethod method, bool align_corners, bool preserve_aspect_ratio, string name) + { + throw new NotImplementedException(); + } + + /// + /// Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a common output size specified by crop_size. + /// This is more general than the crop_to_bounding_box op which extracts a fixed size slice from the input image and does not allow resizing or aspect ratio change. + /// Returns a tensor with crops from the input image at positions defined at the bounding box locations in boxes. + /// The cropped boxes are all resized(with bilinear or nearest neighbor interpolation) to a fixed size = [crop_height, crop_width]. + /// The result is a 4 - D tensor[num_boxes, crop_height, crop_width, depth]. + /// The resizing is corner aligned. In particular, if boxes = [[0, 0, 1, 1]], the method will give identical results to using tf.image.resize_bilinear() or tf.image.resize_nearest_neighbor() (depends on the method argument) with align_corners = True. + /// + /// A 4-D tensor of shape [batch, image_height, image_width, depth]. Both image_height and image_width need to be positive. + /// A 2-D tensor of shape [num_boxes, 4]. The i-th row of the tensor specifies the coordinates of a box in the box_ind[i] image and is specified in normalized coordinates [y1, x1, y2, x2]. A normalized coordinate value of y is mapped to the image coordinate at y * (image_height - 1), so as the [0, 1] interval of normalized image height is mapped to [0, image_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the [0, 1] range are allowed, in which case we use extrapolation_value to extrapolate the input image values. + /// A 1-D tensor of shape [num_boxes] with int32 values in [0, batch). The value of box_ind[i] specifies the image that the i-th box refers to. + /// A 1-D tensor of 2 elements, size = [crop_height, crop_width]. All cropped image patches are resized to this size. The aspect ratio of the image content is not preserved. Both crop_height and crop_width need to be positive. + /// A 4-D tensor of shape [num_boxes, crop_height, crop_width, depth]. + public static Tensor CropAndResize(Tensor image, Tensor boxes, Tensor box_ind, Tensor crop_size) + { + var _op = gen_nn_ops._op_def_lib._apply_op_helper("CropAndResize", name: null, args: new + { + image, + boxes, + box_ind, + crop_size + }); + + return _op.outputs[0]; + } + public static Tensor is_jpeg(Tensor contents, string name = null) { return tf_with(ops.name_scope(name, "is_jpeg"), scope => @@ -129,22 +162,6 @@ namespace Tensorflow throw new NotImplementedException(""); } - /// - /// Resize `images` to `size` using the specified `method`. - /// - /// - /// - /// - /// - /// - /// - /// - public static Tensor resize_images(Tensor images, Tensor size, ResizeMethod method = ResizeMethod.BILINEAR, - bool align_corners = false, bool preserve_aspect_ratio = false, string name = null) - { - throw new NotImplementedException(""); - } - /// /// Resize `images` to `size` using nearest neighbor interpolation. /// diff --git a/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs b/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs new file mode 100644 index 00000000..51ab2cd3 --- /dev/null +++ b/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs @@ -0,0 +1,53 @@ +using FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NumSharp; +using Tensorflow; +using static Tensorflow.Binding; + +namespace TensorFlowNET.UnitTest.img_test +{ + [TestClass] + public class TestCrop + { + + [TestMethod] + public void TestCropAndResize() + { + // 3x3 'Image' with numbered coordinates + var input = np.array(0f, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f); + var image = tf.reshape(input, new int[] { 1, 3, 3, 1 }); + + // 4x4 'Image' with numbered coordinates + var input2 = np.array(0f, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f, 10f, 11f, 12f, 13f, 14f, 15f); + var image2 = tf.reshape(input2, new int[] { 1, 4, 4, 1 }); + // create one box over the full image that flips it (y1 > y2) + var box = tf.reshape(np.array(1f, 0f, 0f, 1f), new int[] {1, 4}); + var boxInd = tf.Variable(np.array(0)); + // crop first 3x3 imageto size 1x1 + var cropSize1_1 = tf.Variable(np.array(1, 1)); + // don't crop second 4x4 image + var cropSize2_2 = tf.Variable(np.array(4, 4)); + + var init = tf.global_variables_initializer(); + using (Session sess = tf.Session()) + { + sess.run(init); + + var cropped = image_ops_impl.CropAndResize(image, box, boxInd, cropSize1_1); + + var result = sess.run(cropped); + // check if cropped to 1x1 center was succesfull + result.size.Should().Be(1); + result[0, 0, 0, 0].Should().Be(4f); + + cropped = image_ops_impl.CropAndResize(image2, box, boxInd, cropSize2_2); + result = sess.run(cropped); + // check if flipped and no cropping occured + result.size.Should().Be(16); + result[0, 0, 0, 0].Should().Be(12f); + } + + } + + } +} From 0c06559b5623a4de6e4fe6facf2d63d3ab044d76 Mon Sep 17 00:00:00 2001 From: "Mascha, Philipp" Date: Tue, 12 Nov 2019 14:28:16 +0100 Subject: [PATCH 09/24] Changed method name to Python one. --- src/TensorFlowNET.Core/APIs/tf.image.cs | 16 ++++++++++++++ .../Operations/image_ops_impl.cs | 22 +++++-------------- .../img_test/TestCrop.cs | 5 +++-- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.image.cs b/src/TensorFlowNET.Core/APIs/tf.image.cs index 57b8b093..9263338d 100644 --- a/src/TensorFlowNET.Core/APIs/tf.image.cs +++ b/src/TensorFlowNET.Core/APIs/tf.image.cs @@ -37,6 +37,22 @@ namespace Tensorflow fancy_upscaling: fancy_upscaling, try_recover_truncated: try_recover_truncated, acceptable_fraction: acceptable_fraction, dct_method: dct_method); + /// + /// Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a common output size specified by crop_size. This is more general than the crop_to_bounding_box op which extracts a fixed size slice from the input image and does not allow resizing or aspect ratio change. + /// Returns a tensor with crops from the input image at positions defined at the bounding box locations in boxes.The cropped boxes are all resized(with bilinear or nearest neighbor interpolation) to a fixed size = [crop_height, crop_width].The result is a 4 - D tensor[num_boxes, crop_height, crop_width, depth].The resizing is corner aligned. In particular, if boxes = [[0, 0, 1, 1]], the method will give identical results to using tf.image.resize_bilinear() or tf.image.resize_nearest_neighbor() (depends on the method argument) with align_corners = True. + /// + /// A Tensor. Must be one of the following types: uint8, uint16, int8, int16, int32, int64, half, float32, float64. A 4-D tensor of shape [batch, image_height, image_width, depth]. Both image_height and image_width need to be positive. + /// A Tensor of type float32. A 2-D tensor of shape [num_boxes, 4]. The i-th row of the tensor specifies the coordinates of a box in the box_ind[i] image and is specified in normalized coordinates [y1, x1, y2, x2]. A normalized coordinate value of y is mapped to the image coordinate at y * (image_height - 1), so as the [0, 1] interval of normalized image height is mapped to [0, image_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the [0, 1] range are allowed, in which case we use extrapolation_value to extrapolate the input image values. + /// A Tensor of type int32. A 1-D tensor of shape [num_boxes] with int32 values in [0, batch). The value of box_ind[i] specifies the image that the i-th box refers to. + /// A Tensor of type int32. A 1-D tensor of 2 elements, size = [crop_height, crop_width]. All cropped image patches are resized to this size. The aspect ratio of the image content is not preserved. Both crop_height and crop_width need to be positive. + /// An optional string from: "bilinear", "nearest". Defaults to "bilinear". A string specifying the sampling method for resizing. It can be either "bilinear" or "nearest" and default to "bilinear". Currently two sampling methods are supported: Bilinear and Nearest Neighbor. + /// An optional float. Defaults to 0. Value used for extrapolation, when applicable. + /// A name for the operation (optional). + /// + public Tensor crop_and_resize(Tensor image, Tensor boxes, Tensor box_ind, Tensor crop_size, string method = "bilinear", float extrapolation_value = 0f, string name = null) => + image_ops_impl.crop_and_resize(image, boxes, box_ind, crop_size, method, extrapolation_value, name); + + public Tensor resize_bilinear(Tensor images, Tensor size, bool align_corners = false, string name = null) => gen_image_ops.resize_bilinear(images, size, align_corners: align_corners, name: name); diff --git a/src/TensorFlowNET.Core/Operations/image_ops_impl.cs b/src/TensorFlowNET.Core/Operations/image_ops_impl.cs index fd252790..c09fd0ab 100644 --- a/src/TensorFlowNET.Core/Operations/image_ops_impl.cs +++ b/src/TensorFlowNET.Core/Operations/image_ops_impl.cs @@ -109,27 +109,17 @@ namespace Tensorflow throw new NotImplementedException(); } - /// - /// Extracts crops from the input image tensor and resizes them using bilinear sampling or nearest neighbor sampling (possibly with aspect ratio change) to a common output size specified by crop_size. - /// This is more general than the crop_to_bounding_box op which extracts a fixed size slice from the input image and does not allow resizing or aspect ratio change. - /// Returns a tensor with crops from the input image at positions defined at the bounding box locations in boxes. - /// The cropped boxes are all resized(with bilinear or nearest neighbor interpolation) to a fixed size = [crop_height, crop_width]. - /// The result is a 4 - D tensor[num_boxes, crop_height, crop_width, depth]. - /// The resizing is corner aligned. In particular, if boxes = [[0, 0, 1, 1]], the method will give identical results to using tf.image.resize_bilinear() or tf.image.resize_nearest_neighbor() (depends on the method argument) with align_corners = True. - /// - /// A 4-D tensor of shape [batch, image_height, image_width, depth]. Both image_height and image_width need to be positive. - /// A 2-D tensor of shape [num_boxes, 4]. The i-th row of the tensor specifies the coordinates of a box in the box_ind[i] image and is specified in normalized coordinates [y1, x1, y2, x2]. A normalized coordinate value of y is mapped to the image coordinate at y * (image_height - 1), so as the [0, 1] interval of normalized image height is mapped to [0, image_height - 1] in image height coordinates. We do allow y1 > y2, in which case the sampled crop is an up-down flipped version of the original image. The width dimension is treated similarly. Normalized coordinates outside the [0, 1] range are allowed, in which case we use extrapolation_value to extrapolate the input image values. - /// A 1-D tensor of shape [num_boxes] with int32 values in [0, batch). The value of box_ind[i] specifies the image that the i-th box refers to. - /// A 1-D tensor of 2 elements, size = [crop_height, crop_width]. All cropped image patches are resized to this size. The aspect ratio of the image content is not preserved. Both crop_height and crop_width need to be positive. - /// A 4-D tensor of shape [num_boxes, crop_height, crop_width, depth]. - public static Tensor CropAndResize(Tensor image, Tensor boxes, Tensor box_ind, Tensor crop_size) + + public static Tensor crop_and_resize(Tensor image, Tensor boxes, Tensor box_ind, Tensor crop_size, string method, float extrapolation_value, string name) { - var _op = gen_nn_ops._op_def_lib._apply_op_helper("CropAndResize", name: null, args: new + var _op = gen_nn_ops._op_def_lib._apply_op_helper("CropAndResize", name: name, args: new { image, boxes, box_ind, - crop_size + crop_size, + method, + extrapolation_value }); return _op.outputs[0]; diff --git a/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs b/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs index 51ab2cd3..115c74db 100644 --- a/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs +++ b/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs @@ -33,18 +33,19 @@ namespace TensorFlowNET.UnitTest.img_test { sess.run(init); - var cropped = image_ops_impl.CropAndResize(image, box, boxInd, cropSize1_1); + var cropped = tf.image.crop_and_resize(image, box, boxInd, cropSize1_1); var result = sess.run(cropped); // check if cropped to 1x1 center was succesfull result.size.Should().Be(1); result[0, 0, 0, 0].Should().Be(4f); - cropped = image_ops_impl.CropAndResize(image2, box, boxInd, cropSize2_2); + cropped = tf.image.crop_and_resize(image2, box, boxInd, cropSize2_2); result = sess.run(cropped); // check if flipped and no cropping occured result.size.Should().Be(16); result[0, 0, 0, 0].Should().Be(12f); + } } From 6aa9b8beb7676cb05d9a818a080dbd063c76e2c6 Mon Sep 17 00:00:00 2001 From: "Mascha, Philipp" Date: Tue, 12 Nov 2019 14:31:16 +0100 Subject: [PATCH 10/24] Added missing documenation. --- src/TensorFlowNET.Core/APIs/tf.image.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.image.cs b/src/TensorFlowNET.Core/APIs/tf.image.cs index 9263338d..13fd678f 100644 --- a/src/TensorFlowNET.Core/APIs/tf.image.cs +++ b/src/TensorFlowNET.Core/APIs/tf.image.cs @@ -48,7 +48,7 @@ namespace Tensorflow /// An optional string from: "bilinear", "nearest". Defaults to "bilinear". A string specifying the sampling method for resizing. It can be either "bilinear" or "nearest" and default to "bilinear". Currently two sampling methods are supported: Bilinear and Nearest Neighbor. /// An optional float. Defaults to 0. Value used for extrapolation, when applicable. /// A name for the operation (optional). - /// + /// A 4-D tensor of shape [num_boxes, crop_height, crop_width, depth]. public Tensor crop_and_resize(Tensor image, Tensor boxes, Tensor box_ind, Tensor crop_size, string method = "bilinear", float extrapolation_value = 0f, string name = null) => image_ops_impl.crop_and_resize(image, boxes, box_ind, crop_size, method, extrapolation_value, name); From 98ead99733b739baa9cb7b5ba96bfc8c901da5f8 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 13 Nov 2019 09:38:15 -0600 Subject: [PATCH 11/24] remove Models and Hub projects. --- TensorFlow.NET.sln | 108 +- src/KerasNET.Core/Keras.Core.csproj | 2 +- src/TensorFlowNET.Core/APIs/tf.estimator.cs | 14 +- src/TensorFlowNET.Core/Binding.FuncTools.cs | 20 + src/TensorFlowNET.Core/Binding.Util.cs | 10 - .../Estimators/Estimator.cs | 29 +- .../Estimators/EstimatorSpec.cs | 16 + .../Estimators/Experimental.cs | 61 + src/TensorFlowNET.Core/Estimators/Exporter.cs | 4 +- .../Estimators/IEstimatorInputs.cs | 12 + .../Estimators/RunConfig.cs | 6 +- src/TensorFlowNET.Core/Estimators/Training.cs | 4 +- .../Estimators/_Evaluator.cs | 4 +- .../_NewCheckpointListenerForEvaluate.cs | 6 +- .../Estimators/_SavedModelExporter.cs | 4 +- .../Estimators/_TrainingExecutor.cs | 10 +- ....Core.csproj => TensorFlow.Binding.csproj} | 12 +- src/TensorFlowNET.Datasets/DatasetBuilder.cs | 24 - src/TensorFlowNET.Datasets/DownloadConfig.cs | 10 - .../TensorFlowNET.Datasets.csproj | 21 - src/TensorFlowNET.Hub/DataSetBase.cs | 13 - src/TensorFlowNET.Hub/Datasets.cs | 46 - src/TensorFlowNET.Hub/IDataSet.cs | 13 - src/TensorFlowNET.Hub/IModelLoader.cs | 14 - src/TensorFlowNET.Hub/MnistDataSet.cs | 86 - src/TensorFlowNET.Hub/MnistModelLoader.cs | 184 - src/TensorFlowNET.Hub/ModelLoadSetting.cs | 20 - src/TensorFlowNET.Hub/README.md | 5 - .../TensorFlowNET.Hub.csproj | 23 - src/TensorFlowNET.Hub/Utils.cs | 137 - .../AnchorGenerators/GridAnchorGenerator.cs | 15 - .../Builders/AnchorGeneratorBuilder.cs | 27 - .../Builders/BoxPredictorBuilder.cs | 15 - .../Builders/DatasetBuilder.cs | 30 - .../Builders/ImageResizerBuilder.cs | 65 - .../ObjectDetection/Builders/ModelBuilder.cs | 89 - .../ObjectDetection/Core/AnchorGenerator.cs | 10 - .../ObjectDetection/Core/DetectionModel.cs | 10 - .../ObjectDetection/Core/Preprocessor.cs | 69 - .../ObjectDetection/Core/ResizeToRangeArgs.cs | 18 - .../Entities/TrainAndEvalDict.cs | 19 - .../ObjectDetection/Inputs.cs | 60 - .../FasterRCNNFeatureExtractor.cs | 31 - .../MetaArchitectures/FasterRCNNInitArgs.cs | 20 - .../MetaArchitectures/FasterRCNNMetaArch.cs | 42 - .../ObjectDetection/ModelLib.cs | 77 - .../FasterRCNNResnet101FeatureExtractor.cs | 32 - .../FasterRCNNResnetV1FeatureExtractor.cs | 28 - .../Models/faster_rcnn_resnet101_voc07.config | 133 - .../Predictors/ConvolutionalBoxPredictor.cs | 10 - .../ObjectDetection/Protos/AnchorGenerator.cs | 343 - .../ObjectDetection/Protos/ArgmaxMatcher.cs | 343 - .../Protos/BipartiteMatcher.cs | 181 - .../ObjectDetection/Protos/BoxCoder.cs | 341 - .../ObjectDetection/Protos/BoxPredictor.cs | 2587 ----- .../ObjectDetection/Protos/Calibration.cs | 1413 --- .../ObjectDetection/Protos/Eval.cs | 901 -- .../ObjectDetection/Protos/FasterRcnn.cs | 1592 --- .../Protos/FasterRcnnBoxCoder.cs | 272 - .../Protos/FlexibleGridAnchorGenerator.cs | 476 - .../ObjectDetection/Protos/GraphRewriter.cs | 417 - .../Protos/GridAnchorGenerator.cs | 386 - .../ObjectDetection/Protos/Hyperparams.cs | 2106 ---- .../ObjectDetection/Protos/ImageResizer.cs | 1255 --- .../ObjectDetection/Protos/InputReader.cs | 1225 --- .../Protos/KeypointBoxCoder.cs | 300 - .../ObjectDetection/Protos/Losses.cs | 3009 ------ .../ObjectDetection/Protos/Matcher.cs | 257 - .../Protos/MeanStddevBoxCoder.cs | 180 - .../ObjectDetection/Protos/Model.cs | 255 - .../Protos/MultiscaleAnchorGenerator.cs | 332 - .../ObjectDetection/Protos/Optimizer.cs | 2231 ----- .../ObjectDetection/Protos/Pipeline.cs | 352 - .../ObjectDetection/Protos/PostProcessing.cs | 685 -- .../ObjectDetection/Protos/Preprocessor.cs | 8697 ----------------- .../Protos/RegionSimilarityCalculator.cs | 791 -- .../ObjectDetection/Protos/SquareBoxCoder.cs | 240 - .../ObjectDetection/Protos/Ssd.cs | 2028 ---- .../Protos/SsdAnchorGenerator.cs | 526 - .../Protos/StringIntLabelMap.cs | 365 - .../ObjectDetection/Protos/Train.cs | 1020 -- .../ObjectDetection/Utils/ConfigUtil.cs | 101 - .../Slim/Nets/ResNetV1.cs | 14 - .../TensorFlowNET.Models.csproj | 37 - src/TensorFlowNET.Text/README.md | 9 - .../TensorFlowNET.Text.csproj | 22 - src/TensorFlowNET.Text/Tokenizer.cs | 8 - src/TensorFlowNet.Benchmarks/Benchmark.csproj | 21 + src/TensorFlowNet.Benchmarks/Program.cs | 29 + .../TensorBenchmark.cs | 88 + .../Unmanaged/StructCastBenchmark.cs | 76 + .../Hub/MnistModelLoaderTest.cs | 24 - ...lowNET.UnitTest.csproj => UnitTest.csproj} | 6 +- 93 files changed, 420 insertions(+), 36839 deletions(-) create mode 100644 src/TensorFlowNET.Core/Binding.FuncTools.cs create mode 100644 src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs create mode 100644 src/TensorFlowNET.Core/Estimators/Experimental.cs create mode 100644 src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs rename src/TensorFlowNET.Core/{TensorFlowNET.Core.csproj => TensorFlow.Binding.csproj} (87%) delete mode 100644 src/TensorFlowNET.Datasets/DatasetBuilder.cs delete mode 100644 src/TensorFlowNET.Datasets/DownloadConfig.cs delete mode 100644 src/TensorFlowNET.Datasets/TensorFlowNET.Datasets.csproj delete mode 100644 src/TensorFlowNET.Hub/DataSetBase.cs delete mode 100644 src/TensorFlowNET.Hub/Datasets.cs delete mode 100644 src/TensorFlowNET.Hub/IDataSet.cs delete mode 100644 src/TensorFlowNET.Hub/IModelLoader.cs delete mode 100644 src/TensorFlowNET.Hub/MnistDataSet.cs delete mode 100644 src/TensorFlowNET.Hub/MnistModelLoader.cs delete mode 100644 src/TensorFlowNET.Hub/ModelLoadSetting.cs delete mode 100644 src/TensorFlowNET.Hub/README.md delete mode 100644 src/TensorFlowNET.Hub/TensorFlowNET.Hub.csproj delete mode 100644 src/TensorFlowNET.Hub/Utils.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/AnchorGenerators/GridAnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Builders/AnchorGeneratorBuilder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Builders/BoxPredictorBuilder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Builders/DatasetBuilder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Builders/ImageResizerBuilder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Builders/ModelBuilder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Core/AnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Core/DetectionModel.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Core/Preprocessor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Core/ResizeToRangeArgs.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Entities/TrainAndEvalDict.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Inputs.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNFeatureExtractor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNInitArgs.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNMetaArch.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/ModelLib.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnet101FeatureExtractor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnetV1FeatureExtractor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Models/faster_rcnn_resnet101_voc07.config delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Predictors/ConvolutionalBoxPredictor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Matcher.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/MeanStddevBoxCoder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Model.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/MultiscaleAnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Optimizer.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Pipeline.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/PostProcessing.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Preprocessor.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/RegionSimilarityCalculator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/SquareBoxCoder.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Ssd.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/SsdAnchorGenerator.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/StringIntLabelMap.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Protos/Train.cs delete mode 100644 src/TensorFlowNET.Models/ObjectDetection/Utils/ConfigUtil.cs delete mode 100644 src/TensorFlowNET.Models/Slim/Nets/ResNetV1.cs delete mode 100644 src/TensorFlowNET.Models/TensorFlowNET.Models.csproj delete mode 100644 src/TensorFlowNET.Text/README.md delete mode 100644 src/TensorFlowNET.Text/TensorFlowNET.Text.csproj delete mode 100644 src/TensorFlowNET.Text/Tokenizer.cs create mode 100644 src/TensorFlowNet.Benchmarks/Benchmark.csproj create mode 100644 src/TensorFlowNet.Benchmarks/Program.cs create mode 100644 src/TensorFlowNet.Benchmarks/TensorBenchmark.cs create mode 100644 src/TensorFlowNet.Benchmarks/Unmanaged/StructCastBenchmark.cs delete mode 100644 test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs rename test/TensorFlowNET.UnitTest/{TensorFlowNET.UnitTest.csproj => UnitTest.csproj} (78%) diff --git a/TensorFlow.NET.sln b/TensorFlow.NET.sln index 9eaf8143..47258dc6 100644 --- a/TensorFlow.NET.sln +++ b/TensorFlow.NET.sln @@ -3,17 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29102.190 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.UnitTest", "test\TensorFlowNET.UnitTest\TensorFlowNET.UnitTest.csproj", "{029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlow.Binding", "src\TensorFlowNET.Core\TensorFlow.Binding.csproj", "{FD682AC0-7B2D-45D3-8B0D-C6D678B04144}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Core", "src\TensorFlowNET.Core\TensorFlowNET.Core.csproj", "{FD682AC0-7B2D-45D3-8B0D-C6D678B04144}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Keras.Core", "src\KerasNET.Core\Keras.Core.csproj", "{4A341A02-F595-4A2A-B671-D7591FC65CA7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Models", "src\TensorFlowNET.Models\TensorFlowNET.Models.csproj", "{D03F94CF-B283-4730-B177-21A57641061F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmark", "src\TensorFlowNet.Benchmarks\Benchmark.csproj", "{3A6EB896-604F-4E25-B677-B8103BCF3D2E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Text", "src\TensorFlowNET.Text\TensorFlowNET.Text.csproj", "{904472F8-40E1-4650-AA6F-C7F209B3691B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Hub", "src\TensorFlowNET.Hub\TensorFlowNET.Hub.csproj", "{4EAFAE19-C832-47C6-B01E-0F4268C9072C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowNET.Datasets", "src\TensorFlowNET.Datasets\TensorFlowNET.Datasets.csproj", "{494D6CAD-2C0D-4C0B-90E2-B097DB039383}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\TensorFlowNET.UnitTest\UnitTest.csproj", "{23C28035-2FCE-41F3-9A12-E73CE8A5AE32}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -25,18 +21,6 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Debug|x64.ActiveCfg = Debug|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Debug|x64.Build.0 = Debug|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Publish|Any CPU.ActiveCfg = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Publish|Any CPU.Build.0 = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Publish|x64.ActiveCfg = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Publish|x64.Build.0 = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Release|Any CPU.Build.0 = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Release|x64.ActiveCfg = Release|Any CPU - {029A8CF1-CF95-4DCB-98AA-9D3D96A83B3E}.Release|x64.Build.0 = Release|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Debug|Any CPU.Build.0 = Debug|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -49,54 +33,42 @@ Global {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Release|Any CPU.Build.0 = Release|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Release|x64.ActiveCfg = Release|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Release|x64.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}.Debug|x64.ActiveCfg = Debug|Any CPU - {D03F94CF-B283-4730-B177-21A57641061F}.Debug|x64.Build.0 = Debug|Any CPU - {D03F94CF-B283-4730-B177-21A57641061F}.Publish|Any CPU.ActiveCfg = Release|Any CPU - {D03F94CF-B283-4730-B177-21A57641061F}.Publish|Any CPU.Build.0 = Release|Any CPU - {D03F94CF-B283-4730-B177-21A57641061F}.Publish|x64.ActiveCfg = Release|Any CPU - {D03F94CF-B283-4730-B177-21A57641061F}.Publish|x64.Build.0 = Release|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 - {D03F94CF-B283-4730-B177-21A57641061F}.Release|x64.ActiveCfg = Release|Any CPU - {D03F94CF-B283-4730-B177-21A57641061F}.Release|x64.Build.0 = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Debug|x64.ActiveCfg = Debug|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Debug|x64.Build.0 = Debug|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Publish|Any CPU.ActiveCfg = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Publish|Any CPU.Build.0 = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Publish|x64.ActiveCfg = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Publish|x64.Build.0 = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Release|Any CPU.Build.0 = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Release|x64.ActiveCfg = Release|Any CPU - {904472F8-40E1-4650-AA6F-C7F209B3691B}.Release|x64.Build.0 = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Debug|x64.ActiveCfg = Debug|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Debug|x64.Build.0 = Debug|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Publish|Any CPU.ActiveCfg = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Publish|Any CPU.Build.0 = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Publish|x64.ActiveCfg = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Publish|x64.Build.0 = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Release|Any CPU.Build.0 = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Release|x64.ActiveCfg = Release|Any CPU - {4EAFAE19-C832-47C6-B01E-0F4268C9072C}.Release|x64.Build.0 = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Debug|Any CPU.Build.0 = Debug|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Debug|x64.ActiveCfg = Debug|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Debug|x64.Build.0 = Debug|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Publish|Any CPU.ActiveCfg = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Publish|Any CPU.Build.0 = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Publish|x64.ActiveCfg = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Publish|x64.Build.0 = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|Any CPU.ActiveCfg = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|Any CPU.Build.0 = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|x64.ActiveCfg = Release|Any CPU - {494D6CAD-2C0D-4C0B-90E2-B097DB039383}.Release|x64.Build.0 = Release|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|x64.ActiveCfg = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|x64.Build.0 = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|Any CPU.ActiveCfg = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|Any CPU.Build.0 = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|x64.ActiveCfg = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|x64.Build.0 = Debug|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|Any CPU.Build.0 = Release|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|x64.ActiveCfg = Release|Any CPU + {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|x64.Build.0 = Release|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|x64.ActiveCfg = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|x64.Build.0 = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Publish|Any CPU.ActiveCfg = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Publish|Any CPU.Build.0 = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Publish|x64.ActiveCfg = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Publish|x64.Build.0 = Debug|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Release|Any CPU.Build.0 = Release|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Release|x64.ActiveCfg = Release|Any CPU + {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Release|x64.Build.0 = Release|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Debug|x64.ActiveCfg = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Debug|x64.Build.0 = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Publish|Any CPU.ActiveCfg = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Publish|Any CPU.Build.0 = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Publish|x64.ActiveCfg = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Publish|x64.Build.0 = Debug|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Release|Any CPU.Build.0 = Release|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Release|x64.ActiveCfg = Release|Any CPU + {23C28035-2FCE-41F3-9A12-E73CE8A5AE32}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/KerasNET.Core/Keras.Core.csproj b/src/KerasNET.Core/Keras.Core.csproj index 3a7cfc6b..5c3895d1 100644 --- a/src/KerasNET.Core/Keras.Core.csproj +++ b/src/KerasNET.Core/Keras.Core.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/TensorFlowNET.Core/APIs/tf.estimator.cs b/src/TensorFlowNET.Core/APIs/tf.estimator.cs index 3cabfdf4..15668837 100644 --- a/src/TensorFlowNET.Core/APIs/tf.estimator.cs +++ b/src/TensorFlowNET.Core/APIs/tf.estimator.cs @@ -27,13 +27,17 @@ namespace Tensorflow public class Estimator_Internal { - public Estimator Estimator(Action model_fn, RunConfig config) - => new Estimator(model_fn: model_fn, config: config); + public Experimental experimental { get; } = new Experimental(); + public Estimator Estimator(Func model_fn, + string model_dir = null, + RunConfig config = null, + Thyp hyperParams = default) + => new Estimator(model_fn: model_fn, model_dir: model_dir, config: config, hyperParams: hyperParams); - public RunConfig RunConfig(string model_dir) - => new RunConfig(model_dir: model_dir); + public RunConfig RunConfig(string model_dir = null, int save_checkpoints_secs = 180) + => new RunConfig(model_dir: model_dir, save_checkpoints_secs: save_checkpoints_secs); - public void train_and_evaluate(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) + public void train_and_evaluate(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) => Training.train_and_evaluate(estimator: estimator, train_spec: train_spec, eval_spec: eval_spec); public TrainSpec TrainSpec(Func input_fn, int max_steps) diff --git a/src/TensorFlowNET.Core/Binding.FuncTools.cs b/src/TensorFlowNET.Core/Binding.FuncTools.cs new file mode 100644 index 00000000..fb038005 --- /dev/null +++ b/src/TensorFlowNET.Core/Binding.FuncTools.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow +{ + public static partial class Binding + { + public static class functools + { + public static Func partial(Func func, Tin arg) + => (arg0) => func(arg0); + + public static Func partial(Func func, (Tin1, Tin2) args) + => (arg1, arg2) => func(arg1, arg2); + } + } +} diff --git a/src/TensorFlowNET.Core/Binding.Util.cs b/src/TensorFlowNET.Core/Binding.Util.cs index 34f227fc..ab7a1703 100644 --- a/src/TensorFlowNET.Core/Binding.Util.cs +++ b/src/TensorFlowNET.Core/Binding.Util.cs @@ -339,15 +339,5 @@ namespace Tensorflow return true; return false; } - - public static Func partial(Func func, Tin1 args) - { - Func newfunc = (args1) => - { - return func(args1); - }; - - return newfunc; - } } } diff --git a/src/TensorFlowNET.Core/Estimators/Estimator.cs b/src/TensorFlowNET.Core/Estimators/Estimator.cs index 5ba7a9c3..9ee9d122 100644 --- a/src/TensorFlowNET.Core/Estimators/Estimator.cs +++ b/src/TensorFlowNET.Core/Estimators/Estimator.cs @@ -12,7 +12,7 @@ namespace Tensorflow.Estimators /// /// Estimator class to train and evaluate TensorFlow models. /// - public class Estimator : IObjectLife + public class Estimator : IObjectLife { RunConfig _config; public RunConfig config => _config; @@ -20,24 +20,28 @@ namespace Tensorflow.Estimators ConfigProto _session_config; public ConfigProto session_config => _session_config; - string _model_dir; + Func _model_fn; - Action _model_fn; + Thyp _hyperParams; - public Estimator(Action model_fn, RunConfig config) + public Estimator(Func model_fn, + string model_dir, + RunConfig config, + Thyp hyperParams) { _config = config; - _model_dir = _config.model_dir; - _session_config = _config.session_config; + _config.model_dir = config.model_dir ?? model_dir; + _session_config = config.session_config; _model_fn = model_fn; + _hyperParams = hyperParams; } - public Estimator train(Func input_fn, int max_steps = 1, Action[] hooks = null, - _NewCheckpointListenerForEvaluate[] saving_listeners = null) + public Estimator train(Func input_fn, int max_steps = 1, Action[] hooks = null, + _NewCheckpointListenerForEvaluate[] saving_listeners = null) { if(max_steps > 0) { - var start_step = _load_global_step_from_checkpoint_dir(_model_dir); + var start_step = _load_global_step_from_checkpoint_dir(_config.model_dir); if (max_steps <= start_step) { Console.WriteLine("Skipping training since max_steps has already saved."); @@ -110,6 +114,11 @@ namespace Tensorflow.Estimators return tf.train.create_global_step(graph); } + public string eval_dir(string name = null) + { + return Path.Combine(config.model_dir, string.IsNullOrEmpty(name) ? "eval" : $"eval_" + name); + } + public void __init__() { throw new NotImplementedException(); @@ -132,7 +141,7 @@ namespace Tensorflow.Estimators public void Dispose() { - throw new NotImplementedException(); + } } } diff --git a/src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs b/src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs new file mode 100644 index 00000000..7b72f9db --- /dev/null +++ b/src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Estimators +{ + public class EstimatorSpec + { + public EstimatorSpec(Operation train_op) + { + + } + } +} diff --git a/src/TensorFlowNET.Core/Estimators/Experimental.cs b/src/TensorFlowNET.Core/Estimators/Experimental.cs new file mode 100644 index 00000000..9e377ffa --- /dev/null +++ b/src/TensorFlowNET.Core/Estimators/Experimental.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Estimators +{ + public class Experimental + { + /// + /// Creates hook to stop if metric does not increase within given max steps. + /// + /// type of hyper parameters + /// + /// + /// + /// + /// + /// + /// + /// + public object stop_if_no_increase_hook(Estimator estimator, + string metric_name, + int max_steps_without_increase, + string eval_dir = null, + int min_steps = 0, + int run_every_secs = 60, + int run_every_steps = 0) + => _stop_if_no_metric_improvement_hook(estimator: estimator, + metric_name: metric_name, + max_steps_without_increase: max_steps_without_increase, + eval_dir: eval_dir, + min_steps: min_steps, + run_every_secs: run_every_secs, + run_every_steps: run_every_steps); + + private object _stop_if_no_metric_improvement_hook(Estimator estimator, + string metric_name, + int max_steps_without_increase, + string eval_dir = null, + int min_steps = 0, + int run_every_secs = 60, + int run_every_steps = 0) + { + eval_dir = eval_dir ?? estimator.eval_dir(); + // var is_lhs_better = higher_is_better ? operator.gt: operator.lt; + Func stop_if_no_metric_improvement_fn = () => + { + return false; + }; + + return make_early_stopping_hook(); + } + + public object make_early_stopping_hook() + { + throw new NotImplementedException(""); + } + } +} diff --git a/src/TensorFlowNET.Core/Estimators/Exporter.cs b/src/TensorFlowNET.Core/Estimators/Exporter.cs index 2610458e..eca09730 100644 --- a/src/TensorFlowNET.Core/Estimators/Exporter.cs +++ b/src/TensorFlowNET.Core/Estimators/Exporter.cs @@ -4,8 +4,8 @@ using System.Text; namespace Tensorflow.Estimators { - public abstract class Exporter + public abstract class Exporter { - public abstract void export(Estimator estimator, string export_path, string checkpoint_path); + public abstract void export(Estimator estimator, string export_path, string checkpoint_path); } } diff --git a/src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs b/src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs new file mode 100644 index 00000000..fad00d7c --- /dev/null +++ b/src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Estimators +{ + public interface IEstimatorInputs + { + } +} diff --git a/src/TensorFlowNET.Core/Estimators/RunConfig.cs b/src/TensorFlowNET.Core/Estimators/RunConfig.cs index 37c7d4d1..8d2e0ad3 100644 --- a/src/TensorFlowNET.Core/Estimators/RunConfig.cs +++ b/src/TensorFlowNET.Core/Estimators/RunConfig.cs @@ -66,9 +66,11 @@ namespace Tensorflow.Estimators Initialize(); } - public RunConfig(string model_dir) + public RunConfig(string model_dir, + int save_checkpoints_secs) { - this.model_dir = model_dir; + this.model_dir = model_dir; + this.save_checkpoints_secs = save_checkpoints_secs; Initialize(); } diff --git a/src/TensorFlowNET.Core/Estimators/Training.cs b/src/TensorFlowNET.Core/Estimators/Training.cs index 930d57c9..8704e2a7 100644 --- a/src/TensorFlowNET.Core/Estimators/Training.cs +++ b/src/TensorFlowNET.Core/Estimators/Training.cs @@ -6,9 +6,9 @@ namespace Tensorflow.Estimators { public class Training { - public static void train_and_evaluate(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) + public static void train_and_evaluate(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) { - var executor = new _TrainingExecutor(estimator: estimator, train_spec: train_spec, eval_spec: eval_spec); + var executor = new _TrainingExecutor(estimator: estimator, train_spec: train_spec, eval_spec: eval_spec); var config = estimator.config; executor.run(); diff --git a/src/TensorFlowNET.Core/Estimators/_Evaluator.cs b/src/TensorFlowNET.Core/Estimators/_Evaluator.cs index bd0aa4be..190bb0e9 100644 --- a/src/TensorFlowNET.Core/Estimators/_Evaluator.cs +++ b/src/TensorFlowNET.Core/Estimators/_Evaluator.cs @@ -4,9 +4,9 @@ using System.Text; namespace Tensorflow.Estimators { - public class _Evaluator + public class _Evaluator { - public _Evaluator(Estimator estimator, EvalSpec eval_spec, int max_training_steps) + public _Evaluator(Estimator estimator, EvalSpec eval_spec, int max_training_steps) { } diff --git a/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs b/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs index 71464562..fe391a03 100644 --- a/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs +++ b/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs @@ -4,11 +4,11 @@ using System.Text; namespace Tensorflow.Estimators { - public class _NewCheckpointListenerForEvaluate + public class _NewCheckpointListenerForEvaluate { - _Evaluator _evaluator; + _Evaluator _evaluator; - public _NewCheckpointListenerForEvaluate(_Evaluator evaluator, int eval_throttle_secs) + public _NewCheckpointListenerForEvaluate(_Evaluator evaluator, int eval_throttle_secs) { _evaluator = evaluator; } diff --git a/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs b/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs index 9beb35ea..cce2e0c0 100644 --- a/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs +++ b/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs @@ -4,9 +4,9 @@ using System.Text; namespace Tensorflow.Estimators { - public class _SavedModelExporter : Exporter + public class _SavedModelExporter : Exporter { - public override void export(Estimator estimator, string export_path, string checkpoint_path) + public override void export(Estimator estimator, string export_path, string checkpoint_path) { } diff --git a/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs b/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs index e7ad6905..34b879d7 100644 --- a/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs +++ b/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs @@ -7,13 +7,13 @@ namespace Tensorflow.Estimators /// /// The executor to run `Estimator` training and evaluation. /// - internal class _TrainingExecutor + internal class _TrainingExecutor { - Estimator _estimator; + Estimator _estimator; EvalSpec _eval_spec; TrainSpec _train_spec; - public _TrainingExecutor(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) + public _TrainingExecutor(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) { _estimator = estimator; _train_spec = train_spec; @@ -37,8 +37,8 @@ namespace Tensorflow.Estimators "after every checkpoint. Checkpoint frequency is determined " + $"based on RunConfig arguments: save_checkpoints_steps {_estimator.config.save_checkpoints_steps} or " + $"save_checkpoints_secs {_estimator.config.save_checkpoints_secs}."); - var evaluator = new _Evaluator(_estimator, _eval_spec, _train_spec.max_steps); - var saving_listeners = new _NewCheckpointListenerForEvaluate[0]; + var evaluator = new _Evaluator(_estimator, _eval_spec, _train_spec.max_steps); + var saving_listeners = new _NewCheckpointListenerForEvaluate[0]; _estimator.train(input_fn: _train_spec.input_fn, max_steps: _train_spec.max_steps, hooks: train_hooks, diff --git a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj similarity index 87% rename from src/TensorFlowNET.Core/TensorFlowNET.Core.csproj rename to src/TensorFlowNET.Core/TensorFlow.Binding.csproj index b94203d2..42eb9d1c 100644 --- a/src/TensorFlowNET.Core/TensorFlowNET.Core.csproj +++ b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj @@ -5,7 +5,7 @@ TensorFlow.NET Tensorflow 1.14.1 - 0.12.0 + 0.12.1 Haiping Chen, Meinrad Recheis, Eli Belash SciSharp STACK true @@ -18,13 +18,14 @@ Google's TensorFlow full binding in .NET Standard. Building, training and infering deep learning models. https://tensorflownet.readthedocs.io - 0.12.0.0 + 0.12.1.0 Changes since v0.11.0: 1: Add ICanBeFlattened for nest.flatten2. 2: Complete the WhileContext. -3: Add tf.nn.rnn_cell.BasicRNNCell and tf.nn.dynamic_rnn. +3: Add tf.nn.rnn_cell.BasicRNNCell and tf.nn.dynamic_rnn. +4: Add EstimatorSpec. 7.3 - 0.12.0.0 + 0.12.1.0 LICENSE true true @@ -33,7 +34,7 @@ https://tensorflownet.readthedocs.io true - TRACE;DEBUG;SERIALIZABLE_ + TRACE;DEBUG;SERIALIZABLE @@ -56,6 +57,7 @@ https://tensorflownet.readthedocs.io + diff --git a/src/TensorFlowNET.Datasets/DatasetBuilder.cs b/src/TensorFlowNET.Datasets/DatasetBuilder.cs deleted file mode 100644 index bfb78d6e..00000000 --- a/src/TensorFlowNET.Datasets/DatasetBuilder.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; - -namespace TensorFlowDatasets -{ - /// - /// Abstract base class for all datasets. - /// - public class DatasetBuilder - { - /// - /// Downloads and prepares dataset for reading. - /// - /// - /// directory where downloaded files are stored. - /// - /// - /// further configuration for downloading and preparing dataset. - /// - public void download_and_prepare(string download_dir = null, DownloadConfig download_config = null) - { - - } - } -} diff --git a/src/TensorFlowNET.Datasets/DownloadConfig.cs b/src/TensorFlowNET.Datasets/DownloadConfig.cs deleted file mode 100644 index 0488e273..00000000 --- a/src/TensorFlowNET.Datasets/DownloadConfig.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace TensorFlowDatasets -{ - public class DownloadConfig - { - } -} diff --git a/src/TensorFlowNET.Datasets/TensorFlowNET.Datasets.csproj b/src/TensorFlowNET.Datasets/TensorFlowNET.Datasets.csproj deleted file mode 100644 index 198c3e12..00000000 --- a/src/TensorFlowNET.Datasets/TensorFlowNET.Datasets.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - netcoreapp2.2 - SciSharp.TensorFlowDatasets - 0.0.1 - SciSharp Team - TensorFlow Datasets - true - https://avatars3.githubusercontent.com/u/44989469?s=200&v=4 - http://scisharpstack.org - TensorFlow Datasets provides many public datasets as tf.data.Datasets. - https://github.com/SciSharp/TensorFlow.NET - git - SciSharp, Dataset, TensorFlow - Apache 2.0 - TensorFlow.Datasets - TensorFlow.Datasets - - - diff --git a/src/TensorFlowNET.Hub/DataSetBase.cs b/src/TensorFlowNET.Hub/DataSetBase.cs deleted file mode 100644 index dc47b1c8..00000000 --- a/src/TensorFlowNET.Hub/DataSetBase.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NumSharp; - -namespace Tensorflow.Hub -{ - public abstract class DataSetBase : IDataSet - { - public NDArray Data { get; protected set; } - public NDArray Labels { get; protected set; } - } -} diff --git a/src/TensorFlowNET.Hub/Datasets.cs b/src/TensorFlowNET.Hub/Datasets.cs deleted file mode 100644 index 6c05efb6..00000000 --- a/src/TensorFlowNET.Hub/Datasets.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NumSharp; - -namespace Tensorflow.Hub -{ - public class Datasets where TDataSet : IDataSet - { - public TDataSet Train { get; private set; } - - public TDataSet Validation { get; private set; } - - public TDataSet Test { get; private set; } - - public Datasets(TDataSet train, TDataSet validation, TDataSet test) - { - Train = train; - Validation = validation; - Test = test; - } - - public (NDArray, NDArray) Randomize(NDArray x, NDArray y) - { - var perm = np.random.permutation(y.shape[0]); - np.random.shuffle(perm); - return (x[perm], y[perm]); - } - - /// - /// selects a few number of images determined by the batch_size variable (if you don't know why, read about Stochastic Gradient Method) - /// - /// - /// - /// - /// - /// - public (NDArray, NDArray) GetNextBatch(NDArray x, NDArray y, int start, int end) - { - var slice = new Slice(start, end); - var x_batch = x[slice]; - var y_batch = y[slice]; - return (x_batch, y_batch); - } - } -} diff --git a/src/TensorFlowNET.Hub/IDataSet.cs b/src/TensorFlowNET.Hub/IDataSet.cs deleted file mode 100644 index f38a4217..00000000 --- a/src/TensorFlowNET.Hub/IDataSet.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NumSharp; - -namespace Tensorflow.Hub -{ - public interface IDataSet - { - NDArray Data { get; } - NDArray Labels { get; } - } -} diff --git a/src/TensorFlowNET.Hub/IModelLoader.cs b/src/TensorFlowNET.Hub/IModelLoader.cs deleted file mode 100644 index 530138af..00000000 --- a/src/TensorFlowNET.Hub/IModelLoader.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Text; -using NumSharp; - -namespace Tensorflow.Hub -{ - public interface IModelLoader - where TDataSet : IDataSet - { - Task> LoadAsync(ModelLoadSetting setting); - } -} diff --git a/src/TensorFlowNET.Hub/MnistDataSet.cs b/src/TensorFlowNET.Hub/MnistDataSet.cs deleted file mode 100644 index 9cdd8c0c..00000000 --- a/src/TensorFlowNET.Hub/MnistDataSet.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using NumSharp; -using Tensorflow; - -namespace Tensorflow.Hub -{ - public class MnistDataSet : DataSetBase - { - public int NumOfExamples { get; private set; } - public int EpochsCompleted { get; private set; } - public int IndexInEpoch { get; private set; } - - public MnistDataSet(NDArray images, NDArray labels, Type dataType, bool reshape) - { - EpochsCompleted = 0; - IndexInEpoch = 0; - - NumOfExamples = images.shape[0]; - - images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]); - images = images.astype(dataType); - // for debug np.multiply performance - var sw = new Stopwatch(); - sw.Start(); - images = np.multiply(images, 1.0f / 255.0f); - sw.Stop(); - Console.WriteLine($"{sw.ElapsedMilliseconds}ms"); - Data = images; - - labels = labels.astype(dataType); - Labels = labels; - } - - public (NDArray, NDArray) GetNextBatch(int batch_size, bool fake_data = false, bool shuffle = true) - { - var start = IndexInEpoch; - // Shuffle for the first epoch - if(EpochsCompleted == 0 && start == 0 && shuffle) - { - var perm0 = np.arange(NumOfExamples); - np.random.shuffle(perm0); - Data = Data[perm0]; - Labels = Labels[perm0]; - } - - // Go to the next epoch - if (start + batch_size > NumOfExamples) - { - // Finished epoch - EpochsCompleted += 1; - - // Get the rest examples in this epoch - var rest_num_examples = NumOfExamples - start; - //var images_rest_part = _images[np.arange(start, _num_examples)]; - //var labels_rest_part = _labels[np.arange(start, _num_examples)]; - // Shuffle the data - if (shuffle) - { - var perm = np.arange(NumOfExamples); - np.random.shuffle(perm); - Data = Data[perm]; - Labels = Labels[perm]; - } - - start = 0; - IndexInEpoch = batch_size - rest_num_examples; - var end = IndexInEpoch; - var images_new_part = Data[np.arange(start, end)]; - var labels_new_part = Labels[np.arange(start, end)]; - - /*return (np.concatenate(new float[][] { images_rest_part.Data(), images_new_part.Data() }, axis: 0), - np.concatenate(new float[][] { labels_rest_part.Data(), labels_new_part.Data() }, axis: 0));*/ - return (images_new_part, labels_new_part); - } - else - { - IndexInEpoch += batch_size; - var end = IndexInEpoch; - return (Data[np.arange(start, end)], Labels[np.arange(start, end)]); - } - } - } -} diff --git a/src/TensorFlowNET.Hub/MnistModelLoader.cs b/src/TensorFlowNET.Hub/MnistModelLoader.cs deleted file mode 100644 index 4fdd69b6..00000000 --- a/src/TensorFlowNET.Hub/MnistModelLoader.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Text; -using System.IO; -using NumSharp; - -namespace Tensorflow.Hub -{ - public class MnistModelLoader : IModelLoader - { - private const string DEFAULT_SOURCE_URL = "https://storage.googleapis.com/cvdf-datasets/mnist/"; - private const string TRAIN_IMAGES = "train-images-idx3-ubyte.gz"; - private const string TRAIN_LABELS = "train-labels-idx1-ubyte.gz"; - private const string TEST_IMAGES = "t10k-images-idx3-ubyte.gz"; - private const string TEST_LABELS = "t10k-labels-idx1-ubyte.gz"; - - public static async Task> LoadAsync(string trainDir, bool oneHot = false, int? trainSize = null, int? validationSize = null, int? testSize = null, bool showProgressInConsole = false) - { - var loader = new MnistModelLoader(); - - var setting = new ModelLoadSetting - { - TrainDir = trainDir, - OneHot = oneHot, - ShowProgressInConsole = showProgressInConsole - }; - - if (trainSize.HasValue) - setting.TrainSize = trainSize.Value; - - if (validationSize.HasValue) - setting.ValidationSize = validationSize.Value; - - if (testSize.HasValue) - setting.TestSize = testSize.Value; - - return await loader.LoadAsync(setting); - } - - public async Task> LoadAsync(ModelLoadSetting setting) - { - if (setting.TrainSize.HasValue && setting.ValidationSize >= setting.TrainSize.Value) - throw new ArgumentException("Validation set should be smaller than training set"); - - var sourceUrl = setting.SourceUrl; - - if (string.IsNullOrEmpty(sourceUrl)) - sourceUrl = DEFAULT_SOURCE_URL; - - // load train images - await this.DownloadAsync(sourceUrl + TRAIN_IMAGES, setting.TrainDir, TRAIN_IMAGES, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - await this.UnzipAsync(Path.Combine(setting.TrainDir, TRAIN_IMAGES), setting.TrainDir, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - var trainImages = ExtractImages(Path.Combine(setting.TrainDir, Path.GetFileNameWithoutExtension(TRAIN_IMAGES)), limit: setting.TrainSize); - - // load train labels - await this.DownloadAsync(sourceUrl + TRAIN_LABELS, setting.TrainDir, TRAIN_LABELS, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - await this.UnzipAsync(Path.Combine(setting.TrainDir, TRAIN_LABELS), setting.TrainDir, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - var trainLabels = ExtractLabels(Path.Combine(setting.TrainDir, Path.GetFileNameWithoutExtension(TRAIN_LABELS)), one_hot: setting.OneHot, limit: setting.TrainSize); - - // load test images - await this.DownloadAsync(sourceUrl + TEST_IMAGES, setting.TrainDir, TEST_IMAGES, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - await this.UnzipAsync(Path.Combine(setting.TrainDir, TEST_IMAGES), setting.TrainDir, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - var testImages = ExtractImages(Path.Combine(setting.TrainDir, Path.GetFileNameWithoutExtension(TEST_IMAGES)), limit: setting.TestSize); - - // load test labels - await this.DownloadAsync(sourceUrl + TEST_LABELS, setting.TrainDir, TEST_LABELS, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - await this.UnzipAsync(Path.Combine(setting.TrainDir, TEST_LABELS), setting.TrainDir, showProgressInConsole: setting.ShowProgressInConsole) - .ShowProgressInConsole(setting.ShowProgressInConsole); - - var testLabels = ExtractLabels(Path.Combine(setting.TrainDir, Path.GetFileNameWithoutExtension(TEST_LABELS)), one_hot: setting.OneHot, limit: setting.TestSize); - - var end = trainImages.shape[0]; - - var validationSize = setting.ValidationSize; - - var validationImages = trainImages[np.arange(validationSize)]; - var validationLabels = trainLabels[np.arange(validationSize)]; - - trainImages = trainImages[np.arange(validationSize, end)]; - trainLabels = trainLabels[np.arange(validationSize, end)]; - - var dtype = setting.DataType; - var reshape = setting.ReShape; - - var train = new MnistDataSet(trainImages, trainLabels, dtype, reshape); - var validation = new MnistDataSet(validationImages, validationLabels, dtype, reshape); - var test = new MnistDataSet(testImages, testLabels, dtype, reshape); - - return new Datasets(train, validation, test); - } - - private NDArray ExtractImages(string file, int? limit = null) - { - if (!Path.IsPathRooted(file)) - file = Path.Combine(AppContext.BaseDirectory, file); - - using (var bytestream = new FileStream(file, FileMode.Open)) - { - var magic = Read32(bytestream); - if (magic != 2051) - throw new Exception($"Invalid magic number {magic} in MNIST image file: {file}"); - - var num_images = Read32(bytestream); - num_images = limit == null ? num_images : Math.Min(num_images, (uint)limit); - - var rows = Read32(bytestream); - var cols = Read32(bytestream); - - var buf = new byte[rows * cols * num_images]; - - bytestream.Read(buf, 0, buf.Length); - - var data = np.frombuffer(buf, np.uint8); - data = data.reshape((int)num_images, (int)rows, (int)cols, 1); - - return data; - } - } - - private NDArray ExtractLabels(string file, bool one_hot = false, int num_classes = 10, int? limit = null) - { - if (!Path.IsPathRooted(file)) - file = Path.Combine(AppContext.BaseDirectory, file); - - using (var bytestream = new FileStream(file, FileMode.Open)) - { - var magic = Read32(bytestream); - if (magic != 2049) - throw new Exception($"Invalid magic number {magic} in MNIST label file: {file}"); - - var num_items = Read32(bytestream); - num_items = limit == null ? num_items : Math.Min(num_items, (uint)limit); - - var buf = new byte[num_items]; - - bytestream.Read(buf, 0, buf.Length); - - var labels = np.frombuffer(buf, np.uint8); - - if (one_hot) - return DenseToOneHot(labels, num_classes); - - return labels; - } - } - - private NDArray DenseToOneHot(NDArray labels_dense, int num_classes) - { - var num_labels = labels_dense.shape[0]; - var index_offset = np.arange(num_labels) * num_classes; - var labels_one_hot = np.zeros(num_labels, num_classes); - var labels = labels_dense.Data(); - for (int row = 0; row < num_labels; row++) - { - var col = labels[row]; - labels_one_hot.SetData(1.0, row, col); - } - - return labels_one_hot; - } - - private uint Read32(FileStream bytestream) - { - var buffer = new byte[sizeof(uint)]; - var count = bytestream.Read(buffer, 0, 4); - return np.frombuffer(buffer, ">u4").Data()[0]; - } - } -} diff --git a/src/TensorFlowNET.Hub/ModelLoadSetting.cs b/src/TensorFlowNET.Hub/ModelLoadSetting.cs deleted file mode 100644 index 89e46748..00000000 --- a/src/TensorFlowNET.Hub/ModelLoadSetting.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NumSharp; - -namespace Tensorflow.Hub -{ - public class ModelLoadSetting - { - public string TrainDir { get; set; } - public bool OneHot { get; set; } - public Type DataType { get; set; } = typeof(float); - public bool ReShape { get; set; } - public int ValidationSize { get; set; } = 5000; - public int? TrainSize { get; set; } - public int? TestSize { get; set; } - public string SourceUrl { get; set; } - public bool ShowProgressInConsole { get; set; } - } -} diff --git a/src/TensorFlowNET.Hub/README.md b/src/TensorFlowNET.Hub/README.md deleted file mode 100644 index 156b263d..00000000 --- a/src/TensorFlowNET.Hub/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## TensorFlow Hub - -TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models. In particular, it provides **modules**, which are pre-trained pieces of TensorFlow models that can be reused on new tasks. - -https://github.com/tensorflow/hub \ No newline at end of file diff --git a/src/TensorFlowNET.Hub/TensorFlowNET.Hub.csproj b/src/TensorFlowNET.Hub/TensorFlowNET.Hub.csproj deleted file mode 100644 index ef3c7e18..00000000 --- a/src/TensorFlowNET.Hub/TensorFlowNET.Hub.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - Tensorflow.Hub - netstandard2.0 - 0.0.3 - Kerry Jiang - SciSharp STACK - Apache 2.0 - https://github.com/SciSharp/TensorFlow.NET - git - http://scisharpstack.org - TensorFlow, SciSharp, MachineLearning - TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models. - SciSharp.TensorFlowHub - true - - https://avatars3.githubusercontent.com/u/44989469?s=200&v=4 - TensorFlow.Hub - - - - - \ No newline at end of file diff --git a/src/TensorFlowNET.Hub/Utils.cs b/src/TensorFlowNET.Hub/Utils.cs deleted file mode 100644 index 5b06aaad..00000000 --- a/src/TensorFlowNET.Hub/Utils.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using System.IO; -using System.IO.Compression; -using System.Collections.Generic; -using System.Net; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace Tensorflow.Hub -{ - public static class Utils - { - public static async Task DownloadAsync(this IModelLoader modelLoader, string url, string saveTo) - where TDataSet : IDataSet - { - var dir = Path.GetDirectoryName(saveTo); - var fileName = Path.GetFileName(saveTo); - await modelLoader.DownloadAsync(url, dir, fileName); - } - - public static async Task DownloadAsync(this IModelLoader modelLoader, string url, string dirSaveTo, string fileName, bool showProgressInConsole = false) - where TDataSet : IDataSet - { - if (!Path.IsPathRooted(dirSaveTo)) - dirSaveTo = Path.Combine(AppContext.BaseDirectory, dirSaveTo); - - var fileSaveTo = Path.Combine(dirSaveTo, fileName); - - if (showProgressInConsole) - { - Console.WriteLine($"Downloading {fileName}"); - } - - if (File.Exists(fileSaveTo)) - { - if (showProgressInConsole) - { - Console.WriteLine($"The file {fileName} already exists"); - } - - return; - } - - Directory.CreateDirectory(dirSaveTo); - - using (var wc = new WebClient()) - { - await wc.DownloadFileTaskAsync(url, fileSaveTo).ConfigureAwait(false); - } - - } - - public static async Task UnzipAsync(this IModelLoader modelLoader, string zipFile, string saveTo, bool showProgressInConsole = false) - where TDataSet : IDataSet - { - if (!Path.IsPathRooted(saveTo)) - saveTo = Path.Combine(AppContext.BaseDirectory, saveTo); - - Directory.CreateDirectory(saveTo); - - if (!Path.IsPathRooted(zipFile)) - zipFile = Path.Combine(AppContext.BaseDirectory, zipFile); - - var destFileName = Path.GetFileNameWithoutExtension(zipFile); - var destFilePath = Path.Combine(saveTo, destFileName); - - if (showProgressInConsole) - Console.WriteLine($"Unzippinng {Path.GetFileName(zipFile)}"); - - if (File.Exists(destFilePath)) - { - if (showProgressInConsole) - Console.WriteLine($"The file {destFileName} already exists"); - } - - using (GZipStream unzipStream = new GZipStream(File.OpenRead(zipFile), CompressionMode.Decompress)) - { - using (var destStream = File.Create(destFilePath)) - { - await unzipStream.CopyToAsync(destStream).ConfigureAwait(false); - await destStream.FlushAsync().ConfigureAwait(false); - destStream.Close(); - } - - unzipStream.Close(); - } - } - - public static async Task ShowProgressInConsole(this Task task, bool enable) - { - if (!enable) - { - await task; - return; - } - - var cts = new CancellationTokenSource(); - - var showProgressTask = ShowProgressInConsole(cts); - - try - { - await task; - } - finally - { - cts.Cancel(); - } - - await showProgressTask; - Console.WriteLine("Done."); - } - - private static async Task ShowProgressInConsole(CancellationTokenSource cts) - { - var cols = 0; - - await Task.Delay(100); - - while (!cts.IsCancellationRequested) - { - await Task.Delay(100); - Console.Write("."); - cols++; - - if (cols % 50 == 0) - { - Console.WriteLine(); - } - } - - if (cols > 0) - Console.WriteLine(); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/AnchorGenerators/GridAnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/AnchorGenerators/GridAnchorGenerator.cs deleted file mode 100644 index c5093dfa..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/AnchorGenerators/GridAnchorGenerator.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection -{ - public class GridAnchorGenerator : Core.AnchorGenerator - { - public GridAnchorGenerator(float[] scales = null) - { - if (scales == null) - scales = new[] { 0.5f, 1.0f, 2.0f }; - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Builders/AnchorGeneratorBuilder.cs b/src/TensorFlowNET.Models/ObjectDetection/Builders/AnchorGeneratorBuilder.cs deleted file mode 100644 index f220bccd..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Builders/AnchorGeneratorBuilder.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Tensorflow.Models.ObjectDetection.Protos; -using static Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator; - -namespace Tensorflow.Models.ObjectDetection -{ - public class AnchorGeneratorBuilder - { - public AnchorGeneratorBuilder() - { - - } - - public GridAnchorGenerator build(AnchorGenerator anchor_generator_config) - { - if(anchor_generator_config.AnchorGeneratorOneofCase == AnchorGeneratorOneofOneofCase.GridAnchorGenerator) - { - var grid_anchor_generator_config = anchor_generator_config.GridAnchorGenerator; - return new GridAnchorGenerator(scales: grid_anchor_generator_config.Scales.Select(x => float.Parse(x.ToString())).ToArray()); - } - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Builders/BoxPredictorBuilder.cs b/src/TensorFlowNET.Models/ObjectDetection/Builders/BoxPredictorBuilder.cs deleted file mode 100644 index 7ff2be25..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Builders/BoxPredictorBuilder.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection -{ - public class BoxPredictorBuilder - { - ConvolutionalBoxPredictor _first_stage_box_predictor; - public ConvolutionalBoxPredictor build_convolutional_box_predictor() - { - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Builders/DatasetBuilder.cs b/src/TensorFlowNET.Models/ObjectDetection/Builders/DatasetBuilder.cs deleted file mode 100644 index 3c47bf51..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Builders/DatasetBuilder.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Data; -using Tensorflow.Models.ObjectDetection.Protos; - -namespace Tensorflow.Models.ObjectDetection -{ - public class DatasetBuilder - { - public DatasetV1Adapter build(InputReader input_reader_config, - int batch_size = 0, - Action transform_input_data_fn = null) - { - Func, (Dictionary, Dictionary)> transform_and_pad_input_data_fn = (tensor_dict) => - { - return (null, null); - }; - - var config = input_reader_config.TfRecordInputReader; - - throw new NotImplementedException(""); - } - - public Dictionary process_fn(Tensor value) - { - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Builders/ImageResizerBuilder.cs b/src/TensorFlowNET.Models/ObjectDetection/Builders/ImageResizerBuilder.cs deleted file mode 100644 index 5c52bd87..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Builders/ImageResizerBuilder.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using static Tensorflow.Binding; -using Tensorflow.Models.ObjectDetection.Core; -using Tensorflow.Models.ObjectDetection.Protos; -using static Tensorflow.Models.ObjectDetection.Protos.ImageResizer; - -namespace Tensorflow.Models.ObjectDetection -{ - public class ImageResizerBuilder - { - public ImageResizerBuilder() - { - - } - - /// - /// Builds callable for image resizing operations. - /// - /// - /// - public Func build(ImageResizer image_resizer_config) - { - var image_resizer_oneof = image_resizer_config.ImageResizerOneofCase; - if (image_resizer_oneof == ImageResizerOneofOneofCase.KeepAspectRatioResizer) - { - var keep_aspect_ratio_config = image_resizer_config.KeepAspectRatioResizer; - if (keep_aspect_ratio_config.MinDimension > keep_aspect_ratio_config.MaxDimension) - throw new ValueError("min_dimension > max_dimension"); - var method = _tf_resize_method(keep_aspect_ratio_config.ResizeMethod); - var per_channel_pad_value = new[] { 0, 0, 0 }; - if (keep_aspect_ratio_config.PerChannelPadValue.Count > 0) - throw new NotImplementedException(""); - // per_channel_pad_value = new[] { keep_aspect_ratio_config.PerChannelPadValue. }; - - var args = new ResizeToRangeArgs - { - min_dimension = keep_aspect_ratio_config.MinDimension, - max_dimension = keep_aspect_ratio_config.MaxDimension, - method = method, - pad_to_max_dimension = keep_aspect_ratio_config.PadToMaxDimension, - per_channel_pad_value = per_channel_pad_value - }; - - Func func = (input) => - { - args.image = input.image; - return Preprocessor.resize_to_range(args); - }; - - return func; - } - else - { - throw new NotImplementedException(""); - } - } - - private ResizeMethod _tf_resize_method(ResizeType resize_method) - { - return (ResizeMethod)(int)resize_method; - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Builders/ModelBuilder.cs b/src/TensorFlowNET.Models/ObjectDetection/Builders/ModelBuilder.cs deleted file mode 100644 index 596a7532..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Builders/ModelBuilder.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Models.ObjectDetection.Protos; -using static Tensorflow.Models.ObjectDetection.Protos.DetectionModel; - -namespace Tensorflow.Models.ObjectDetection -{ - public class ModelBuilder - { - ImageResizerBuilder _image_resizer_builder; - FasterRCNNFeatureExtractor _feature_extractor; - AnchorGeneratorBuilder _anchor_generator_builder; - - public ModelBuilder() - { - _image_resizer_builder = new ImageResizerBuilder(); - _anchor_generator_builder = new AnchorGeneratorBuilder(); - } - - /// - /// Builds a DetectionModel based on the model config. - /// - /// A model.proto object containing the config for the desired DetectionModel. - /// True if this model is being built for training purposes. - /// Whether to add tensorflow summaries in the model graph. - /// DetectionModel based on the config. - public FasterRCNNMetaArch build(DetectionModel model_config, bool is_training, bool add_summaries = true) - { - var meta_architecture = model_config.ModelCase; - if (meta_architecture == ModelOneofCase.Ssd) - throw new NotImplementedException(""); - else if (meta_architecture == ModelOneofCase.FasterRcnn) - return _build_faster_rcnn_model(model_config.FasterRcnn, is_training, add_summaries); - - throw new ValueError($"Unknown meta architecture: {meta_architecture}"); - } - - /// - /// Builds a Faster R-CNN or R-FCN detection model based on the model config. - /// - /// - /// - /// - /// FasterRCNNMetaArch based on the config. - private FasterRCNNMetaArch _build_faster_rcnn_model(FasterRcnn frcnn_config, bool is_training, bool add_summaries) - { - var num_classes = frcnn_config.NumClasses; - var image_resizer_fn = _image_resizer_builder.build(frcnn_config.ImageResizer); - - var feature_extractor = _build_faster_rcnn_feature_extractor(frcnn_config.FeatureExtractor, is_training, - inplace_batchnorm_update: frcnn_config.InplaceBatchnormUpdate); - - var number_of_stages = frcnn_config.NumberOfStages; - var first_stage_anchor_generator = _anchor_generator_builder.build(frcnn_config.FirstStageAnchorGenerator); - var first_stage_atrous_rate = frcnn_config.FirstStageAtrousRate; - - return new FasterRCNNMetaArch(new FasterRCNNInitArgs - { - is_training = is_training, - num_classes = num_classes, - image_resizer_fn = image_resizer_fn, - feature_extractor = _feature_extractor, - number_of_stage = number_of_stages, - first_stage_anchor_generator = null, - first_stage_atrous_rate = first_stage_atrous_rate - }); - } - - public Action preprocess() - { - throw new NotImplementedException(""); - } - - private FasterRCNNFeatureExtractor _build_faster_rcnn_feature_extractor(FasterRcnnFeatureExtractor feature_extractor_config, - bool is_training, bool reuse_weights = false, bool inplace_batchnorm_update = false) - { - if (inplace_batchnorm_update) - throw new ValueError("inplace batchnorm updates not supported."); - var feature_type = feature_extractor_config.Type; - var first_stage_features_stride = feature_extractor_config.FirstStageFeaturesStride; - var batch_norm_trainable = feature_extractor_config.BatchNormTrainable; - - return new FasterRCNNResnet101FeatureExtractor(is_training, first_stage_features_stride, - batch_norm_trainable: batch_norm_trainable, - reuse_weights: reuse_weights); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Core/AnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Core/AnchorGenerator.cs deleted file mode 100644 index af44ee3f..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Core/AnchorGenerator.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection.Core -{ - public class AnchorGenerator - { - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Core/DetectionModel.cs b/src/TensorFlowNET.Models/ObjectDetection/Core/DetectionModel.cs deleted file mode 100644 index 24578a5b..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Core/DetectionModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection.Core -{ - public abstract class DetectionModel - { - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Core/Preprocessor.cs b/src/TensorFlowNET.Models/ObjectDetection/Core/Preprocessor.cs deleted file mode 100644 index ac3cc805..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Core/Preprocessor.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using static Tensorflow.Binding; - -namespace Tensorflow.Models.ObjectDetection.Core -{ - public class Preprocessor - { - public static Tensor[] resize_to_range(ResizeToRangeArgs args) - { - var image = args.image; - var min_dimension = args.min_dimension; - var max_dimension = args.max_dimension; - var method = args.method; - var align_corners = args.align_corners; - - if (image.NDims != 3) - throw new ValueError("Image should be 3D tensor"); - - - Func _resize_landscape_image = (image1) => - { - return tf.image.resize_images(image1, - tf.stack(new[] { min_dimension, max_dimension }), - method: method, - align_corners: align_corners, - preserve_aspect_ratio: true); - }; - Func _resize_portrait_image = (image1) => - { - return tf.image.resize_images(image1, - tf.stack(new[] { min_dimension, max_dimension }), - method: method, - align_corners: align_corners, - preserve_aspect_ratio: true); - }; - - return tf_with(tf.name_scope("ResizeToRange", values: new { image, min_dimension }), delegate - { - Tensor new_image, new_size; - - if (image.TensorShape.is_fully_defined()) - throw new NotImplementedException(""); - else - { - new_image = tf.cond( - tf.less(tf.shape(image)[0], tf.shape(image)[1]), - () => _resize_landscape_image(image), - () => _resize_portrait_image(image)); - new_size = tf.shape(new_image); - } - - if (args.pad_to_max_dimension) - { - throw new NotImplementedException(""); - } - - var result = new List { new_image }; - if (args.masks != null) - throw new NotImplementedException(""); - - result.Add(new_size); - - return result.ToArray(); - }); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Core/ResizeToRangeArgs.cs b/src/TensorFlowNET.Models/ObjectDetection/Core/ResizeToRangeArgs.cs deleted file mode 100644 index 1a3c8eb5..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Core/ResizeToRangeArgs.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection.Core -{ - public class ResizeToRangeArgs - { - public Tensor image { get; set; } - public int[] masks { get; set; } - public int min_dimension { get; set; } - public int max_dimension { get; set; } - public ResizeMethod method {get;set;} - public bool align_corners { get; set; } - public bool pad_to_max_dimension { get; set; } - public int[] per_channel_pad_value { get; set; } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Entities/TrainAndEvalDict.cs b/src/TensorFlowNET.Models/ObjectDetection/Entities/TrainAndEvalDict.cs deleted file mode 100644 index aa6bb502..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Entities/TrainAndEvalDict.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Data; -using Tensorflow.Estimators; - -namespace Tensorflow.Models.ObjectDetection -{ - public class TrainAndEvalDict - { - public Estimator estimator { get; set; } - public Func train_input_fn { get; set; } - public Action[] eval_input_fns { get; set; } - public string[] eval_input_names { get; set; } - public Action eval_on_train_input_fn { get; set; } - public Action predict_input_fn { get; set; } - public int train_steps { get; set; } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Inputs.cs b/src/TensorFlowNET.Models/ObjectDetection/Inputs.cs deleted file mode 100644 index 34845786..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Inputs.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Data; -using Tensorflow.Models.ObjectDetection.Protos; - -namespace Tensorflow.Models.ObjectDetection -{ - public class Inputs - { - ModelBuilder modelBuilder; - DatasetBuilder datasetBuilder; - - public Inputs() - { - modelBuilder = new ModelBuilder(); - datasetBuilder = new DatasetBuilder(); - } - - public Func create_train_input_fn(TrainConfig train_config, InputReader train_input_config, DetectionModel model_config) - { - Func _train_input_fn = () => - train_input(train_config, train_input_config, model_config); - - return _train_input_fn; - } - - /// - /// Returns `features` and `labels` tensor dictionaries for training. - /// - /// - /// - /// - /// - public DatasetV1Adapter train_input(TrainConfig train_config, InputReader train_input_config, DetectionModel model_config) - { - var arch = modelBuilder.build(model_config, true, true); - Func model_preprocess_fn = arch.preprocess; - - Func, (Dictionary, Dictionary) > transform_and_pad_input_data_fn = (tensor_dict) => - { - return (_get_features_dict(tensor_dict), _get_labels_dict(tensor_dict)); - }; - - var dataset = datasetBuilder.build(train_input_config); - - return dataset; - } - - private Dictionary _get_features_dict(Dictionary input_dict) - { - throw new NotImplementedException("_get_features_dict"); - } - - private Dictionary _get_labels_dict(Dictionary input_dict) - { - throw new NotImplementedException("_get_labels_dict"); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNFeatureExtractor.cs b/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNFeatureExtractor.cs deleted file mode 100644 index bdcfae76..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNFeatureExtractor.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection -{ - /// - /// Faster R-CNN Feature Extractor definition. - /// - public class FasterRCNNFeatureExtractor - { - bool _is_training; - int _first_stage_features_stride; - bool _reuse_weights = false; - float _weight_decay = 0.0f; - bool _train_batch_norm; - - public FasterRCNNFeatureExtractor(bool is_training, - int first_stage_features_stride, - bool batch_norm_trainable = false, - bool reuse_weights = false, - float weight_decay = 0.0f) - { - _is_training = is_training; - _first_stage_features_stride = first_stage_features_stride; - _train_batch_norm = (batch_norm_trainable && is_training); - _reuse_weights = reuse_weights; - _weight_decay = weight_decay; - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNInitArgs.cs b/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNInitArgs.cs deleted file mode 100644 index e5e92161..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNInitArgs.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Models.ObjectDetection.Core; - -namespace Tensorflow.Models.ObjectDetection -{ - public class FasterRCNNInitArgs - { - public bool is_training { get; set; } - public int num_classes { get; set; } - public Func image_resizer_fn { get; set; } - public FasterRCNNFeatureExtractor feature_extractor { get; set; } - public int number_of_stage { get; set; } - public object first_stage_anchor_generator { get; set; } - public object first_stage_target_assigner { get; set; } - public int first_stage_atrous_rate { get; set; } - public int parallel_iterations { get; set; } = 16; - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNMetaArch.cs b/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNMetaArch.cs deleted file mode 100644 index 956960b0..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNMetaArch.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using static Tensorflow.Binding; - -namespace Tensorflow.Models.ObjectDetection -{ - public class FasterRCNNMetaArch : Core.DetectionModel - { - FasterRCNNInitArgs _args; - - public FasterRCNNMetaArch(FasterRCNNInitArgs args) - { - _args = args; - } - - /// - /// Feature-extractor specific preprocessing. - /// - /// - /// - public (Tensor, Tensor) preprocess(Tensor inputs) - { - tf_with(tf.name_scope("Preprocessor"), delegate - { - var outputs = shape_utils.static_or_dynamic_map_fn( - (inputs1) => - { - return _args.image_resizer_fn(new Core.ResizeToRangeArgs - { - image = inputs1 - })[0]; - }, - elems: inputs, - dtypes: new[] { tf.float32, tf.int32 }, - parallel_iterations: _args.parallel_iterations); - }); - - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/ModelLib.cs b/src/TensorFlowNET.Models/ObjectDetection/ModelLib.cs deleted file mode 100644 index 5611356b..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/ModelLib.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using static Tensorflow.Binding; -using Tensorflow.Estimators; -using System.Linq; -using Tensorflow.Contrib.Train; -using Tensorflow.Models.ObjectDetection.Utils; -using Tensorflow.Data; - -namespace Tensorflow.Models.ObjectDetection -{ - public class ModelLib - { - Inputs inputs = new Inputs(); - - public TrainAndEvalDict create_estimator_and_inputs(RunConfig run_config, - HParams hparams = null, - string pipeline_config_path = null, - int train_steps = 0, - int sample_1_of_n_eval_examples = 0, - int sample_1_of_n_eval_on_train_examples = 1) - { - var config = ConfigUtil.get_configs_from_pipeline_file(pipeline_config_path); - - // Create the input functions for TRAIN/EVAL/PREDICT. - Func train_input_fn = inputs.create_train_input_fn(config.TrainConfig, config.TrainInputReader, config.Model); - - var eval_input_configs = config.EvalInputReader; - - var eval_input_fns = new Action[eval_input_configs.Count]; - var eval_input_names = eval_input_configs.Select(eval_input_config => eval_input_config.Name).ToArray(); - Action eval_on_train_input_fn = () => { }; - Action predict_input_fn = () => { }; - Action model_fn = () => { }; - var estimator = tf.estimator.Estimator(model_fn: model_fn, config: run_config); - - return new TrainAndEvalDict - { - estimator = estimator, - train_input_fn = train_input_fn, - eval_input_fns = eval_input_fns, - eval_input_names = eval_input_names, - eval_on_train_input_fn = eval_on_train_input_fn, - predict_input_fn = predict_input_fn, - train_steps = train_steps - }; - } - - public (TrainSpec, EvalSpec[]) create_train_and_eval_specs(Func train_input_fn, Action[] eval_input_fns, Action eval_on_train_input_fn, - Action predict_input_fn, int train_steps, bool eval_on_train_data = false, - string final_exporter_name = "Servo", string[] eval_spec_names = null) - { - var train_spec = tf.estimator.TrainSpec(input_fn: train_input_fn, max_steps: train_steps); - - if (eval_spec_names == null) - eval_spec_names = range(len(eval_input_fns)) - .Select(x => x.ToString()) - .ToArray(); - - var eval_specs = new List(); - foreach (var (index, (eval_spec_name, eval_input_fn)) in enumerate(zip(eval_spec_names, eval_input_fns).ToList())) - { - var exporter_name = index == 0 ? final_exporter_name : $"{final_exporter_name}_{eval_spec_name}"; - var exporter = tf.estimator.FinalExporter(name: exporter_name, serving_input_receiver_fn: predict_input_fn); - eval_specs.Add(tf.estimator.EvalSpec(name: eval_spec_name, - input_fn: eval_input_fn, - exporters: exporter)); - } - - if (eval_on_train_data) - throw new NotImplementedException(""); - - return (train_spec, eval_specs.ToArray()); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnet101FeatureExtractor.cs b/src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnet101FeatureExtractor.cs deleted file mode 100644 index 75e21ade..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnet101FeatureExtractor.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using static Tensorflow.Binding; -using Tensorflow.Operations.Activation; -using Tensorflow.Models.Slim.Nets; - -namespace Tensorflow.Models.ObjectDetection -{ - /// - /// Faster R-CNN Resnet 101 feature extractor implementation. - /// - public class FasterRCNNResnet101FeatureExtractor : FasterRCNNResnetV1FeatureExtractor - { - public FasterRCNNResnet101FeatureExtractor(bool is_training, - int first_stage_features_stride, - bool batch_norm_trainable = false, - bool reuse_weights = false, - float weight_decay = 0.0f, - IActivation activation_fn = null) : base("resnet_v1_101", - ResNetV1.resnet_v1_101, - is_training, - first_stage_features_stride, - batch_norm_trainable: batch_norm_trainable, - reuse_weights: reuse_weights, - weight_decay: weight_decay, - activation_fn: activation_fn) - { - - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnetV1FeatureExtractor.cs b/src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnetV1FeatureExtractor.cs deleted file mode 100644 index e4a8351b..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnetV1FeatureExtractor.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using static Tensorflow.Binding; -using Tensorflow.Operations.Activation; - -namespace Tensorflow.Models.ObjectDetection -{ - public class FasterRCNNResnetV1FeatureExtractor : FasterRCNNFeatureExtractor - { - public FasterRCNNResnetV1FeatureExtractor(string architecture, - Action resnet_model, - bool is_training, - int first_stage_features_stride, - bool batch_norm_trainable = false, - bool reuse_weights = false, - float weight_decay = 0.0f, - IActivation activation_fn = null) : base(is_training, - first_stage_features_stride, - batch_norm_trainable: batch_norm_trainable, - reuse_weights: reuse_weights, - weight_decay: weight_decay) - { - if (activation_fn == null) - activation_fn = tf.nn.relu(); - } - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Models/faster_rcnn_resnet101_voc07.config b/src/TensorFlowNET.Models/ObjectDetection/Models/faster_rcnn_resnet101_voc07.config deleted file mode 100644 index 7458f4a5..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Models/faster_rcnn_resnet101_voc07.config +++ /dev/null @@ -1,133 +0,0 @@ -# Faster R-CNN with Resnet-101 (v1), configured for Pascal VOC Dataset. -# Users should configure the fine_tune_checkpoint field in the train config as -# well as the label_map_path and input_path fields in the train_input_reader and -# eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that -# should be configured. - -model { - faster_rcnn { - num_classes: 20 - image_resizer { - keep_aspect_ratio_resizer { - min_dimension: 600 - max_dimension: 1024 - } - } - feature_extractor { - type: 'faster_rcnn_resnet101' - first_stage_features_stride: 16 - } - first_stage_anchor_generator { - grid_anchor_generator { - scales: [0.25, 0.5, 1.0, 2.0] - aspect_ratios: [0.5, 1.0, 2.0] - height_stride: 16 - width_stride: 16 - } - } - first_stage_box_predictor_conv_hyperparams { - op: CONV - regularizer { - l2_regularizer { - weight: 0.0 - } - } - initializer { - truncated_normal_initializer { - stddev: 0.01 - } - } - } - first_stage_nms_score_threshold: 0.0 - first_stage_nms_iou_threshold: 0.7 - first_stage_max_proposals: 300 - first_stage_localization_loss_weight: 2.0 - first_stage_objectness_loss_weight: 1.0 - initial_crop_size: 14 - maxpool_kernel_size: 2 - maxpool_stride: 2 - second_stage_box_predictor { - mask_rcnn_box_predictor { - use_dropout: false - dropout_keep_probability: 1.0 - fc_hyperparams { - op: FC - regularizer { - l2_regularizer { - weight: 0.0 - } - } - initializer { - variance_scaling_initializer { - factor: 1.0 - uniform: true - mode: FAN_AVG - } - } - } - } - } - second_stage_post_processing { - batch_non_max_suppression { - score_threshold: 0.0 - iou_threshold: 0.6 - max_detections_per_class: 100 - max_total_detections: 300 - } - score_converter: SOFTMAX - } - second_stage_localization_loss_weight: 2.0 - second_stage_classification_loss_weight: 1.0 - } -} - -train_config: { - batch_size: 1 - optimizer { - momentum_optimizer: { - learning_rate: { - manual_step_learning_rate { - initial_learning_rate: 0.0001 - schedule { - step: 500000 - learning_rate: .00001 - } - schedule { - step: 700000 - learning_rate: .000001 - } - } - } - momentum_optimizer_value: 0.9 - } - use_moving_average: false - } - gradient_clipping_by_norm: 10.0 - fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/model.ckpt" - from_detection_checkpoint: true - num_steps: 800000 - data_augmentation_options { - random_horizontal_flip { - } - } -} - -train_input_reader: { - tf_record_input_reader { - input_path: "PATH_TO_BE_CONFIGURED/pascal_train.record" - } - label_map_path: "PATH_TO_BE_CONFIGURED/pascal_label_map.pbtxt" -} - -eval_config: { - num_examples: 4952 -} - -eval_input_reader: { - tf_record_input_reader { - input_path: "PATH_TO_BE_CONFIGURED/pascal_val.record" - } - label_map_path: "PATH_TO_BE_CONFIGURED/pascal_label_map.pbtxt" - shuffle: false - num_readers: 1 -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Predictors/ConvolutionalBoxPredictor.cs b/src/TensorFlowNET.Models/ObjectDetection/Predictors/ConvolutionalBoxPredictor.cs deleted file mode 100644 index bd2f4114..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Predictors/ConvolutionalBoxPredictor.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.ObjectDetection -{ - public class ConvolutionalBoxPredictor - { - } -} diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs deleted file mode 100644 index 8a0e255c..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs +++ /dev/null @@ -1,343 +0,0 @@ -// -// 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 deleted file mode 100644 index c967c034..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs +++ /dev/null @@ -1,343 +0,0 @@ -// -// 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 deleted file mode 100644 index 5ead27f5..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs +++ /dev/null @@ -1,181 +0,0 @@ -// -// 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 deleted file mode 100644 index d13d3326..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs +++ /dev/null @@ -1,341 +0,0 @@ -// -// 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 deleted file mode 100644 index 382c0d21..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs +++ /dev/null @@ -1,2587 +0,0 @@ -// -// 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 deleted file mode 100644 index 7bd62280..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs +++ /dev/null @@ -1,1413 +0,0 @@ -// -// 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 deleted file mode 100644 index b33b5869..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs +++ /dev/null @@ -1,901 +0,0 @@ -// -// 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 deleted file mode 100644 index f5ed1f2c..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs +++ /dev/null @@ -1,1592 +0,0 @@ -// -// 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 deleted file mode 100644 index bf9dbe92..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs +++ /dev/null @@ -1,272 +0,0 @@ -// -// 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 deleted file mode 100644 index 2847b5fd..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs +++ /dev/null @@ -1,476 +0,0 @@ -// -// 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 deleted file mode 100644 index 04d3530c..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs +++ /dev/null @@ -1,417 +0,0 @@ -// -// 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 deleted file mode 100644 index 76b31e74..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs +++ /dev/null @@ -1,386 +0,0 @@ -// -// 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 deleted file mode 100644 index 315b1c68..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs +++ /dev/null @@ -1,2106 +0,0 @@ -// -// 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 deleted file mode 100644 index 8f10a4bb..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs +++ /dev/null @@ -1,1255 +0,0 @@ -// -// 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 deleted file mode 100644 index 90f7ae1b..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs +++ /dev/null @@ -1,1225 +0,0 @@ -// -// 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 deleted file mode 100644 index bf1f76bd..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs +++ /dev/null @@ -1,300 +0,0 @@ -// -// 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 deleted file mode 100644 index e34ed91b..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs +++ /dev/null @@ -1,3009 +0,0 @@ -// -// 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); - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 1; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// Output loss per anchor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WeightedL2LocalizationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WeightedL2LocalizationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.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 (AnchorwiseOutput != false) { - output.WriteRawTag(8); - output.WriteBool(AnchorwiseOutput); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WeightedL2LocalizationLoss other) { - if (other == null) { - return; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - _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: { - AnchorwiseOutput = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// SmoothL1 (Huber) location loss. - /// The smooth L1_loss is defined elementwise as .5 x^2 if |x| <= delta and - /// delta * (|x|-0.5*delta) otherwise, where x is the difference between - /// predictions and target. - /// - public sealed partial class WeightedSmoothL1LocalizationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedSmoothL1LocalizationLoss()); - 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[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSmoothL1LocalizationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSmoothL1LocalizationLoss(WeightedSmoothL1LocalizationLoss other) : this() { - anchorwiseOutput_ = other.anchorwiseOutput_; - delta_ = other.delta_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSmoothL1LocalizationLoss Clone() { - return new WeightedSmoothL1LocalizationLoss(this); - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 1; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// Output loss per anchor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - /// Field number for the "delta" field. - public const int DeltaFieldNumber = 2; - private float delta_; - /// - /// Delta value for huber loss. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Delta { - get { return delta_; } - set { - delta_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WeightedSmoothL1LocalizationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WeightedSmoothL1LocalizationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Delta, other.Delta)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.GetHashCode(); - if (Delta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Delta); - 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 (AnchorwiseOutput != false) { - output.WriteRawTag(8); - output.WriteBool(AnchorwiseOutput); - } - if (Delta != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Delta); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (Delta != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WeightedSmoothL1LocalizationLoss other) { - if (other == null) { - return; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - if (other.Delta != 0F) { - Delta = other.Delta; - } - _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: { - AnchorwiseOutput = input.ReadBool(); - break; - } - case 21: { - Delta = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Intersection over union location loss: 1 - IOU - /// - public sealed partial class WeightedIOULocalizationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedIOULocalizationLoss()); - 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[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedIOULocalizationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedIOULocalizationLoss(WeightedIOULocalizationLoss other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedIOULocalizationLoss Clone() { - return new WeightedIOULocalizationLoss(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WeightedIOULocalizationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WeightedIOULocalizationLoss 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(WeightedIOULocalizationLoss 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 for class prediction loss function. - /// - public sealed partial class ClassificationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClassificationLoss()); - 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[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClassificationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClassificationLoss(ClassificationLoss other) : this() { - switch (other.ClassificationLossCase) { - case ClassificationLossOneofCase.WeightedSigmoid: - WeightedSigmoid = other.WeightedSigmoid.Clone(); - break; - case ClassificationLossOneofCase.WeightedSoftmax: - WeightedSoftmax = other.WeightedSoftmax.Clone(); - break; - case ClassificationLossOneofCase.WeightedLogitsSoftmax: - WeightedLogitsSoftmax = other.WeightedLogitsSoftmax.Clone(); - break; - case ClassificationLossOneofCase.BootstrappedSigmoid: - BootstrappedSigmoid = other.BootstrappedSigmoid.Clone(); - break; - case ClassificationLossOneofCase.WeightedSigmoidFocal: - WeightedSigmoidFocal = other.WeightedSigmoidFocal.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClassificationLoss Clone() { - return new ClassificationLoss(this); - } - - /// Field number for the "weighted_sigmoid" field. - public const int WeightedSigmoidFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.WeightedSigmoidClassificationLoss WeightedSigmoid { - get { return classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoid ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightedSigmoidClassificationLoss) classificationLoss_ : null; } - set { - classificationLoss_ = value; - classificationLossCase_ = value == null ? ClassificationLossOneofCase.None : ClassificationLossOneofCase.WeightedSigmoid; - } - } - - /// Field number for the "weighted_softmax" field. - public const int WeightedSoftmaxFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss WeightedSoftmax { - get { return classificationLossCase_ == ClassificationLossOneofCase.WeightedSoftmax ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss) classificationLoss_ : null; } - set { - classificationLoss_ = value; - classificationLossCase_ = value == null ? ClassificationLossOneofCase.None : ClassificationLossOneofCase.WeightedSoftmax; - } - } - - /// Field number for the "weighted_logits_softmax" field. - public const int WeightedLogitsSoftmaxFieldNumber = 5; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss WeightedLogitsSoftmax { - get { return classificationLossCase_ == ClassificationLossOneofCase.WeightedLogitsSoftmax ? (global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss) classificationLoss_ : null; } - set { - classificationLoss_ = value; - classificationLossCase_ = value == null ? ClassificationLossOneofCase.None : ClassificationLossOneofCase.WeightedLogitsSoftmax; - } - } - - /// Field number for the "bootstrapped_sigmoid" field. - public const int BootstrappedSigmoidFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss BootstrappedSigmoid { - get { return classificationLossCase_ == ClassificationLossOneofCase.BootstrappedSigmoid ? (global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss) classificationLoss_ : null; } - set { - classificationLoss_ = value; - classificationLossCase_ = value == null ? ClassificationLossOneofCase.None : ClassificationLossOneofCase.BootstrappedSigmoid; - } - } - - /// Field number for the "weighted_sigmoid_focal" field. - public const int WeightedSigmoidFocalFieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss WeightedSigmoidFocal { - get { return classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoidFocal ? (global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss) classificationLoss_ : null; } - set { - classificationLoss_ = value; - classificationLossCase_ = value == null ? ClassificationLossOneofCase.None : ClassificationLossOneofCase.WeightedSigmoidFocal; - } - } - - private object classificationLoss_; - /// Enum of possible cases for the "classification_loss" oneof. - public enum ClassificationLossOneofCase { - None = 0, - WeightedSigmoid = 1, - WeightedSoftmax = 2, - WeightedLogitsSoftmax = 5, - BootstrappedSigmoid = 3, - WeightedSigmoidFocal = 4, - } - private ClassificationLossOneofCase classificationLossCase_ = ClassificationLossOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ClassificationLossOneofCase ClassificationLossCase { - get { return classificationLossCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearClassificationLoss() { - classificationLossCase_ = ClassificationLossOneofCase.None; - classificationLoss_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ClassificationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ClassificationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(WeightedSigmoid, other.WeightedSigmoid)) return false; - if (!object.Equals(WeightedSoftmax, other.WeightedSoftmax)) return false; - if (!object.Equals(WeightedLogitsSoftmax, other.WeightedLogitsSoftmax)) return false; - if (!object.Equals(BootstrappedSigmoid, other.BootstrappedSigmoid)) return false; - if (!object.Equals(WeightedSigmoidFocal, other.WeightedSigmoidFocal)) return false; - if (ClassificationLossCase != other.ClassificationLossCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoid) hash ^= WeightedSigmoid.GetHashCode(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSoftmax) hash ^= WeightedSoftmax.GetHashCode(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedLogitsSoftmax) hash ^= WeightedLogitsSoftmax.GetHashCode(); - if (classificationLossCase_ == ClassificationLossOneofCase.BootstrappedSigmoid) hash ^= BootstrappedSigmoid.GetHashCode(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoidFocal) hash ^= WeightedSigmoidFocal.GetHashCode(); - hash ^= (int) classificationLossCase_; - 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 (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoid) { - output.WriteRawTag(10); - output.WriteMessage(WeightedSigmoid); - } - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSoftmax) { - output.WriteRawTag(18); - output.WriteMessage(WeightedSoftmax); - } - if (classificationLossCase_ == ClassificationLossOneofCase.BootstrappedSigmoid) { - output.WriteRawTag(26); - output.WriteMessage(BootstrappedSigmoid); - } - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoidFocal) { - output.WriteRawTag(34); - output.WriteMessage(WeightedSigmoidFocal); - } - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedLogitsSoftmax) { - output.WriteRawTag(42); - output.WriteMessage(WeightedLogitsSoftmax); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoid) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedSigmoid); - } - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSoftmax) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedSoftmax); - } - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedLogitsSoftmax) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedLogitsSoftmax); - } - if (classificationLossCase_ == ClassificationLossOneofCase.BootstrappedSigmoid) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BootstrappedSigmoid); - } - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoidFocal) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(WeightedSigmoidFocal); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ClassificationLoss other) { - if (other == null) { - return; - } - switch (other.ClassificationLossCase) { - case ClassificationLossOneofCase.WeightedSigmoid: - if (WeightedSigmoid == null) { - WeightedSigmoid = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSigmoidClassificationLoss(); - } - WeightedSigmoid.MergeFrom(other.WeightedSigmoid); - break; - case ClassificationLossOneofCase.WeightedSoftmax: - if (WeightedSoftmax == null) { - WeightedSoftmax = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss(); - } - WeightedSoftmax.MergeFrom(other.WeightedSoftmax); - break; - case ClassificationLossOneofCase.WeightedLogitsSoftmax: - if (WeightedLogitsSoftmax == null) { - WeightedLogitsSoftmax = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss(); - } - WeightedLogitsSoftmax.MergeFrom(other.WeightedLogitsSoftmax); - break; - case ClassificationLossOneofCase.BootstrappedSigmoid: - if (BootstrappedSigmoid == null) { - BootstrappedSigmoid = new global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss(); - } - BootstrappedSigmoid.MergeFrom(other.BootstrappedSigmoid); - break; - case ClassificationLossOneofCase.WeightedSigmoidFocal: - if (WeightedSigmoidFocal == null) { - WeightedSigmoidFocal = new global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss(); - } - WeightedSigmoidFocal.MergeFrom(other.WeightedSigmoidFocal); - 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.WeightedSigmoidClassificationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSigmoidClassificationLoss(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoid) { - subBuilder.MergeFrom(WeightedSigmoid); - } - input.ReadMessage(subBuilder); - WeightedSigmoid = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationLoss(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSoftmax) { - subBuilder.MergeFrom(WeightedSoftmax); - } - input.ReadMessage(subBuilder); - WeightedSoftmax = subBuilder; - break; - } - case 26: { - global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.BootstrappedSigmoidClassificationLoss(); - if (classificationLossCase_ == ClassificationLossOneofCase.BootstrappedSigmoid) { - subBuilder.MergeFrom(BootstrappedSigmoid); - } - input.ReadMessage(subBuilder); - BootstrappedSigmoid = subBuilder; - break; - } - case 34: { - global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SigmoidFocalClassificationLoss(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedSigmoidFocal) { - subBuilder.MergeFrom(WeightedSigmoidFocal); - } - input.ReadMessage(subBuilder); - WeightedSigmoidFocal = subBuilder; - break; - } - case 42: { - global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.WeightedSoftmaxClassificationAgainstLogitsLoss(); - if (classificationLossCase_ == ClassificationLossOneofCase.WeightedLogitsSoftmax) { - subBuilder.MergeFrom(WeightedLogitsSoftmax); - } - input.ReadMessage(subBuilder); - WeightedLogitsSoftmax = subBuilder; - break; - } - } - } - } - - } - - /// - /// Classification loss using a sigmoid function over class predictions. - /// - public sealed partial class WeightedSigmoidClassificationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedSigmoidClassificationLoss()); - 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[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSigmoidClassificationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSigmoidClassificationLoss(WeightedSigmoidClassificationLoss other) : this() { - anchorwiseOutput_ = other.anchorwiseOutput_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSigmoidClassificationLoss Clone() { - return new WeightedSigmoidClassificationLoss(this); - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 1; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// Output loss per anchor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WeightedSigmoidClassificationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WeightedSigmoidClassificationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.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 (AnchorwiseOutput != false) { - output.WriteRawTag(8); - output.WriteBool(AnchorwiseOutput); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WeightedSigmoidClassificationLoss other) { - if (other == null) { - return; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - _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: { - AnchorwiseOutput = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Sigmoid Focal cross entropy loss as described in - /// https://arxiv.org/abs/1708.02002 - /// - public sealed partial class SigmoidFocalClassificationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SigmoidFocalClassificationLoss()); - 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[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SigmoidFocalClassificationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SigmoidFocalClassificationLoss(SigmoidFocalClassificationLoss other) : this() { - anchorwiseOutput_ = other.anchorwiseOutput_; - gamma_ = other.gamma_; - alpha_ = other.alpha_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SigmoidFocalClassificationLoss Clone() { - return new SigmoidFocalClassificationLoss(this); - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 1; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - /// Field number for the "gamma" field. - public const int GammaFieldNumber = 2; - private float gamma_; - /// - /// modulating factor for the loss. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Gamma { - get { return gamma_; } - set { - gamma_ = value; - } - } - - /// Field number for the "alpha" field. - public const int AlphaFieldNumber = 3; - private float alpha_; - /// - /// alpha weighting factor for the loss. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Alpha { - get { return alpha_; } - set { - alpha_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SigmoidFocalClassificationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SigmoidFocalClassificationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Gamma, other.Gamma)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Alpha, other.Alpha)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.GetHashCode(); - if (Gamma != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Gamma); - if (Alpha != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Alpha); - 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 (AnchorwiseOutput != false) { - output.WriteRawTag(8); - output.WriteBool(AnchorwiseOutput); - } - if (Gamma != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Gamma); - } - if (Alpha != 0F) { - output.WriteRawTag(29); - output.WriteFloat(Alpha); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (Gamma != 0F) { - size += 1 + 4; - } - if (Alpha != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SigmoidFocalClassificationLoss other) { - if (other == null) { - return; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - if (other.Gamma != 0F) { - Gamma = other.Gamma; - } - if (other.Alpha != 0F) { - Alpha = other.Alpha; - } - _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: { - AnchorwiseOutput = input.ReadBool(); - break; - } - case 21: { - Gamma = input.ReadFloat(); - break; - } - case 29: { - Alpha = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Classification loss using a softmax function over class predictions. - /// - public sealed partial class WeightedSoftmaxClassificationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedSoftmaxClassificationLoss()); - 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[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSoftmaxClassificationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSoftmaxClassificationLoss(WeightedSoftmaxClassificationLoss other) : this() { - anchorwiseOutput_ = other.anchorwiseOutput_; - logitScale_ = other.logitScale_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSoftmaxClassificationLoss Clone() { - return new WeightedSoftmaxClassificationLoss(this); - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 1; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// Output loss per anchor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - /// Field number for the "logit_scale" field. - public const int LogitScaleFieldNumber = 2; - private float logitScale_; - /// - /// Scale logit (input) value before calculating softmax classification loss. - /// Typically used for softmax distillation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LogitScale { - get { return logitScale_; } - set { - logitScale_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WeightedSoftmaxClassificationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WeightedSoftmaxClassificationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LogitScale, other.LogitScale)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.GetHashCode(); - if (LogitScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LogitScale); - 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 (AnchorwiseOutput != false) { - output.WriteRawTag(8); - output.WriteBool(AnchorwiseOutput); - } - if (LogitScale != 0F) { - output.WriteRawTag(21); - output.WriteFloat(LogitScale); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (LogitScale != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WeightedSoftmaxClassificationLoss other) { - if (other == null) { - return; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - if (other.LogitScale != 0F) { - LogitScale = other.LogitScale; - } - _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: { - AnchorwiseOutput = input.ReadBool(); - break; - } - case 21: { - LogitScale = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Classification loss using a softmax function over class predictions and - /// a softmax function over the groundtruth labels (assumed to be logits). - /// - public sealed partial class WeightedSoftmaxClassificationAgainstLogitsLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new WeightedSoftmaxClassificationAgainstLogitsLoss()); - 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[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSoftmaxClassificationAgainstLogitsLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSoftmaxClassificationAgainstLogitsLoss(WeightedSoftmaxClassificationAgainstLogitsLoss other) : this() { - anchorwiseOutput_ = other.anchorwiseOutput_; - logitScale_ = other.logitScale_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public WeightedSoftmaxClassificationAgainstLogitsLoss Clone() { - return new WeightedSoftmaxClassificationAgainstLogitsLoss(this); - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 1; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - /// Field number for the "logit_scale" field. - public const int LogitScaleFieldNumber = 2; - private float logitScale_; - /// - /// Scale and softmax groundtruth logits before calculating softmax - /// classification loss. Typically used for softmax distillation with teacher - /// annotations stored as logits. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LogitScale { - get { return logitScale_; } - set { - logitScale_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as WeightedSoftmaxClassificationAgainstLogitsLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(WeightedSoftmaxClassificationAgainstLogitsLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LogitScale, other.LogitScale)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.GetHashCode(); - if (LogitScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LogitScale); - 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 (AnchorwiseOutput != false) { - output.WriteRawTag(8); - output.WriteBool(AnchorwiseOutput); - } - if (LogitScale != 0F) { - output.WriteRawTag(21); - output.WriteFloat(LogitScale); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (LogitScale != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(WeightedSoftmaxClassificationAgainstLogitsLoss other) { - if (other == null) { - return; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - if (other.LogitScale != 0F) { - LogitScale = other.LogitScale; - } - _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: { - AnchorwiseOutput = input.ReadBool(); - break; - } - case 21: { - LogitScale = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Classification loss using a sigmoid function over the class prediction with - /// the highest prediction score. - /// - public sealed partial class BootstrappedSigmoidClassificationLoss : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BootstrappedSigmoidClassificationLoss()); - 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[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BootstrappedSigmoidClassificationLoss() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BootstrappedSigmoidClassificationLoss(BootstrappedSigmoidClassificationLoss other) : this() { - alpha_ = other.alpha_; - hardBootstrap_ = other.hardBootstrap_; - anchorwiseOutput_ = other.anchorwiseOutput_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BootstrappedSigmoidClassificationLoss Clone() { - return new BootstrappedSigmoidClassificationLoss(this); - } - - /// Field number for the "alpha" field. - public const int AlphaFieldNumber = 1; - private float alpha_; - /// - /// Interpolation weight between 0 and 1. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Alpha { - get { return alpha_; } - set { - alpha_ = value; - } - } - - /// Field number for the "hard_bootstrap" field. - public const int HardBootstrapFieldNumber = 2; - private bool hardBootstrap_; - /// - /// Whether hard boot strapping should be used or not. If true, will only use - /// one class favored by model. Othewise, will use all predicted class - /// probabilities. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool HardBootstrap { - get { return hardBootstrap_; } - set { - hardBootstrap_ = value; - } - } - - /// Field number for the "anchorwise_output" field. - public const int AnchorwiseOutputFieldNumber = 3; - private bool anchorwiseOutput_; - /// - /// DEPRECATED, do not use. - /// Output loss per anchor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AnchorwiseOutput { - get { return anchorwiseOutput_; } - set { - anchorwiseOutput_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BootstrappedSigmoidClassificationLoss); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BootstrappedSigmoidClassificationLoss other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Alpha, other.Alpha)) return false; - if (HardBootstrap != other.HardBootstrap) return false; - if (AnchorwiseOutput != other.AnchorwiseOutput) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Alpha != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Alpha); - if (HardBootstrap != false) hash ^= HardBootstrap.GetHashCode(); - if (AnchorwiseOutput != false) hash ^= AnchorwiseOutput.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 (Alpha != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Alpha); - } - if (HardBootstrap != false) { - output.WriteRawTag(16); - output.WriteBool(HardBootstrap); - } - if (AnchorwiseOutput != false) { - output.WriteRawTag(24); - output.WriteBool(AnchorwiseOutput); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Alpha != 0F) { - size += 1 + 4; - } - if (HardBootstrap != false) { - size += 1 + 1; - } - if (AnchorwiseOutput != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BootstrappedSigmoidClassificationLoss other) { - if (other == null) { - return; - } - if (other.Alpha != 0F) { - Alpha = other.Alpha; - } - if (other.HardBootstrap != false) { - HardBootstrap = other.HardBootstrap; - } - if (other.AnchorwiseOutput != false) { - AnchorwiseOutput = other.AnchorwiseOutput; - } - _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: { - Alpha = input.ReadFloat(); - break; - } - case 16: { - HardBootstrap = input.ReadBool(); - break; - } - case 24: { - AnchorwiseOutput = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Configuration for hard example miner. - /// - public sealed partial class HardExampleMiner : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HardExampleMiner()); - 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[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HardExampleMiner() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HardExampleMiner(HardExampleMiner other) : this() { - numHardExamples_ = other.numHardExamples_; - iouThreshold_ = other.iouThreshold_; - lossType_ = other.lossType_; - maxNegativesPerPositive_ = other.maxNegativesPerPositive_; - minNegativesPerImage_ = other.minNegativesPerImage_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public HardExampleMiner Clone() { - return new HardExampleMiner(this); - } - - /// Field number for the "num_hard_examples" field. - public const int NumHardExamplesFieldNumber = 1; - private int numHardExamples_; - /// - /// Maximum number of hard examples to be selected per image (prior to - /// enforcing max negative to positive ratio constraint). If set to 0, - /// all examples obtained after NMS are considered. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NumHardExamples { - get { return numHardExamples_; } - set { - numHardExamples_ = value; - } - } - - /// Field number for the "iou_threshold" field. - public const int IouThresholdFieldNumber = 2; - private float iouThreshold_; - /// - /// Minimum intersection over union for an example to be discarded during NMS. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float IouThreshold { - get { return iouThreshold_; } - set { - iouThreshold_ = value; - } - } - - /// Field number for the "loss_type" field. - public const int LossTypeFieldNumber = 3; - private global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner.Types.LossType lossType_ = 0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner.Types.LossType LossType { - get { return lossType_; } - set { - lossType_ = value; - } - } - - /// Field number for the "max_negatives_per_positive" field. - public const int MaxNegativesPerPositiveFieldNumber = 4; - private int maxNegativesPerPositive_; - /// - /// Maximum number of negatives to retain for each positive anchor. If - /// num_negatives_per_positive is 0 no prespecified negative:positive ratio is - /// enforced. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxNegativesPerPositive { - get { return maxNegativesPerPositive_; } - set { - maxNegativesPerPositive_ = value; - } - } - - /// Field number for the "min_negatives_per_image" field. - public const int MinNegativesPerImageFieldNumber = 5; - private int minNegativesPerImage_; - /// - /// Minimum number of negative anchors to sample for a given image. Setting - /// this to a positive number samples negatives in an image without any - /// positive anchors and thus not bias the model towards having at least one - /// detection per image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinNegativesPerImage { - get { return minNegativesPerImage_; } - set { - minNegativesPerImage_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as HardExampleMiner); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(HardExampleMiner other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (NumHardExamples != other.NumHardExamples) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IouThreshold, other.IouThreshold)) return false; - if (LossType != other.LossType) return false; - if (MaxNegativesPerPositive != other.MaxNegativesPerPositive) return false; - if (MinNegativesPerImage != other.MinNegativesPerImage) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (NumHardExamples != 0) hash ^= NumHardExamples.GetHashCode(); - if (IouThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IouThreshold); - if (LossType != 0) hash ^= LossType.GetHashCode(); - if (MaxNegativesPerPositive != 0) hash ^= MaxNegativesPerPositive.GetHashCode(); - if (MinNegativesPerImage != 0) hash ^= MinNegativesPerImage.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 (NumHardExamples != 0) { - output.WriteRawTag(8); - output.WriteInt32(NumHardExamples); - } - if (IouThreshold != 0F) { - output.WriteRawTag(21); - output.WriteFloat(IouThreshold); - } - if (LossType != 0) { - output.WriteRawTag(24); - output.WriteEnum((int) LossType); - } - if (MaxNegativesPerPositive != 0) { - output.WriteRawTag(32); - output.WriteInt32(MaxNegativesPerPositive); - } - if (MinNegativesPerImage != 0) { - output.WriteRawTag(40); - output.WriteInt32(MinNegativesPerImage); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (NumHardExamples != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumHardExamples); - } - if (IouThreshold != 0F) { - size += 1 + 4; - } - if (LossType != 0) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) LossType); - } - if (MaxNegativesPerPositive != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxNegativesPerPositive); - } - if (MinNegativesPerImage != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinNegativesPerImage); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(HardExampleMiner other) { - if (other == null) { - return; - } - if (other.NumHardExamples != 0) { - NumHardExamples = other.NumHardExamples; - } - if (other.IouThreshold != 0F) { - IouThreshold = other.IouThreshold; - } - if (other.LossType != 0) { - LossType = other.LossType; - } - if (other.MaxNegativesPerPositive != 0) { - MaxNegativesPerPositive = other.MaxNegativesPerPositive; - } - if (other.MinNegativesPerImage != 0) { - MinNegativesPerImage = other.MinNegativesPerImage; - } - _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: { - NumHardExamples = input.ReadInt32(); - break; - } - case 21: { - IouThreshold = input.ReadFloat(); - break; - } - case 24: { - lossType_ = (global::Tensorflow.Models.ObjectDetection.Protos.HardExampleMiner.Types.LossType) input.ReadEnum(); - break; - } - case 32: { - MaxNegativesPerPositive = input.ReadInt32(); - break; - } - case 40: { - MinNegativesPerImage = input.ReadInt32(); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the HardExampleMiner message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - /// - /// Whether to use classification losses ('cls', default), localization losses - /// ('loc') or both losses ('both'). In the case of 'both', cls_loss_weight and - /// loc_loss_weight are used to compute weighted sum of the two losses. - /// - public enum LossType { - [pbr::OriginalName("BOTH")] Both = 0, - [pbr::OriginalName("CLASSIFICATION")] Classification = 1, - [pbr::OriginalName("LOCALIZATION")] Localization = 2, - } - - } - #endregion - - } - - /// - /// Configuration for random example sampler. - /// - public sealed partial class RandomExampleSampler : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomExampleSampler()); - 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[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomExampleSampler() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomExampleSampler(RandomExampleSampler other) : this() { - positiveSampleFraction_ = other.positiveSampleFraction_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomExampleSampler Clone() { - return new RandomExampleSampler(this); - } - - /// Field number for the "positive_sample_fraction" field. - public const int PositiveSampleFractionFieldNumber = 1; - private float positiveSampleFraction_; - /// - /// The desired fraction of positive samples in batch when applying random - /// example sampling. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float PositiveSampleFraction { - get { return positiveSampleFraction_; } - set { - positiveSampleFraction_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomExampleSampler); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomExampleSampler other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PositiveSampleFraction, other.PositiveSampleFraction)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (PositiveSampleFraction != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PositiveSampleFraction); - 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 (PositiveSampleFraction != 0F) { - output.WriteRawTag(13); - output.WriteFloat(PositiveSampleFraction); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (PositiveSampleFraction != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomExampleSampler other) { - if (other == null) { - return; - } - if (other.PositiveSampleFraction != 0F) { - PositiveSampleFraction = other.PositiveSampleFraction; - } - _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: { - PositiveSampleFraction = input.ReadFloat(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Matcher.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Matcher.cs deleted file mode 100644 index 72aa0188..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Matcher.cs +++ /dev/null @@ -1,257 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/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/matcher.proto - public static partial class MatcherReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/matcher.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static MatcherReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiVvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9tYXRjaGVyLnByb3RvEhdvYmpl", - "Y3RfZGV0ZWN0aW9uLnByb3Rvcxosb2JqZWN0X2RldGVjdGlvbi9wcm90b3Mv", - "YXJnbWF4X21hdGNoZXIucHJvdG8aL29iamVjdF9kZXRlY3Rpb24vcHJvdG9z", - "L2JpcGFydGl0ZV9tYXRjaGVyLnByb3RvIqQBCgdNYXRjaGVyEkAKDmFyZ21h", - "eF9tYXRjaGVyGAEgASgLMiYub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuQXJn", - "TWF4TWF0Y2hlckgAEkYKEWJpcGFydGl0ZV9tYXRjaGVyGAIgASgLMikub2Jq", - "ZWN0X2RldGVjdGlvbi5wcm90b3MuQmlwYXJ0aXRlTWF0Y2hlckgAQg8KDW1h", - "dGNoZXJfb25lb2ZiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.ArgmaxMatcherReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcherReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Matcher), global::Tensorflow.Models.ObjectDetection.Protos.Matcher.Parser, new[]{ "ArgmaxMatcher", "BipartiteMatcher" }, new[]{ "MatcherOneof" }, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for the matcher to be used in the object detection - /// pipeline. See core/matcher.py for details. - /// - public sealed partial class Matcher : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Matcher()); - 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.MatcherReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Matcher() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Matcher(Matcher other) : this() { - switch (other.MatcherOneofCase) { - case MatcherOneofOneofCase.ArgmaxMatcher: - ArgmaxMatcher = other.ArgmaxMatcher.Clone(); - break; - case MatcherOneofOneofCase.BipartiteMatcher: - BipartiteMatcher = other.BipartiteMatcher.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Matcher Clone() { - return new Matcher(this); - } - - /// Field number for the "argmax_matcher" field. - public const int ArgmaxMatcherFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ArgMaxMatcher ArgmaxMatcher { - get { return matcherOneofCase_ == MatcherOneofOneofCase.ArgmaxMatcher ? (global::Tensorflow.Models.ObjectDetection.Protos.ArgMaxMatcher) matcherOneof_ : null; } - set { - matcherOneof_ = value; - matcherOneofCase_ = value == null ? MatcherOneofOneofCase.None : MatcherOneofOneofCase.ArgmaxMatcher; - } - } - - /// Field number for the "bipartite_matcher" field. - public const int BipartiteMatcherFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher BipartiteMatcher { - get { return matcherOneofCase_ == MatcherOneofOneofCase.BipartiteMatcher ? (global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher) matcherOneof_ : null; } - set { - matcherOneof_ = value; - matcherOneofCase_ = value == null ? MatcherOneofOneofCase.None : MatcherOneofOneofCase.BipartiteMatcher; - } - } - - private object matcherOneof_; - /// Enum of possible cases for the "matcher_oneof" oneof. - public enum MatcherOneofOneofCase { - None = 0, - ArgmaxMatcher = 1, - BipartiteMatcher = 2, - } - private MatcherOneofOneofCase matcherOneofCase_ = MatcherOneofOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MatcherOneofOneofCase MatcherOneofCase { - get { return matcherOneofCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearMatcherOneof() { - matcherOneofCase_ = MatcherOneofOneofCase.None; - matcherOneof_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Matcher); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Matcher other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(ArgmaxMatcher, other.ArgmaxMatcher)) return false; - if (!object.Equals(BipartiteMatcher, other.BipartiteMatcher)) return false; - if (MatcherOneofCase != other.MatcherOneofCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (matcherOneofCase_ == MatcherOneofOneofCase.ArgmaxMatcher) hash ^= ArgmaxMatcher.GetHashCode(); - if (matcherOneofCase_ == MatcherOneofOneofCase.BipartiteMatcher) hash ^= BipartiteMatcher.GetHashCode(); - hash ^= (int) matcherOneofCase_; - 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 (matcherOneofCase_ == MatcherOneofOneofCase.ArgmaxMatcher) { - output.WriteRawTag(10); - output.WriteMessage(ArgmaxMatcher); - } - if (matcherOneofCase_ == MatcherOneofOneofCase.BipartiteMatcher) { - output.WriteRawTag(18); - output.WriteMessage(BipartiteMatcher); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (matcherOneofCase_ == MatcherOneofOneofCase.ArgmaxMatcher) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ArgmaxMatcher); - } - if (matcherOneofCase_ == MatcherOneofOneofCase.BipartiteMatcher) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BipartiteMatcher); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Matcher other) { - if (other == null) { - return; - } - switch (other.MatcherOneofCase) { - case MatcherOneofOneofCase.ArgmaxMatcher: - if (ArgmaxMatcher == null) { - ArgmaxMatcher = new global::Tensorflow.Models.ObjectDetection.Protos.ArgMaxMatcher(); - } - ArgmaxMatcher.MergeFrom(other.ArgmaxMatcher); - break; - case MatcherOneofOneofCase.BipartiteMatcher: - if (BipartiteMatcher == null) { - BipartiteMatcher = new global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher(); - } - BipartiteMatcher.MergeFrom(other.BipartiteMatcher); - 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.ArgMaxMatcher subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ArgMaxMatcher(); - if (matcherOneofCase_ == MatcherOneofOneofCase.ArgmaxMatcher) { - subBuilder.MergeFrom(ArgmaxMatcher); - } - input.ReadMessage(subBuilder); - ArgmaxMatcher = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.BipartiteMatcher(); - if (matcherOneofCase_ == MatcherOneofOneofCase.BipartiteMatcher) { - subBuilder.MergeFrom(BipartiteMatcher); - } - input.ReadMessage(subBuilder); - BipartiteMatcher = subBuilder; - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/MeanStddevBoxCoder.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/MeanStddevBoxCoder.cs deleted file mode 100644 index a5cf55a7..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/MeanStddevBoxCoder.cs +++ /dev/null @@ -1,180 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/mean_stddev_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/mean_stddev_box_coder.proto - public static partial class MeanStddevBoxCoderReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/mean_stddev_box_coder.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static MeanStddevBoxCoderReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9tZWFuX3N0ZGRldl9ib3hfY29k", - "ZXIucHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zIiQKEk1lYW5TdGRk", - "ZXZCb3hDb2RlchIOCgZzdGRkZXYYASABKAJiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder), global::Tensorflow.Models.ObjectDetection.Protos.MeanStddevBoxCoder.Parser, new[]{ "Stddev" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for MeanStddevBoxCoder. See - /// box_coders/mean_stddev_box_coder.py for details. - /// - public sealed partial class MeanStddevBoxCoder : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MeanStddevBoxCoder()); - 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.MeanStddevBoxCoderReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MeanStddevBoxCoder() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MeanStddevBoxCoder(MeanStddevBoxCoder other) : this() { - stddev_ = other.stddev_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MeanStddevBoxCoder Clone() { - return new MeanStddevBoxCoder(this); - } - - /// Field number for the "stddev" field. - public const int StddevFieldNumber = 1; - private float stddev_; - /// - /// The standard deviation used to encode and decode boxes. - /// - [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 MeanStddevBoxCoder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(MeanStddevBoxCoder other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - 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 (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 (Stddev != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Stddev); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Stddev != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(MeanStddevBoxCoder other) { - if (other == null) { - return; - } - 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: { - Stddev = input.ReadFloat(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Model.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Model.cs deleted file mode 100644 index 11001ac6..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Model.cs +++ /dev/null @@ -1,255 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/model.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/model.proto - public static partial class ModelReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/model.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static ModelReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9tb2RlbC5wcm90bxIXb2JqZWN0", - "X2RldGVjdGlvbi5wcm90b3MaKW9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL2Zh", - "c3Rlcl9yY25uLnByb3RvGiFvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9zc2Qu", - "cHJvdG8iggEKDkRldGVjdGlvbk1vZGVsEjoKC2Zhc3Rlcl9yY25uGAEgASgL", - "MiMub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuRmFzdGVyUmNubkgAEisKA3Nz", - "ZBgCIAEoCzIcLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlNzZEgAQgcKBW1v", - "ZGVsYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnnReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.SsdReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.DetectionModel), global::Tensorflow.Models.ObjectDetection.Protos.DetectionModel.Parser, new[]{ "FasterRcnn", "Ssd" }, new[]{ "Model" }, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Top level configuration for DetectionModels. - /// - public sealed partial class DetectionModel : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DetectionModel()); - 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.ModelReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DetectionModel() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DetectionModel(DetectionModel other) : this() { - switch (other.ModelCase) { - case ModelOneofCase.FasterRcnn: - FasterRcnn = other.FasterRcnn.Clone(); - break; - case ModelOneofCase.Ssd: - Ssd = other.Ssd.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DetectionModel Clone() { - return new DetectionModel(this); - } - - /// Field number for the "faster_rcnn" field. - public const int FasterRcnnFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnn FasterRcnn { - get { return modelCase_ == ModelOneofCase.FasterRcnn ? (global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnn) model_ : null; } - set { - model_ = value; - modelCase_ = value == null ? ModelOneofCase.None : ModelOneofCase.FasterRcnn; - } - } - - /// Field number for the "ssd" field. - public const int SsdFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.Ssd Ssd { - get { return modelCase_ == ModelOneofCase.Ssd ? (global::Tensorflow.Models.ObjectDetection.Protos.Ssd) model_ : null; } - set { - model_ = value; - modelCase_ = value == null ? ModelOneofCase.None : ModelOneofCase.Ssd; - } - } - - private object model_; - /// Enum of possible cases for the "model" oneof. - public enum ModelOneofCase { - None = 0, - FasterRcnn = 1, - Ssd = 2, - } - private ModelOneofCase modelCase_ = ModelOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ModelOneofCase ModelCase { - get { return modelCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearModel() { - modelCase_ = ModelOneofCase.None; - model_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DetectionModel); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DetectionModel other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(FasterRcnn, other.FasterRcnn)) return false; - if (!object.Equals(Ssd, other.Ssd)) return false; - if (ModelCase != other.ModelCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (modelCase_ == ModelOneofCase.FasterRcnn) hash ^= FasterRcnn.GetHashCode(); - if (modelCase_ == ModelOneofCase.Ssd) hash ^= Ssd.GetHashCode(); - hash ^= (int) modelCase_; - 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 (modelCase_ == ModelOneofCase.FasterRcnn) { - output.WriteRawTag(10); - output.WriteMessage(FasterRcnn); - } - if (modelCase_ == ModelOneofCase.Ssd) { - output.WriteRawTag(18); - output.WriteMessage(Ssd); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (modelCase_ == ModelOneofCase.FasterRcnn) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(FasterRcnn); - } - if (modelCase_ == ModelOneofCase.Ssd) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Ssd); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DetectionModel other) { - if (other == null) { - return; - } - switch (other.ModelCase) { - case ModelOneofCase.FasterRcnn: - if (FasterRcnn == null) { - FasterRcnn = new global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnn(); - } - FasterRcnn.MergeFrom(other.FasterRcnn); - break; - case ModelOneofCase.Ssd: - if (Ssd == null) { - Ssd = new global::Tensorflow.Models.ObjectDetection.Protos.Ssd(); - } - Ssd.MergeFrom(other.Ssd); - 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.FasterRcnn subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.FasterRcnn(); - if (modelCase_ == ModelOneofCase.FasterRcnn) { - subBuilder.MergeFrom(FasterRcnn); - } - input.ReadMessage(subBuilder); - FasterRcnn = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.Ssd subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.Ssd(); - if (modelCase_ == ModelOneofCase.Ssd) { - subBuilder.MergeFrom(Ssd); - } - input.ReadMessage(subBuilder); - Ssd = subBuilder; - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/MultiscaleAnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/MultiscaleAnchorGenerator.cs deleted file mode 100644 index b4d577fc..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/MultiscaleAnchorGenerator.cs +++ /dev/null @@ -1,332 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/multiscale_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/multiscale_anchor_generator.proto - public static partial class MultiscaleAnchorGeneratorReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/multiscale_anchor_generator.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static MultiscaleAnchorGeneratorReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjlvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9tdWx0aXNjYWxlX2FuY2hvcl9n", - "ZW5lcmF0b3IucHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zIqgBChlN", - "dWx0aXNjYWxlQW5jaG9yR2VuZXJhdG9yEhEKCW1pbl9sZXZlbBgBIAEoBRIR", - "CgltYXhfbGV2ZWwYAiABKAUSFAoMYW5jaG9yX3NjYWxlGAMgASgCEhUKDWFz", - "cGVjdF9yYXRpb3MYBCADKAISGQoRc2NhbGVzX3Blcl9vY3RhdmUYBSABKAUS", - "HQoVbm9ybWFsaXplX2Nvb3JkaW5hdGVzGAYgASgIYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator), global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGenerator.Parser, new[]{ "MinLevel", "MaxLevel", "AnchorScale", "AspectRatios", "ScalesPerOctave", "NormalizeCoordinates" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for RetinaNet anchor generator described in - /// https://arxiv.org/abs/1708.02002. See - /// anchor_generators/multiscale_grid_anchor_generator.py for details. - /// - public sealed partial class MultiscaleAnchorGenerator : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MultiscaleAnchorGenerator()); - 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.MultiscaleAnchorGeneratorReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MultiscaleAnchorGenerator() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MultiscaleAnchorGenerator(MultiscaleAnchorGenerator other) : this() { - minLevel_ = other.minLevel_; - maxLevel_ = other.maxLevel_; - anchorScale_ = other.anchorScale_; - aspectRatios_ = other.aspectRatios_.Clone(); - scalesPerOctave_ = other.scalesPerOctave_; - normalizeCoordinates_ = other.normalizeCoordinates_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MultiscaleAnchorGenerator Clone() { - return new MultiscaleAnchorGenerator(this); - } - - /// Field number for the "min_level" field. - public const int MinLevelFieldNumber = 1; - private int minLevel_; - /// - /// minimum level in feature pyramid - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinLevel { - get { return minLevel_; } - set { - minLevel_ = value; - } - } - - /// Field number for the "max_level" field. - public const int MaxLevelFieldNumber = 2; - private int maxLevel_; - /// - /// maximum level in feature pyramid - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxLevel { - get { return maxLevel_; } - set { - maxLevel_ = value; - } - } - - /// Field number for the "anchor_scale" field. - public const int AnchorScaleFieldNumber = 3; - private float anchorScale_; - /// - /// Scale of anchor to feature stride - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float AnchorScale { - get { return anchorScale_; } - set { - anchorScale_ = value; - } - } - - /// Field number for the "aspect_ratios" field. - public const int AspectRatiosFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_aspectRatios_codec - = pb::FieldCodec.ForFloat(34); - private readonly pbc::RepeatedField aspectRatios_ = new pbc::RepeatedField(); - /// - /// Aspect ratios for anchors at each grid point. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField AspectRatios { - get { return aspectRatios_; } - } - - /// Field number for the "scales_per_octave" field. - public const int ScalesPerOctaveFieldNumber = 5; - private int scalesPerOctave_; - /// - /// Number of intermediate scale each scale octave - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int ScalesPerOctave { - get { return scalesPerOctave_; } - set { - scalesPerOctave_ = value; - } - } - - /// Field number for the "normalize_coordinates" field. - public const int NormalizeCoordinatesFieldNumber = 6; - 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 MultiscaleAnchorGenerator); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(MultiscaleAnchorGenerator other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MinLevel != other.MinLevel) return false; - if (MaxLevel != other.MaxLevel) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AnchorScale, other.AnchorScale)) return false; - if(!aspectRatios_.Equals(other.aspectRatios_)) return false; - if (ScalesPerOctave != other.ScalesPerOctave) return false; - if (NormalizeCoordinates != other.NormalizeCoordinates) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinLevel != 0) hash ^= MinLevel.GetHashCode(); - if (MaxLevel != 0) hash ^= MaxLevel.GetHashCode(); - if (AnchorScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AnchorScale); - hash ^= aspectRatios_.GetHashCode(); - if (ScalesPerOctave != 0) hash ^= ScalesPerOctave.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) { - if (MinLevel != 0) { - output.WriteRawTag(8); - output.WriteInt32(MinLevel); - } - if (MaxLevel != 0) { - output.WriteRawTag(16); - output.WriteInt32(MaxLevel); - } - if (AnchorScale != 0F) { - output.WriteRawTag(29); - output.WriteFloat(AnchorScale); - } - aspectRatios_.WriteTo(output, _repeated_aspectRatios_codec); - if (ScalesPerOctave != 0) { - output.WriteRawTag(40); - output.WriteInt32(ScalesPerOctave); - } - if (NormalizeCoordinates != false) { - output.WriteRawTag(48); - output.WriteBool(NormalizeCoordinates); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinLevel != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinLevel); - } - if (MaxLevel != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxLevel); - } - if (AnchorScale != 0F) { - size += 1 + 4; - } - size += aspectRatios_.CalculateSize(_repeated_aspectRatios_codec); - if (ScalesPerOctave != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(ScalesPerOctave); - } - if (NormalizeCoordinates != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(MultiscaleAnchorGenerator other) { - if (other == null) { - return; - } - if (other.MinLevel != 0) { - MinLevel = other.MinLevel; - } - if (other.MaxLevel != 0) { - MaxLevel = other.MaxLevel; - } - if (other.AnchorScale != 0F) { - AnchorScale = other.AnchorScale; - } - aspectRatios_.Add(other.aspectRatios_); - if (other.ScalesPerOctave != 0) { - ScalesPerOctave = other.ScalesPerOctave; - } - 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 8: { - MinLevel = input.ReadInt32(); - break; - } - case 16: { - MaxLevel = input.ReadInt32(); - break; - } - case 29: { - AnchorScale = input.ReadFloat(); - break; - } - case 34: - case 37: { - aspectRatios_.AddEntriesFrom(input, _repeated_aspectRatios_codec); - break; - } - case 40: { - ScalesPerOctave = input.ReadInt32(); - break; - } - case 48: { - NormalizeCoordinates = input.ReadBool(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Optimizer.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Optimizer.cs deleted file mode 100644 index c71adfa8..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Optimizer.cs +++ /dev/null @@ -1,2231 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/optimizer.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/optimizer.proto - public static partial class OptimizerReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/optimizer.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static OptimizerReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CidvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9vcHRpbWl6ZXIucHJvdG8SF29i", - "amVjdF9kZXRlY3Rpb24ucHJvdG9zIqcCCglPcHRpbWl6ZXISRwoScm1zX3By", - "b3Bfb3B0aW1pemVyGAEgASgLMikub2JqZWN0X2RldGVjdGlvbi5wcm90b3Mu", - "Uk1TUHJvcE9wdGltaXplckgAEkgKEm1vbWVudHVtX29wdGltaXplchgCIAEo", - "CzIqLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLk1vbWVudHVtT3B0aW1pemVy", - "SAASQAoOYWRhbV9vcHRpbWl6ZXIYAyABKAsyJi5vYmplY3RfZGV0ZWN0aW9u", - "LnByb3Rvcy5BZGFtT3B0aW1pemVySAASGgoSdXNlX21vdmluZ19hdmVyYWdl", - "GAQgASgIEhwKFG1vdmluZ19hdmVyYWdlX2RlY2F5GAUgASgCQgsKCW9wdGlt", - "aXplciKSAQoQUk1TUHJvcE9wdGltaXplchI8Cg1sZWFybmluZ19yYXRlGAEg", - "ASgLMiUub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuTGVhcm5pbmdSYXRlEiAK", - "GG1vbWVudHVtX29wdGltaXplcl92YWx1ZRgCIAEoAhINCgVkZWNheRgDIAEo", - "AhIPCgdlcHNpbG9uGAQgASgCInMKEU1vbWVudHVtT3B0aW1pemVyEjwKDWxl", - "YXJuaW5nX3JhdGUYASABKAsyJS5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5M", - "ZWFybmluZ1JhdGUSIAoYbW9tZW50dW1fb3B0aW1pemVyX3ZhbHVlGAIgASgC", - "Ik0KDUFkYW1PcHRpbWl6ZXISPAoNbGVhcm5pbmdfcmF0ZRgBIAEoCzIlLm9i", - "amVjdF9kZXRlY3Rpb24ucHJvdG9zLkxlYXJuaW5nUmF0ZSKAAwoMTGVhcm5p", - "bmdSYXRlEk8KFmNvbnN0YW50X2xlYXJuaW5nX3JhdGUYASABKAsyLS5vYmpl", - "Y3RfZGV0ZWN0aW9uLnByb3Rvcy5Db25zdGFudExlYXJuaW5nUmF0ZUgAEmAK", - "H2V4cG9uZW50aWFsX2RlY2F5X2xlYXJuaW5nX3JhdGUYAiABKAsyNS5vYmpl", - "Y3RfZGV0ZWN0aW9uLnByb3Rvcy5FeHBvbmVudGlhbERlY2F5TGVhcm5pbmdS", - "YXRlSAASVAoZbWFudWFsX3N0ZXBfbGVhcm5pbmdfcmF0ZRgDIAEoCzIvLm9i", - "amVjdF9kZXRlY3Rpb24ucHJvdG9zLk1hbnVhbFN0ZXBMZWFybmluZ1JhdGVI", - "ABJWChpjb3NpbmVfZGVjYXlfbGVhcm5pbmdfcmF0ZRgEIAEoCzIwLm9iamVj", - "dF9kZXRlY3Rpb24ucHJvdG9zLkNvc2luZURlY2F5TGVhcm5pbmdSYXRlSABC", - "DwoNbGVhcm5pbmdfcmF0ZSItChRDb25zdGFudExlYXJuaW5nUmF0ZRIVCg1s", - "ZWFybmluZ19yYXRlGAEgASgCIsoBChxFeHBvbmVudGlhbERlY2F5TGVhcm5p", - "bmdSYXRlEh0KFWluaXRpYWxfbGVhcm5pbmdfcmF0ZRgBIAEoAhITCgtkZWNh", - "eV9zdGVwcxgCIAEoDRIUCgxkZWNheV9mYWN0b3IYAyABKAISEQoJc3RhaXJj", - "YXNlGAQgASgIEhwKFGJ1cm5pbl9sZWFybmluZ19yYXRlGAUgASgCEhQKDGJ1", - "cm5pbl9zdGVwcxgGIAEoDRIZChFtaW5fbGVhcm5pbmdfcmF0ZRgHIAEoAiLc", - "AQoWTWFudWFsU3RlcExlYXJuaW5nUmF0ZRIdChVpbml0aWFsX2xlYXJuaW5n", - "X3JhdGUYASABKAISVgoIc2NoZWR1bGUYAiADKAsyRC5vYmplY3RfZGV0ZWN0", - "aW9uLnByb3Rvcy5NYW51YWxTdGVwTGVhcm5pbmdSYXRlLkxlYXJuaW5nUmF0", - "ZVNjaGVkdWxlEg4KBndhcm11cBgDIAEoCBo7ChRMZWFybmluZ1JhdGVTY2hl", - "ZHVsZRIMCgRzdGVwGAEgASgNEhUKDWxlYXJuaW5nX3JhdGUYAiABKAIinAEK", - "F0Nvc2luZURlY2F5TGVhcm5pbmdSYXRlEhoKEmxlYXJuaW5nX3JhdGVfYmFz", - "ZRgBIAEoAhITCgt0b3RhbF9zdGVwcxgCIAEoDRIcChR3YXJtdXBfbGVhcm5p", - "bmdfcmF0ZRgDIAEoAhIUCgx3YXJtdXBfc3RlcHMYBCABKA0SHAoUaG9sZF9i", - "YXNlX3JhdGVfc3RlcHMYBSABKA1iBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Optimizer), global::Tensorflow.Models.ObjectDetection.Protos.Optimizer.Parser, new[]{ "RmsPropOptimizer", "MomentumOptimizer", "AdamOptimizer", "UseMovingAverage", "MovingAverageDecay" }, new[]{ "Optimizer" }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RMSPropOptimizer), global::Tensorflow.Models.ObjectDetection.Protos.RMSPropOptimizer.Parser, new[]{ "LearningRate", "MomentumOptimizerValue", "Decay", "Epsilon" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer), global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer.Parser, new[]{ "LearningRate", "MomentumOptimizerValue" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer), global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer.Parser, new[]{ "LearningRate" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.LearningRate), global::Tensorflow.Models.ObjectDetection.Protos.LearningRate.Parser, new[]{ "ConstantLearningRate", "ExponentialDecayLearningRate", "ManualStepLearningRate", "CosineDecayLearningRate" }, new[]{ "LearningRate" }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ConstantLearningRate), global::Tensorflow.Models.ObjectDetection.Protos.ConstantLearningRate.Parser, new[]{ "LearningRate" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate), global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate.Parser, new[]{ "InitialLearningRate", "DecaySteps", "DecayFactor", "Staircase", "BurninLearningRate", "BurninSteps", "MinLearningRate" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate), global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate.Parser, new[]{ "InitialLearningRate", "Schedule", "Warmup" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate.Types.LearningRateSchedule), global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate.Types.LearningRateSchedule.Parser, new[]{ "Step", "LearningRate" }, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate), global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate.Parser, new[]{ "LearningRateBase", "TotalSteps", "WarmupLearningRate", "WarmupSteps", "HoldBaseRateSteps" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Top level optimizer message. - /// - public sealed partial class Optimizer : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Optimizer()); - 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.OptimizerReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Optimizer() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Optimizer(Optimizer other) : this() { - useMovingAverage_ = other.useMovingAverage_; - movingAverageDecay_ = other.movingAverageDecay_; - switch (other.OptimizerCase) { - case OptimizerOneofCase.RmsPropOptimizer: - RmsPropOptimizer = other.RmsPropOptimizer.Clone(); - break; - case OptimizerOneofCase.MomentumOptimizer: - MomentumOptimizer = other.MomentumOptimizer.Clone(); - break; - case OptimizerOneofCase.AdamOptimizer: - AdamOptimizer = other.AdamOptimizer.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Optimizer Clone() { - return new Optimizer(this); - } - - /// Field number for the "rms_prop_optimizer" field. - public const int RmsPropOptimizerFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RMSPropOptimizer RmsPropOptimizer { - get { return optimizerCase_ == OptimizerOneofCase.RmsPropOptimizer ? (global::Tensorflow.Models.ObjectDetection.Protos.RMSPropOptimizer) optimizer_ : null; } - set { - optimizer_ = value; - optimizerCase_ = value == null ? OptimizerOneofCase.None : OptimizerOneofCase.RmsPropOptimizer; - } - } - - /// Field number for the "momentum_optimizer" field. - public const int MomentumOptimizerFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer MomentumOptimizer { - get { return optimizerCase_ == OptimizerOneofCase.MomentumOptimizer ? (global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer) optimizer_ : null; } - set { - optimizer_ = value; - optimizerCase_ = value == null ? OptimizerOneofCase.None : OptimizerOneofCase.MomentumOptimizer; - } - } - - /// Field number for the "adam_optimizer" field. - public const int AdamOptimizerFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer AdamOptimizer { - get { return optimizerCase_ == OptimizerOneofCase.AdamOptimizer ? (global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer) optimizer_ : null; } - set { - optimizer_ = value; - optimizerCase_ = value == null ? OptimizerOneofCase.None : OptimizerOneofCase.AdamOptimizer; - } - } - - /// Field number for the "use_moving_average" field. - public const int UseMovingAverageFieldNumber = 4; - private bool useMovingAverage_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseMovingAverage { - get { return useMovingAverage_; } - set { - useMovingAverage_ = value; - } - } - - /// Field number for the "moving_average_decay" field. - public const int MovingAverageDecayFieldNumber = 5; - private float movingAverageDecay_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MovingAverageDecay { - get { return movingAverageDecay_; } - set { - movingAverageDecay_ = value; - } - } - - private object optimizer_; - /// Enum of possible cases for the "optimizer" oneof. - public enum OptimizerOneofCase { - None = 0, - RmsPropOptimizer = 1, - MomentumOptimizer = 2, - AdamOptimizer = 3, - } - private OptimizerOneofCase optimizerCase_ = OptimizerOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public OptimizerOneofCase OptimizerCase { - get { return optimizerCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearOptimizer() { - optimizerCase_ = OptimizerOneofCase.None; - optimizer_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Optimizer); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Optimizer other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(RmsPropOptimizer, other.RmsPropOptimizer)) return false; - if (!object.Equals(MomentumOptimizer, other.MomentumOptimizer)) return false; - if (!object.Equals(AdamOptimizer, other.AdamOptimizer)) return false; - if (UseMovingAverage != other.UseMovingAverage) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MovingAverageDecay, other.MovingAverageDecay)) return false; - if (OptimizerCase != other.OptimizerCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (optimizerCase_ == OptimizerOneofCase.RmsPropOptimizer) hash ^= RmsPropOptimizer.GetHashCode(); - if (optimizerCase_ == OptimizerOneofCase.MomentumOptimizer) hash ^= MomentumOptimizer.GetHashCode(); - if (optimizerCase_ == OptimizerOneofCase.AdamOptimizer) hash ^= AdamOptimizer.GetHashCode(); - if (UseMovingAverage != false) hash ^= UseMovingAverage.GetHashCode(); - if (MovingAverageDecay != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MovingAverageDecay); - hash ^= (int) optimizerCase_; - 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 (optimizerCase_ == OptimizerOneofCase.RmsPropOptimizer) { - output.WriteRawTag(10); - output.WriteMessage(RmsPropOptimizer); - } - if (optimizerCase_ == OptimizerOneofCase.MomentumOptimizer) { - output.WriteRawTag(18); - output.WriteMessage(MomentumOptimizer); - } - if (optimizerCase_ == OptimizerOneofCase.AdamOptimizer) { - output.WriteRawTag(26); - output.WriteMessage(AdamOptimizer); - } - if (UseMovingAverage != false) { - output.WriteRawTag(32); - output.WriteBool(UseMovingAverage); - } - if (MovingAverageDecay != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MovingAverageDecay); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (optimizerCase_ == OptimizerOneofCase.RmsPropOptimizer) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RmsPropOptimizer); - } - if (optimizerCase_ == OptimizerOneofCase.MomentumOptimizer) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(MomentumOptimizer); - } - if (optimizerCase_ == OptimizerOneofCase.AdamOptimizer) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AdamOptimizer); - } - if (UseMovingAverage != false) { - size += 1 + 1; - } - if (MovingAverageDecay != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Optimizer other) { - if (other == null) { - return; - } - if (other.UseMovingAverage != false) { - UseMovingAverage = other.UseMovingAverage; - } - if (other.MovingAverageDecay != 0F) { - MovingAverageDecay = other.MovingAverageDecay; - } - switch (other.OptimizerCase) { - case OptimizerOneofCase.RmsPropOptimizer: - if (RmsPropOptimizer == null) { - RmsPropOptimizer = new global::Tensorflow.Models.ObjectDetection.Protos.RMSPropOptimizer(); - } - RmsPropOptimizer.MergeFrom(other.RmsPropOptimizer); - break; - case OptimizerOneofCase.MomentumOptimizer: - if (MomentumOptimizer == null) { - MomentumOptimizer = new global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer(); - } - MomentumOptimizer.MergeFrom(other.MomentumOptimizer); - break; - case OptimizerOneofCase.AdamOptimizer: - if (AdamOptimizer == null) { - AdamOptimizer = new global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer(); - } - AdamOptimizer.MergeFrom(other.AdamOptimizer); - 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.RMSPropOptimizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RMSPropOptimizer(); - if (optimizerCase_ == OptimizerOneofCase.RmsPropOptimizer) { - subBuilder.MergeFrom(RmsPropOptimizer); - } - input.ReadMessage(subBuilder); - RmsPropOptimizer = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.MomentumOptimizer(); - if (optimizerCase_ == OptimizerOneofCase.MomentumOptimizer) { - subBuilder.MergeFrom(MomentumOptimizer); - } - input.ReadMessage(subBuilder); - MomentumOptimizer = subBuilder; - break; - } - case 26: { - global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.AdamOptimizer(); - if (optimizerCase_ == OptimizerOneofCase.AdamOptimizer) { - subBuilder.MergeFrom(AdamOptimizer); - } - input.ReadMessage(subBuilder); - AdamOptimizer = subBuilder; - break; - } - case 32: { - UseMovingAverage = input.ReadBool(); - break; - } - case 45: { - MovingAverageDecay = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Configuration message for the RMSPropOptimizer - /// See: https://www.tensorflow.org/api_docs/python/tf/train/RMSPropOptimizer - /// - public sealed partial class RMSPropOptimizer : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RMSPropOptimizer()); - 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.OptimizerReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RMSPropOptimizer() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RMSPropOptimizer(RMSPropOptimizer other) : this() { - learningRate_ = other.learningRate_ != null ? other.learningRate_.Clone() : null; - momentumOptimizerValue_ = other.momentumOptimizerValue_; - decay_ = other.decay_; - epsilon_ = other.epsilon_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RMSPropOptimizer Clone() { - return new RMSPropOptimizer(this); - } - - /// Field number for the "learning_rate" field. - public const int LearningRateFieldNumber = 1; - private global::Tensorflow.Models.ObjectDetection.Protos.LearningRate learningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.LearningRate LearningRate { - get { return learningRate_; } - set { - learningRate_ = value; - } - } - - /// Field number for the "momentum_optimizer_value" field. - public const int MomentumOptimizerValueFieldNumber = 2; - private float momentumOptimizerValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MomentumOptimizerValue { - get { return momentumOptimizerValue_; } - set { - momentumOptimizerValue_ = value; - } - } - - /// Field number for the "decay" field. - public const int DecayFieldNumber = 3; - private float decay_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Decay { - get { return decay_; } - set { - decay_ = 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; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RMSPropOptimizer); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RMSPropOptimizer other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(LearningRate, other.LearningRate)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MomentumOptimizerValue, other.MomentumOptimizerValue)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Decay, other.Decay)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Epsilon, other.Epsilon)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (learningRate_ != null) hash ^= LearningRate.GetHashCode(); - if (MomentumOptimizerValue != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MomentumOptimizerValue); - if (Decay != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Decay); - if (Epsilon != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Epsilon); - 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 (learningRate_ != null) { - output.WriteRawTag(10); - output.WriteMessage(LearningRate); - } - if (MomentumOptimizerValue != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MomentumOptimizerValue); - } - if (Decay != 0F) { - output.WriteRawTag(29); - output.WriteFloat(Decay); - } - if (Epsilon != 0F) { - output.WriteRawTag(37); - output.WriteFloat(Epsilon); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (learningRate_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(LearningRate); - } - if (MomentumOptimizerValue != 0F) { - size += 1 + 4; - } - if (Decay != 0F) { - size += 1 + 4; - } - if (Epsilon != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RMSPropOptimizer other) { - if (other == null) { - return; - } - if (other.learningRate_ != null) { - if (learningRate_ == null) { - learningRate_ = new global::Tensorflow.Models.ObjectDetection.Protos.LearningRate(); - } - LearningRate.MergeFrom(other.LearningRate); - } - if (other.MomentumOptimizerValue != 0F) { - MomentumOptimizerValue = other.MomentumOptimizerValue; - } - if (other.Decay != 0F) { - Decay = other.Decay; - } - if (other.Epsilon != 0F) { - Epsilon = other.Epsilon; - } - _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 (learningRate_ == null) { - learningRate_ = new global::Tensorflow.Models.ObjectDetection.Protos.LearningRate(); - } - input.ReadMessage(learningRate_); - break; - } - case 21: { - MomentumOptimizerValue = input.ReadFloat(); - break; - } - case 29: { - Decay = input.ReadFloat(); - break; - } - case 37: { - Epsilon = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Configuration message for the MomentumOptimizer - /// See: https://www.tensorflow.org/api_docs/python/tf/train/MomentumOptimizer - /// - public sealed partial class MomentumOptimizer : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MomentumOptimizer()); - 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.OptimizerReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MomentumOptimizer() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MomentumOptimizer(MomentumOptimizer other) : this() { - learningRate_ = other.learningRate_ != null ? other.learningRate_.Clone() : null; - momentumOptimizerValue_ = other.momentumOptimizerValue_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MomentumOptimizer Clone() { - return new MomentumOptimizer(this); - } - - /// Field number for the "learning_rate" field. - public const int LearningRateFieldNumber = 1; - private global::Tensorflow.Models.ObjectDetection.Protos.LearningRate learningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.LearningRate LearningRate { - get { return learningRate_; } - set { - learningRate_ = value; - } - } - - /// Field number for the "momentum_optimizer_value" field. - public const int MomentumOptimizerValueFieldNumber = 2; - private float momentumOptimizerValue_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MomentumOptimizerValue { - get { return momentumOptimizerValue_; } - set { - momentumOptimizerValue_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as MomentumOptimizer); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(MomentumOptimizer other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(LearningRate, other.LearningRate)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MomentumOptimizerValue, other.MomentumOptimizerValue)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (learningRate_ != null) hash ^= LearningRate.GetHashCode(); - if (MomentumOptimizerValue != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MomentumOptimizerValue); - 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 (learningRate_ != null) { - output.WriteRawTag(10); - output.WriteMessage(LearningRate); - } - if (MomentumOptimizerValue != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MomentumOptimizerValue); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (learningRate_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(LearningRate); - } - if (MomentumOptimizerValue != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(MomentumOptimizer other) { - if (other == null) { - return; - } - if (other.learningRate_ != null) { - if (learningRate_ == null) { - learningRate_ = new global::Tensorflow.Models.ObjectDetection.Protos.LearningRate(); - } - LearningRate.MergeFrom(other.LearningRate); - } - if (other.MomentumOptimizerValue != 0F) { - MomentumOptimizerValue = other.MomentumOptimizerValue; - } - _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 (learningRate_ == null) { - learningRate_ = new global::Tensorflow.Models.ObjectDetection.Protos.LearningRate(); - } - input.ReadMessage(learningRate_); - break; - } - case 21: { - MomentumOptimizerValue = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Configuration message for the AdamOptimizer - /// See: https://www.tensorflow.org/api_docs/python/tf/train/AdamOptimizer - /// - public sealed partial class AdamOptimizer : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AdamOptimizer()); - 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.OptimizerReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AdamOptimizer() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AdamOptimizer(AdamOptimizer other) : this() { - learningRate_ = other.learningRate_ != null ? other.learningRate_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AdamOptimizer Clone() { - return new AdamOptimizer(this); - } - - /// Field number for the "learning_rate" field. - public const int LearningRateFieldNumber = 1; - private global::Tensorflow.Models.ObjectDetection.Protos.LearningRate learningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.LearningRate LearningRate { - get { return learningRate_; } - set { - learningRate_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as AdamOptimizer); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(AdamOptimizer other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(LearningRate, other.LearningRate)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (learningRate_ != null) hash ^= LearningRate.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 (learningRate_ != null) { - output.WriteRawTag(10); - output.WriteMessage(LearningRate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (learningRate_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(LearningRate); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(AdamOptimizer other) { - if (other == null) { - return; - } - if (other.learningRate_ != null) { - if (learningRate_ == null) { - learningRate_ = new global::Tensorflow.Models.ObjectDetection.Protos.LearningRate(); - } - LearningRate.MergeFrom(other.LearningRate); - } - _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 (learningRate_ == null) { - learningRate_ = new global::Tensorflow.Models.ObjectDetection.Protos.LearningRate(); - } - input.ReadMessage(learningRate_); - break; - } - } - } - } - - } - - /// - /// Configuration message for optimizer learning rate. - /// - public sealed partial class LearningRate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LearningRate()); - 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.OptimizerReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRate(LearningRate other) : this() { - switch (other.LearningRateCase) { - case LearningRateOneofCase.ConstantLearningRate: - ConstantLearningRate = other.ConstantLearningRate.Clone(); - break; - case LearningRateOneofCase.ExponentialDecayLearningRate: - ExponentialDecayLearningRate = other.ExponentialDecayLearningRate.Clone(); - break; - case LearningRateOneofCase.ManualStepLearningRate: - ManualStepLearningRate = other.ManualStepLearningRate.Clone(); - break; - case LearningRateOneofCase.CosineDecayLearningRate: - CosineDecayLearningRate = other.CosineDecayLearningRate.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRate Clone() { - return new LearningRate(this); - } - - /// Field number for the "constant_learning_rate" field. - public const int ConstantLearningRateFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ConstantLearningRate ConstantLearningRate { - get { return learningRateCase_ == LearningRateOneofCase.ConstantLearningRate ? (global::Tensorflow.Models.ObjectDetection.Protos.ConstantLearningRate) learningRate_ : null; } - set { - learningRate_ = value; - learningRateCase_ = value == null ? LearningRateOneofCase.None : LearningRateOneofCase.ConstantLearningRate; - } - } - - /// Field number for the "exponential_decay_learning_rate" field. - public const int ExponentialDecayLearningRateFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate ExponentialDecayLearningRate { - get { return learningRateCase_ == LearningRateOneofCase.ExponentialDecayLearningRate ? (global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate) learningRate_ : null; } - set { - learningRate_ = value; - learningRateCase_ = value == null ? LearningRateOneofCase.None : LearningRateOneofCase.ExponentialDecayLearningRate; - } - } - - /// Field number for the "manual_step_learning_rate" field. - public const int ManualStepLearningRateFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate ManualStepLearningRate { - get { return learningRateCase_ == LearningRateOneofCase.ManualStepLearningRate ? (global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate) learningRate_ : null; } - set { - learningRate_ = value; - learningRateCase_ = value == null ? LearningRateOneofCase.None : LearningRateOneofCase.ManualStepLearningRate; - } - } - - /// Field number for the "cosine_decay_learning_rate" field. - public const int CosineDecayLearningRateFieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate CosineDecayLearningRate { - get { return learningRateCase_ == LearningRateOneofCase.CosineDecayLearningRate ? (global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate) learningRate_ : null; } - set { - learningRate_ = value; - learningRateCase_ = value == null ? LearningRateOneofCase.None : LearningRateOneofCase.CosineDecayLearningRate; - } - } - - private object learningRate_; - /// Enum of possible cases for the "learning_rate" oneof. - public enum LearningRateOneofCase { - None = 0, - ConstantLearningRate = 1, - ExponentialDecayLearningRate = 2, - ManualStepLearningRate = 3, - CosineDecayLearningRate = 4, - } - private LearningRateOneofCase learningRateCase_ = LearningRateOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRateOneofCase LearningRateCase { - get { return learningRateCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearLearningRate() { - learningRateCase_ = LearningRateOneofCase.None; - learningRate_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as LearningRate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(LearningRate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(ConstantLearningRate, other.ConstantLearningRate)) return false; - if (!object.Equals(ExponentialDecayLearningRate, other.ExponentialDecayLearningRate)) return false; - if (!object.Equals(ManualStepLearningRate, other.ManualStepLearningRate)) return false; - if (!object.Equals(CosineDecayLearningRate, other.CosineDecayLearningRate)) return false; - if (LearningRateCase != other.LearningRateCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (learningRateCase_ == LearningRateOneofCase.ConstantLearningRate) hash ^= ConstantLearningRate.GetHashCode(); - if (learningRateCase_ == LearningRateOneofCase.ExponentialDecayLearningRate) hash ^= ExponentialDecayLearningRate.GetHashCode(); - if (learningRateCase_ == LearningRateOneofCase.ManualStepLearningRate) hash ^= ManualStepLearningRate.GetHashCode(); - if (learningRateCase_ == LearningRateOneofCase.CosineDecayLearningRate) hash ^= CosineDecayLearningRate.GetHashCode(); - hash ^= (int) learningRateCase_; - 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 (learningRateCase_ == LearningRateOneofCase.ConstantLearningRate) { - output.WriteRawTag(10); - output.WriteMessage(ConstantLearningRate); - } - if (learningRateCase_ == LearningRateOneofCase.ExponentialDecayLearningRate) { - output.WriteRawTag(18); - output.WriteMessage(ExponentialDecayLearningRate); - } - if (learningRateCase_ == LearningRateOneofCase.ManualStepLearningRate) { - output.WriteRawTag(26); - output.WriteMessage(ManualStepLearningRate); - } - if (learningRateCase_ == LearningRateOneofCase.CosineDecayLearningRate) { - output.WriteRawTag(34); - output.WriteMessage(CosineDecayLearningRate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (learningRateCase_ == LearningRateOneofCase.ConstantLearningRate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConstantLearningRate); - } - if (learningRateCase_ == LearningRateOneofCase.ExponentialDecayLearningRate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ExponentialDecayLearningRate); - } - if (learningRateCase_ == LearningRateOneofCase.ManualStepLearningRate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ManualStepLearningRate); - } - if (learningRateCase_ == LearningRateOneofCase.CosineDecayLearningRate) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CosineDecayLearningRate); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(LearningRate other) { - if (other == null) { - return; - } - switch (other.LearningRateCase) { - case LearningRateOneofCase.ConstantLearningRate: - if (ConstantLearningRate == null) { - ConstantLearningRate = new global::Tensorflow.Models.ObjectDetection.Protos.ConstantLearningRate(); - } - ConstantLearningRate.MergeFrom(other.ConstantLearningRate); - break; - case LearningRateOneofCase.ExponentialDecayLearningRate: - if (ExponentialDecayLearningRate == null) { - ExponentialDecayLearningRate = new global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate(); - } - ExponentialDecayLearningRate.MergeFrom(other.ExponentialDecayLearningRate); - break; - case LearningRateOneofCase.ManualStepLearningRate: - if (ManualStepLearningRate == null) { - ManualStepLearningRate = new global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate(); - } - ManualStepLearningRate.MergeFrom(other.ManualStepLearningRate); - break; - case LearningRateOneofCase.CosineDecayLearningRate: - if (CosineDecayLearningRate == null) { - CosineDecayLearningRate = new global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate(); - } - CosineDecayLearningRate.MergeFrom(other.CosineDecayLearningRate); - 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.ConstantLearningRate subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ConstantLearningRate(); - if (learningRateCase_ == LearningRateOneofCase.ConstantLearningRate) { - subBuilder.MergeFrom(ConstantLearningRate); - } - input.ReadMessage(subBuilder); - ConstantLearningRate = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ExponentialDecayLearningRate(); - if (learningRateCase_ == LearningRateOneofCase.ExponentialDecayLearningRate) { - subBuilder.MergeFrom(ExponentialDecayLearningRate); - } - input.ReadMessage(subBuilder); - ExponentialDecayLearningRate = subBuilder; - break; - } - case 26: { - global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate(); - if (learningRateCase_ == LearningRateOneofCase.ManualStepLearningRate) { - subBuilder.MergeFrom(ManualStepLearningRate); - } - input.ReadMessage(subBuilder); - ManualStepLearningRate = subBuilder; - break; - } - case 34: { - global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.CosineDecayLearningRate(); - if (learningRateCase_ == LearningRateOneofCase.CosineDecayLearningRate) { - subBuilder.MergeFrom(CosineDecayLearningRate); - } - input.ReadMessage(subBuilder); - CosineDecayLearningRate = subBuilder; - break; - } - } - } - } - - } - - /// - /// Configuration message for a constant learning rate. - /// - public sealed partial class ConstantLearningRate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConstantLearningRate()); - 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.OptimizerReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ConstantLearningRate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ConstantLearningRate(ConstantLearningRate other) : this() { - learningRate_ = other.learningRate_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ConstantLearningRate Clone() { - return new ConstantLearningRate(this); - } - - /// Field number for the "learning_rate" field. - public const int LearningRateFieldNumber = 1; - private float learningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LearningRate { - get { return learningRate_; } - set { - learningRate_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ConstantLearningRate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ConstantLearningRate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LearningRate, other.LearningRate)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (LearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LearningRate); - 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 (LearningRate != 0F) { - output.WriteRawTag(13); - output.WriteFloat(LearningRate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (LearningRate != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ConstantLearningRate other) { - if (other == null) { - return; - } - if (other.LearningRate != 0F) { - LearningRate = other.LearningRate; - } - _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: { - LearningRate = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Configuration message for an exponentially decaying learning rate. - /// See https://www.tensorflow.org/versions/master/api_docs/python/train/ \ - /// decaying_the_learning_rate#exponential_decay - /// - public sealed partial class ExponentialDecayLearningRate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ExponentialDecayLearningRate()); - 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.OptimizerReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExponentialDecayLearningRate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExponentialDecayLearningRate(ExponentialDecayLearningRate other) : this() { - initialLearningRate_ = other.initialLearningRate_; - decaySteps_ = other.decaySteps_; - decayFactor_ = other.decayFactor_; - staircase_ = other.staircase_; - burninLearningRate_ = other.burninLearningRate_; - burninSteps_ = other.burninSteps_; - minLearningRate_ = other.minLearningRate_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ExponentialDecayLearningRate Clone() { - return new ExponentialDecayLearningRate(this); - } - - /// Field number for the "initial_learning_rate" field. - public const int InitialLearningRateFieldNumber = 1; - private float initialLearningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float InitialLearningRate { - get { return initialLearningRate_; } - set { - initialLearningRate_ = value; - } - } - - /// Field number for the "decay_steps" field. - public const int DecayStepsFieldNumber = 2; - private uint decaySteps_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint DecaySteps { - get { return decaySteps_; } - set { - decaySteps_ = value; - } - } - - /// Field number for the "decay_factor" field. - public const int DecayFactorFieldNumber = 3; - private float decayFactor_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float DecayFactor { - get { return decayFactor_; } - set { - decayFactor_ = value; - } - } - - /// Field number for the "staircase" field. - public const int StaircaseFieldNumber = 4; - private bool staircase_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Staircase { - get { return staircase_; } - set { - staircase_ = value; - } - } - - /// Field number for the "burnin_learning_rate" field. - public const int BurninLearningRateFieldNumber = 5; - private float burninLearningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float BurninLearningRate { - get { return burninLearningRate_; } - set { - burninLearningRate_ = value; - } - } - - /// Field number for the "burnin_steps" field. - public const int BurninStepsFieldNumber = 6; - private uint burninSteps_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint BurninSteps { - get { return burninSteps_; } - set { - burninSteps_ = value; - } - } - - /// Field number for the "min_learning_rate" field. - public const int MinLearningRateFieldNumber = 7; - private float minLearningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinLearningRate { - get { return minLearningRate_; } - set { - minLearningRate_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ExponentialDecayLearningRate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ExponentialDecayLearningRate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InitialLearningRate, other.InitialLearningRate)) return false; - if (DecaySteps != other.DecaySteps) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DecayFactor, other.DecayFactor)) return false; - if (Staircase != other.Staircase) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BurninLearningRate, other.BurninLearningRate)) return false; - if (BurninSteps != other.BurninSteps) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinLearningRate, other.MinLearningRate)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (InitialLearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InitialLearningRate); - if (DecaySteps != 0) hash ^= DecaySteps.GetHashCode(); - if (DecayFactor != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DecayFactor); - if (Staircase != false) hash ^= Staircase.GetHashCode(); - if (BurninLearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BurninLearningRate); - if (BurninSteps != 0) hash ^= BurninSteps.GetHashCode(); - if (MinLearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinLearningRate); - 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 (InitialLearningRate != 0F) { - output.WriteRawTag(13); - output.WriteFloat(InitialLearningRate); - } - if (DecaySteps != 0) { - output.WriteRawTag(16); - output.WriteUInt32(DecaySteps); - } - if (DecayFactor != 0F) { - output.WriteRawTag(29); - output.WriteFloat(DecayFactor); - } - if (Staircase != false) { - output.WriteRawTag(32); - output.WriteBool(Staircase); - } - if (BurninLearningRate != 0F) { - output.WriteRawTag(45); - output.WriteFloat(BurninLearningRate); - } - if (BurninSteps != 0) { - output.WriteRawTag(48); - output.WriteUInt32(BurninSteps); - } - if (MinLearningRate != 0F) { - output.WriteRawTag(61); - output.WriteFloat(MinLearningRate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (InitialLearningRate != 0F) { - size += 1 + 4; - } - if (DecaySteps != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(DecaySteps); - } - if (DecayFactor != 0F) { - size += 1 + 4; - } - if (Staircase != false) { - size += 1 + 1; - } - if (BurninLearningRate != 0F) { - size += 1 + 4; - } - if (BurninSteps != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(BurninSteps); - } - if (MinLearningRate != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ExponentialDecayLearningRate other) { - if (other == null) { - return; - } - if (other.InitialLearningRate != 0F) { - InitialLearningRate = other.InitialLearningRate; - } - if (other.DecaySteps != 0) { - DecaySteps = other.DecaySteps; - } - if (other.DecayFactor != 0F) { - DecayFactor = other.DecayFactor; - } - if (other.Staircase != false) { - Staircase = other.Staircase; - } - if (other.BurninLearningRate != 0F) { - BurninLearningRate = other.BurninLearningRate; - } - if (other.BurninSteps != 0) { - BurninSteps = other.BurninSteps; - } - if (other.MinLearningRate != 0F) { - MinLearningRate = other.MinLearningRate; - } - _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: { - InitialLearningRate = input.ReadFloat(); - break; - } - case 16: { - DecaySteps = input.ReadUInt32(); - break; - } - case 29: { - DecayFactor = input.ReadFloat(); - break; - } - case 32: { - Staircase = input.ReadBool(); - break; - } - case 45: { - BurninLearningRate = input.ReadFloat(); - break; - } - case 48: { - BurninSteps = input.ReadUInt32(); - break; - } - case 61: { - MinLearningRate = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Configuration message for a manually defined learning rate schedule. - /// - public sealed partial class ManualStepLearningRate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ManualStepLearningRate()); - 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.OptimizerReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManualStepLearningRate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManualStepLearningRate(ManualStepLearningRate other) : this() { - initialLearningRate_ = other.initialLearningRate_; - schedule_ = other.schedule_.Clone(); - warmup_ = other.warmup_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ManualStepLearningRate Clone() { - return new ManualStepLearningRate(this); - } - - /// Field number for the "initial_learning_rate" field. - public const int InitialLearningRateFieldNumber = 1; - private float initialLearningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float InitialLearningRate { - get { return initialLearningRate_; } - set { - initialLearningRate_ = value; - } - } - - /// Field number for the "schedule" field. - public const int ScheduleFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_schedule_codec - = pb::FieldCodec.ForMessage(18, global::Tensorflow.Models.ObjectDetection.Protos.ManualStepLearningRate.Types.LearningRateSchedule.Parser); - private readonly pbc::RepeatedField schedule_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Schedule { - get { return schedule_; } - } - - /// Field number for the "warmup" field. - public const int WarmupFieldNumber = 3; - private bool warmup_; - /// - /// Whether to linearly interpolate learning rates for steps in - /// [0, schedule[0].step]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Warmup { - get { return warmup_; } - set { - warmup_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ManualStepLearningRate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ManualStepLearningRate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InitialLearningRate, other.InitialLearningRate)) return false; - if(!schedule_.Equals(other.schedule_)) return false; - if (Warmup != other.Warmup) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (InitialLearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InitialLearningRate); - hash ^= schedule_.GetHashCode(); - if (Warmup != false) hash ^= Warmup.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 (InitialLearningRate != 0F) { - output.WriteRawTag(13); - output.WriteFloat(InitialLearningRate); - } - schedule_.WriteTo(output, _repeated_schedule_codec); - if (Warmup != false) { - output.WriteRawTag(24); - output.WriteBool(Warmup); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (InitialLearningRate != 0F) { - size += 1 + 4; - } - size += schedule_.CalculateSize(_repeated_schedule_codec); - if (Warmup != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ManualStepLearningRate other) { - if (other == null) { - return; - } - if (other.InitialLearningRate != 0F) { - InitialLearningRate = other.InitialLearningRate; - } - schedule_.Add(other.schedule_); - if (other.Warmup != false) { - Warmup = other.Warmup; - } - _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: { - InitialLearningRate = input.ReadFloat(); - break; - } - case 18: { - schedule_.AddEntriesFrom(input, _repeated_schedule_codec); - break; - } - case 24: { - Warmup = input.ReadBool(); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the ManualStepLearningRate message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - public sealed partial class LearningRateSchedule : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LearningRateSchedule()); - 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.ManualStepLearningRate.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRateSchedule() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRateSchedule(LearningRateSchedule other) : this() { - step_ = other.step_; - learningRate_ = other.learningRate_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public LearningRateSchedule Clone() { - return new LearningRateSchedule(this); - } - - /// Field number for the "step" field. - public const int StepFieldNumber = 1; - private uint step_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Step { - get { return step_; } - set { - step_ = value; - } - } - - /// Field number for the "learning_rate" field. - public const int LearningRateFieldNumber = 2; - private float learningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LearningRate { - get { return learningRate_; } - set { - learningRate_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as LearningRateSchedule); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(LearningRateSchedule other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Step != other.Step) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LearningRate, other.LearningRate)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Step != 0) hash ^= Step.GetHashCode(); - if (LearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LearningRate); - 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 (Step != 0) { - output.WriteRawTag(8); - output.WriteUInt32(Step); - } - if (LearningRate != 0F) { - output.WriteRawTag(21); - output.WriteFloat(LearningRate); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Step != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Step); - } - if (LearningRate != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(LearningRateSchedule other) { - if (other == null) { - return; - } - if (other.Step != 0) { - Step = other.Step; - } - if (other.LearningRate != 0F) { - LearningRate = other.LearningRate; - } - _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: { - Step = input.ReadUInt32(); - break; - } - case 21: { - LearningRate = input.ReadFloat(); - break; - } - } - } - } - - } - - } - #endregion - - } - - /// - /// Configuration message for a cosine decaying learning rate as defined in - /// object_detection/utils/learning_schedules.py - /// - public sealed partial class CosineDecayLearningRate : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CosineDecayLearningRate()); - 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.OptimizerReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CosineDecayLearningRate() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CosineDecayLearningRate(CosineDecayLearningRate other) : this() { - learningRateBase_ = other.learningRateBase_; - totalSteps_ = other.totalSteps_; - warmupLearningRate_ = other.warmupLearningRate_; - warmupSteps_ = other.warmupSteps_; - holdBaseRateSteps_ = other.holdBaseRateSteps_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public CosineDecayLearningRate Clone() { - return new CosineDecayLearningRate(this); - } - - /// Field number for the "learning_rate_base" field. - public const int LearningRateBaseFieldNumber = 1; - private float learningRateBase_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LearningRateBase { - get { return learningRateBase_; } - set { - learningRateBase_ = value; - } - } - - /// Field number for the "total_steps" field. - public const int TotalStepsFieldNumber = 2; - private uint totalSteps_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TotalSteps { - get { return totalSteps_; } - set { - totalSteps_ = value; - } - } - - /// Field number for the "warmup_learning_rate" field. - public const int WarmupLearningRateFieldNumber = 3; - private float warmupLearningRate_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float WarmupLearningRate { - get { return warmupLearningRate_; } - set { - warmupLearningRate_ = value; - } - } - - /// Field number for the "warmup_steps" field. - public const int WarmupStepsFieldNumber = 4; - private uint warmupSteps_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint WarmupSteps { - get { return warmupSteps_; } - set { - warmupSteps_ = value; - } - } - - /// Field number for the "hold_base_rate_steps" field. - public const int HoldBaseRateStepsFieldNumber = 5; - private uint holdBaseRateSteps_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint HoldBaseRateSteps { - get { return holdBaseRateSteps_; } - set { - holdBaseRateSteps_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as CosineDecayLearningRate); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(CosineDecayLearningRate other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LearningRateBase, other.LearningRateBase)) return false; - if (TotalSteps != other.TotalSteps) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(WarmupLearningRate, other.WarmupLearningRate)) return false; - if (WarmupSteps != other.WarmupSteps) return false; - if (HoldBaseRateSteps != other.HoldBaseRateSteps) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (LearningRateBase != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LearningRateBase); - if (TotalSteps != 0) hash ^= TotalSteps.GetHashCode(); - if (WarmupLearningRate != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(WarmupLearningRate); - if (WarmupSteps != 0) hash ^= WarmupSteps.GetHashCode(); - if (HoldBaseRateSteps != 0) hash ^= HoldBaseRateSteps.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 (LearningRateBase != 0F) { - output.WriteRawTag(13); - output.WriteFloat(LearningRateBase); - } - if (TotalSteps != 0) { - output.WriteRawTag(16); - output.WriteUInt32(TotalSteps); - } - if (WarmupLearningRate != 0F) { - output.WriteRawTag(29); - output.WriteFloat(WarmupLearningRate); - } - if (WarmupSteps != 0) { - output.WriteRawTag(32); - output.WriteUInt32(WarmupSteps); - } - if (HoldBaseRateSteps != 0) { - output.WriteRawTag(40); - output.WriteUInt32(HoldBaseRateSteps); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (LearningRateBase != 0F) { - size += 1 + 4; - } - if (TotalSteps != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TotalSteps); - } - if (WarmupLearningRate != 0F) { - size += 1 + 4; - } - if (WarmupSteps != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(WarmupSteps); - } - if (HoldBaseRateSteps != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(HoldBaseRateSteps); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(CosineDecayLearningRate other) { - if (other == null) { - return; - } - if (other.LearningRateBase != 0F) { - LearningRateBase = other.LearningRateBase; - } - if (other.TotalSteps != 0) { - TotalSteps = other.TotalSteps; - } - if (other.WarmupLearningRate != 0F) { - WarmupLearningRate = other.WarmupLearningRate; - } - if (other.WarmupSteps != 0) { - WarmupSteps = other.WarmupSteps; - } - if (other.HoldBaseRateSteps != 0) { - HoldBaseRateSteps = other.HoldBaseRateSteps; - } - _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: { - LearningRateBase = input.ReadFloat(); - break; - } - case 16: { - TotalSteps = input.ReadUInt32(); - break; - } - case 29: { - WarmupLearningRate = input.ReadFloat(); - break; - } - case 32: { - WarmupSteps = input.ReadUInt32(); - break; - } - case 40: { - HoldBaseRateSteps = input.ReadUInt32(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Pipeline.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Pipeline.cs deleted file mode 100644 index d5bef7cb..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Pipeline.cs +++ /dev/null @@ -1,352 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/pipeline.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/pipeline.proto - public static partial class PipelineReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/pipeline.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static PipelineReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiZvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9waXBlbGluZS5wcm90bxIXb2Jq", - "ZWN0X2RldGVjdGlvbi5wcm90b3MaIm9iamVjdF9kZXRlY3Rpb24vcHJvdG9z", - "L2V2YWwucHJvdG8aLG9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL2dyYXBoX3Jl", - "d3JpdGVyLnByb3RvGipvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9pbnB1dF9y", - "ZWFkZXIucHJvdG8aI29iamVjdF9kZXRlY3Rpb24vcHJvdG9zL21vZGVsLnBy", - "b3RvGiNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy90cmFpbi5wcm90byKKAwoX", - "VHJhaW5FdmFsUGlwZWxpbmVDb25maWcSNgoFbW9kZWwYASABKAsyJy5vYmpl", - "Y3RfZGV0ZWN0aW9uLnByb3Rvcy5EZXRlY3Rpb25Nb2RlbBI6Cgx0cmFpbl9j", - "b25maWcYAiABKAsyJC5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5UcmFpbkNv", - "bmZpZxJAChJ0cmFpbl9pbnB1dF9yZWFkZXIYAyABKAsyJC5vYmplY3RfZGV0", - "ZWN0aW9uLnByb3Rvcy5JbnB1dFJlYWRlchI4CgtldmFsX2NvbmZpZxgEIAEo", - "CzIjLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLkV2YWxDb25maWcSPwoRZXZh", - "bF9pbnB1dF9yZWFkZXIYBSADKAsyJC5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv", - "cy5JbnB1dFJlYWRlchI+Cg5ncmFwaF9yZXdyaXRlchgGIAEoCzImLm9iamVj", - "dF9kZXRlY3Rpb24ucHJvdG9zLkdyYXBoUmV3cml0ZXJiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.EvalReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriterReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.InputReaderReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.ModelReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.TrainReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.TrainEvalPipelineConfig), global::Tensorflow.Models.ObjectDetection.Protos.TrainEvalPipelineConfig.Parser, new[]{ "Model", "TrainConfig", "TrainInputReader", "EvalConfig", "EvalInputReader", "GraphRewriter" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Convenience message for configuring a training and eval pipeline. Allows all - /// of the pipeline parameters to be configured from one file. - /// Next id: 7 - /// - public sealed partial class TrainEvalPipelineConfig : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrainEvalPipelineConfig()); - 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.PipelineReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TrainEvalPipelineConfig() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TrainEvalPipelineConfig(TrainEvalPipelineConfig other) : this() { - model_ = other.model_ != null ? other.model_.Clone() : null; - trainConfig_ = other.trainConfig_ != null ? other.trainConfig_.Clone() : null; - trainInputReader_ = other.trainInputReader_ != null ? other.trainInputReader_.Clone() : null; - evalConfig_ = other.evalConfig_ != null ? other.evalConfig_.Clone() : null; - evalInputReader_ = other.evalInputReader_.Clone(); - graphRewriter_ = other.graphRewriter_ != null ? other.graphRewriter_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TrainEvalPipelineConfig Clone() { - return new TrainEvalPipelineConfig(this); - } - - /// Field number for the "model" field. - public const int ModelFieldNumber = 1; - private global::Tensorflow.Models.ObjectDetection.Protos.DetectionModel model_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.DetectionModel Model { - get { return model_; } - set { - model_ = value; - } - } - - /// Field number for the "train_config" field. - public const int TrainConfigFieldNumber = 2; - private global::Tensorflow.Models.ObjectDetection.Protos.TrainConfig trainConfig_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.TrainConfig TrainConfig { - get { return trainConfig_; } - set { - trainConfig_ = value; - } - } - - /// Field number for the "train_input_reader" field. - public const int TrainInputReaderFieldNumber = 3; - private global::Tensorflow.Models.ObjectDetection.Protos.InputReader trainInputReader_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.InputReader TrainInputReader { - get { return trainInputReader_; } - set { - trainInputReader_ = value; - } - } - - /// Field number for the "eval_config" field. - public const int EvalConfigFieldNumber = 4; - private global::Tensorflow.Models.ObjectDetection.Protos.EvalConfig evalConfig_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.EvalConfig EvalConfig { - get { return evalConfig_; } - set { - evalConfig_ = value; - } - } - - /// Field number for the "eval_input_reader" field. - public const int EvalInputReaderFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_evalInputReader_codec - = pb::FieldCodec.ForMessage(42, global::Tensorflow.Models.ObjectDetection.Protos.InputReader.Parser); - private readonly pbc::RepeatedField evalInputReader_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField EvalInputReader { - get { return evalInputReader_; } - } - - /// Field number for the "graph_rewriter" field. - public const int GraphRewriterFieldNumber = 6; - private global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriter graphRewriter_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriter GraphRewriter { - get { return graphRewriter_; } - set { - graphRewriter_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TrainEvalPipelineConfig); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TrainEvalPipelineConfig other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Model, other.Model)) return false; - if (!object.Equals(TrainConfig, other.TrainConfig)) return false; - if (!object.Equals(TrainInputReader, other.TrainInputReader)) return false; - if (!object.Equals(EvalConfig, other.EvalConfig)) return false; - if(!evalInputReader_.Equals(other.evalInputReader_)) return false; - if (!object.Equals(GraphRewriter, other.GraphRewriter)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (model_ != null) hash ^= Model.GetHashCode(); - if (trainConfig_ != null) hash ^= TrainConfig.GetHashCode(); - if (trainInputReader_ != null) hash ^= TrainInputReader.GetHashCode(); - if (evalConfig_ != null) hash ^= EvalConfig.GetHashCode(); - hash ^= evalInputReader_.GetHashCode(); - if (graphRewriter_ != null) hash ^= GraphRewriter.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 (model_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Model); - } - if (trainConfig_ != null) { - output.WriteRawTag(18); - output.WriteMessage(TrainConfig); - } - if (trainInputReader_ != null) { - output.WriteRawTag(26); - output.WriteMessage(TrainInputReader); - } - if (evalConfig_ != null) { - output.WriteRawTag(34); - output.WriteMessage(EvalConfig); - } - evalInputReader_.WriteTo(output, _repeated_evalInputReader_codec); - if (graphRewriter_ != null) { - output.WriteRawTag(50); - output.WriteMessage(GraphRewriter); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (model_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Model); - } - if (trainConfig_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrainConfig); - } - if (trainInputReader_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(TrainInputReader); - } - if (evalConfig_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(EvalConfig); - } - size += evalInputReader_.CalculateSize(_repeated_evalInputReader_codec); - if (graphRewriter_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(GraphRewriter); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TrainEvalPipelineConfig other) { - if (other == null) { - return; - } - if (other.model_ != null) { - if (model_ == null) { - model_ = new global::Tensorflow.Models.ObjectDetection.Protos.DetectionModel(); - } - Model.MergeFrom(other.Model); - } - if (other.trainConfig_ != null) { - if (trainConfig_ == null) { - trainConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.TrainConfig(); - } - TrainConfig.MergeFrom(other.TrainConfig); - } - if (other.trainInputReader_ != null) { - if (trainInputReader_ == null) { - trainInputReader_ = new global::Tensorflow.Models.ObjectDetection.Protos.InputReader(); - } - TrainInputReader.MergeFrom(other.TrainInputReader); - } - if (other.evalConfig_ != null) { - if (evalConfig_ == null) { - evalConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.EvalConfig(); - } - EvalConfig.MergeFrom(other.EvalConfig); - } - evalInputReader_.Add(other.evalInputReader_); - if (other.graphRewriter_ != null) { - if (graphRewriter_ == null) { - graphRewriter_ = new global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriter(); - } - GraphRewriter.MergeFrom(other.GraphRewriter); - } - _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 (model_ == null) { - model_ = new global::Tensorflow.Models.ObjectDetection.Protos.DetectionModel(); - } - input.ReadMessage(model_); - break; - } - case 18: { - if (trainConfig_ == null) { - trainConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.TrainConfig(); - } - input.ReadMessage(trainConfig_); - break; - } - case 26: { - if (trainInputReader_ == null) { - trainInputReader_ = new global::Tensorflow.Models.ObjectDetection.Protos.InputReader(); - } - input.ReadMessage(trainInputReader_); - break; - } - case 34: { - if (evalConfig_ == null) { - evalConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.EvalConfig(); - } - input.ReadMessage(evalConfig_); - break; - } - case 42: { - evalInputReader_.AddEntriesFrom(input, _repeated_evalInputReader_codec); - break; - } - case 50: { - if (graphRewriter_ == null) { - graphRewriter_ = new global::Tensorflow.Models.ObjectDetection.Protos.GraphRewriter(); - } - input.ReadMessage(graphRewriter_); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/PostProcessing.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/PostProcessing.cs deleted file mode 100644 index 708364dd..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/PostProcessing.cs +++ /dev/null @@ -1,685 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/post_processing.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/post_processing.proto - public static partial class PostProcessingReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/post_processing.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static PostProcessingReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ci1vYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9wb3N0X3Byb2Nlc3NpbmcucHJv", - "dG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zGilvYmplY3RfZGV0ZWN0aW9u", - "L3Byb3Rvcy9jYWxpYnJhdGlvbi5wcm90byL+AQoWQmF0Y2hOb25NYXhTdXBw", - "cmVzc2lvbhIXCg9zY29yZV90aHJlc2hvbGQYASABKAISFQoNaW91X3RocmVz", - "aG9sZBgCIAEoAhIgChhtYXhfZGV0ZWN0aW9uc19wZXJfY2xhc3MYAyABKAUS", - "HAoUbWF4X3RvdGFsX2RldGVjdGlvbnMYBSABKAUSGQoRdXNlX3N0YXRpY19z", - "aGFwZXMYBiABKAgSHgoWdXNlX2NsYXNzX2Fnbm9zdGljX25tcxgHIAEoCBIh", - "ChltYXhfY2xhc3Nlc19wZXJfZGV0ZWN0aW9uGAggASgFEhYKDnNvZnRfbm1z", - "X3NpZ21hGAkgASgCIswCCg5Qb3N0UHJvY2Vzc2luZxJSChliYXRjaF9ub25f", - "bWF4X3N1cHByZXNzaW9uGAEgASgLMi8ub2JqZWN0X2RldGVjdGlvbi5wcm90", - "b3MuQmF0Y2hOb25NYXhTdXBwcmVzc2lvbhJPCg9zY29yZV9jb252ZXJ0ZXIY", - "AiABKA4yNi5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5Qb3N0UHJvY2Vzc2lu", - "Zy5TY29yZUNvbnZlcnRlchITCgtsb2dpdF9zY2FsZRgDIAEoAhJGChJjYWxp", - "YnJhdGlvbl9jb25maWcYBCABKAsyKi5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv", - "cy5DYWxpYnJhdGlvbkNvbmZpZyI4Cg5TY29yZUNvbnZlcnRlchIMCghJREVO", - "VElUWRAAEgsKB1NJR01PSUQQARILCgdTT0ZUTUFYEAJiBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.CalibrationReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression), global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression.Parser, new[]{ "ScoreThreshold", "IouThreshold", "MaxDetectionsPerClass", "MaxTotalDetections", "UseStaticShapes", "UseClassAgnosticNms", "MaxClassesPerDetection", "SoftNmsSigma" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing), global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Parser, new[]{ "BatchNonMaxSuppression", "ScoreConverter", "LogitScale", "CalibrationConfig" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter) }, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for non-max-suppression operation on a batch of - /// detections. - /// - public sealed partial class BatchNonMaxSuppression : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BatchNonMaxSuppression()); - 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.PostProcessingReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BatchNonMaxSuppression() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BatchNonMaxSuppression(BatchNonMaxSuppression other) : this() { - scoreThreshold_ = other.scoreThreshold_; - iouThreshold_ = other.iouThreshold_; - maxDetectionsPerClass_ = other.maxDetectionsPerClass_; - maxTotalDetections_ = other.maxTotalDetections_; - useStaticShapes_ = other.useStaticShapes_; - useClassAgnosticNms_ = other.useClassAgnosticNms_; - maxClassesPerDetection_ = other.maxClassesPerDetection_; - softNmsSigma_ = other.softNmsSigma_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public BatchNonMaxSuppression Clone() { - return new BatchNonMaxSuppression(this); - } - - /// Field number for the "score_threshold" field. - public const int ScoreThresholdFieldNumber = 1; - private float scoreThreshold_; - /// - /// Scalar threshold for score (low scoring boxes are removed). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float ScoreThreshold { - get { return scoreThreshold_; } - set { - scoreThreshold_ = value; - } - } - - /// Field number for the "iou_threshold" field. - public const int IouThresholdFieldNumber = 2; - private float iouThreshold_; - /// - /// Scalar threshold for IOU (boxes that have high IOU overlap - /// with previously selected boxes are removed). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float IouThreshold { - get { return iouThreshold_; } - set { - iouThreshold_ = value; - } - } - - /// Field number for the "max_detections_per_class" field. - public const int MaxDetectionsPerClassFieldNumber = 3; - private int maxDetectionsPerClass_; - /// - /// Maximum number of detections to retain per class. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxDetectionsPerClass { - get { return maxDetectionsPerClass_; } - set { - maxDetectionsPerClass_ = value; - } - } - - /// Field number for the "max_total_detections" field. - public const int MaxTotalDetectionsFieldNumber = 5; - private int maxTotalDetections_; - /// - /// Maximum number of detections to retain across all classes. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxTotalDetections { - get { return maxTotalDetections_; } - set { - maxTotalDetections_ = value; - } - } - - /// Field number for the "use_static_shapes" field. - public const int UseStaticShapesFieldNumber = 6; - private bool useStaticShapes_; - /// - /// Whether to use the implementation of NMS that guarantees static shapes. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseStaticShapes { - get { return useStaticShapes_; } - set { - useStaticShapes_ = value; - } - } - - /// Field number for the "use_class_agnostic_nms" field. - public const int UseClassAgnosticNmsFieldNumber = 7; - private bool useClassAgnosticNms_; - /// - /// Whether to use class agnostic NMS. - /// Class-agnostic NMS function implements a class-agnostic version - /// of Non Maximal Suppression where if max_classes_per_detection=k, - /// 1) we keep the top-k scores for each detection and - /// 2) during NMS, each detection only uses the highest class score for sorting. - /// 3) Compared to regular NMS, the worst runtime of this version is O(N^2) - /// instead of O(KN^2) where N is the number of detections and K the number of - /// classes. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseClassAgnosticNms { - get { return useClassAgnosticNms_; } - set { - useClassAgnosticNms_ = value; - } - } - - /// Field number for the "max_classes_per_detection" field. - public const int MaxClassesPerDetectionFieldNumber = 8; - private int maxClassesPerDetection_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxClassesPerDetection { - get { return maxClassesPerDetection_; } - set { - maxClassesPerDetection_ = value; - } - } - - /// Field number for the "soft_nms_sigma" field. - public const int SoftNmsSigmaFieldNumber = 9; - private float softNmsSigma_; - /// - /// Soft NMS sigma parameter; Bodla et al, https://arxiv.org/abs/1704.04503) - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float SoftNmsSigma { - get { return softNmsSigma_; } - set { - softNmsSigma_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as BatchNonMaxSuppression); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(BatchNonMaxSuppression other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ScoreThreshold, other.ScoreThreshold)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IouThreshold, other.IouThreshold)) return false; - if (MaxDetectionsPerClass != other.MaxDetectionsPerClass) return false; - if (MaxTotalDetections != other.MaxTotalDetections) return false; - if (UseStaticShapes != other.UseStaticShapes) return false; - if (UseClassAgnosticNms != other.UseClassAgnosticNms) return false; - if (MaxClassesPerDetection != other.MaxClassesPerDetection) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SoftNmsSigma, other.SoftNmsSigma)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (ScoreThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ScoreThreshold); - if (IouThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IouThreshold); - if (MaxDetectionsPerClass != 0) hash ^= MaxDetectionsPerClass.GetHashCode(); - if (MaxTotalDetections != 0) hash ^= MaxTotalDetections.GetHashCode(); - if (UseStaticShapes != false) hash ^= UseStaticShapes.GetHashCode(); - if (UseClassAgnosticNms != false) hash ^= UseClassAgnosticNms.GetHashCode(); - if (MaxClassesPerDetection != 0) hash ^= MaxClassesPerDetection.GetHashCode(); - if (SoftNmsSigma != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SoftNmsSigma); - 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 (ScoreThreshold != 0F) { - output.WriteRawTag(13); - output.WriteFloat(ScoreThreshold); - } - if (IouThreshold != 0F) { - output.WriteRawTag(21); - output.WriteFloat(IouThreshold); - } - if (MaxDetectionsPerClass != 0) { - output.WriteRawTag(24); - output.WriteInt32(MaxDetectionsPerClass); - } - if (MaxTotalDetections != 0) { - output.WriteRawTag(40); - output.WriteInt32(MaxTotalDetections); - } - if (UseStaticShapes != false) { - output.WriteRawTag(48); - output.WriteBool(UseStaticShapes); - } - if (UseClassAgnosticNms != false) { - output.WriteRawTag(56); - output.WriteBool(UseClassAgnosticNms); - } - if (MaxClassesPerDetection != 0) { - output.WriteRawTag(64); - output.WriteInt32(MaxClassesPerDetection); - } - if (SoftNmsSigma != 0F) { - output.WriteRawTag(77); - output.WriteFloat(SoftNmsSigma); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (ScoreThreshold != 0F) { - size += 1 + 4; - } - if (IouThreshold != 0F) { - size += 1 + 4; - } - if (MaxDetectionsPerClass != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxDetectionsPerClass); - } - if (MaxTotalDetections != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxTotalDetections); - } - if (UseStaticShapes != false) { - size += 1 + 1; - } - if (UseClassAgnosticNms != false) { - size += 1 + 1; - } - if (MaxClassesPerDetection != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxClassesPerDetection); - } - if (SoftNmsSigma != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(BatchNonMaxSuppression other) { - if (other == null) { - return; - } - if (other.ScoreThreshold != 0F) { - ScoreThreshold = other.ScoreThreshold; - } - if (other.IouThreshold != 0F) { - IouThreshold = other.IouThreshold; - } - if (other.MaxDetectionsPerClass != 0) { - MaxDetectionsPerClass = other.MaxDetectionsPerClass; - } - if (other.MaxTotalDetections != 0) { - MaxTotalDetections = other.MaxTotalDetections; - } - if (other.UseStaticShapes != false) { - UseStaticShapes = other.UseStaticShapes; - } - if (other.UseClassAgnosticNms != false) { - UseClassAgnosticNms = other.UseClassAgnosticNms; - } - if (other.MaxClassesPerDetection != 0) { - MaxClassesPerDetection = other.MaxClassesPerDetection; - } - if (other.SoftNmsSigma != 0F) { - SoftNmsSigma = other.SoftNmsSigma; - } - _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: { - ScoreThreshold = input.ReadFloat(); - break; - } - case 21: { - IouThreshold = input.ReadFloat(); - break; - } - case 24: { - MaxDetectionsPerClass = input.ReadInt32(); - break; - } - case 40: { - MaxTotalDetections = input.ReadInt32(); - break; - } - case 48: { - UseStaticShapes = input.ReadBool(); - break; - } - case 56: { - UseClassAgnosticNms = input.ReadBool(); - break; - } - case 64: { - MaxClassesPerDetection = input.ReadInt32(); - break; - } - case 77: { - SoftNmsSigma = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Configuration proto for post-processing predicted boxes and - /// scores. - /// - public sealed partial class PostProcessing : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PostProcessing()); - 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.PostProcessingReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PostProcessing() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PostProcessing(PostProcessing other) : this() { - batchNonMaxSuppression_ = other.batchNonMaxSuppression_ != null ? other.batchNonMaxSuppression_.Clone() : null; - scoreConverter_ = other.scoreConverter_; - logitScale_ = other.logitScale_; - calibrationConfig_ = other.calibrationConfig_ != null ? other.calibrationConfig_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PostProcessing Clone() { - return new PostProcessing(this); - } - - /// Field number for the "batch_non_max_suppression" field. - public const int BatchNonMaxSuppressionFieldNumber = 1; - private global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression batchNonMaxSuppression_; - /// - /// Non max suppression parameters. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression BatchNonMaxSuppression { - get { return batchNonMaxSuppression_; } - set { - batchNonMaxSuppression_ = value; - } - } - - /// Field number for the "score_converter" field. - public const int ScoreConverterFieldNumber = 2; - private global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter scoreConverter_ = 0; - /// - /// Score converter to use. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter ScoreConverter { - get { return scoreConverter_; } - set { - scoreConverter_ = value; - } - } - - /// Field number for the "logit_scale" field. - public const int LogitScaleFieldNumber = 3; - private float logitScale_; - /// - /// Scale logit (input) value before conversion in post-processing step. - /// Typically used for softmax distillation, though can be used to scale for - /// other reasons. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LogitScale { - get { return logitScale_; } - set { - logitScale_ = value; - } - } - - /// Field number for the "calibration_config" field. - public const int CalibrationConfigFieldNumber = 4; - private global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig calibrationConfig_; - /// - /// Calibrate score outputs. Calibration is applied after score converter - /// and before non max suppression. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig CalibrationConfig { - get { return calibrationConfig_; } - set { - calibrationConfig_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as PostProcessing); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(PostProcessing other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(BatchNonMaxSuppression, other.BatchNonMaxSuppression)) return false; - if (ScoreConverter != other.ScoreConverter) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(LogitScale, other.LogitScale)) return false; - if (!object.Equals(CalibrationConfig, other.CalibrationConfig)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (batchNonMaxSuppression_ != null) hash ^= BatchNonMaxSuppression.GetHashCode(); - if (ScoreConverter != 0) hash ^= ScoreConverter.GetHashCode(); - if (LogitScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LogitScale); - if (calibrationConfig_ != null) hash ^= CalibrationConfig.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 (batchNonMaxSuppression_ != null) { - output.WriteRawTag(10); - output.WriteMessage(BatchNonMaxSuppression); - } - if (ScoreConverter != 0) { - output.WriteRawTag(16); - output.WriteEnum((int) ScoreConverter); - } - if (LogitScale != 0F) { - output.WriteRawTag(29); - output.WriteFloat(LogitScale); - } - if (calibrationConfig_ != null) { - output.WriteRawTag(34); - output.WriteMessage(CalibrationConfig); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (batchNonMaxSuppression_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BatchNonMaxSuppression); - } - if (ScoreConverter != 0) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ScoreConverter); - } - if (LogitScale != 0F) { - size += 1 + 4; - } - if (calibrationConfig_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(CalibrationConfig); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(PostProcessing other) { - if (other == null) { - return; - } - if (other.batchNonMaxSuppression_ != null) { - if (batchNonMaxSuppression_ == null) { - batchNonMaxSuppression_ = new global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression(); - } - BatchNonMaxSuppression.MergeFrom(other.BatchNonMaxSuppression); - } - if (other.ScoreConverter != 0) { - ScoreConverter = other.ScoreConverter; - } - if (other.LogitScale != 0F) { - LogitScale = other.LogitScale; - } - if (other.calibrationConfig_ != null) { - if (calibrationConfig_ == null) { - calibrationConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig(); - } - CalibrationConfig.MergeFrom(other.CalibrationConfig); - } - _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 (batchNonMaxSuppression_ == null) { - batchNonMaxSuppression_ = new global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression(); - } - input.ReadMessage(batchNonMaxSuppression_); - break; - } - case 16: { - scoreConverter_ = (global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter) input.ReadEnum(); - break; - } - case 29: { - LogitScale = input.ReadFloat(); - break; - } - case 34: { - if (calibrationConfig_ == null) { - calibrationConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig(); - } - input.ReadMessage(calibrationConfig_); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the PostProcessing message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - /// - /// Enum to specify how to convert the detection scores. - /// - public enum ScoreConverter { - /// - /// Input scores equals output scores. - /// - [pbr::OriginalName("IDENTITY")] Identity = 0, - /// - /// Applies a sigmoid on input scores. - /// - [pbr::OriginalName("SIGMOID")] Sigmoid = 1, - /// - /// Applies a softmax on input scores - /// - [pbr::OriginalName("SOFTMAX")] Softmax = 2, - } - - } - #endregion - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Preprocessor.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Preprocessor.cs deleted file mode 100644 index 7412fb52..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Preprocessor.cs +++ /dev/null @@ -1,8697 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/preprocessor.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/preprocessor.proto - public static partial class PreprocessorReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/preprocessor.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static PreprocessorReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CipvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9wcmVwcm9jZXNzb3IucHJvdG8S", - "F29iamVjdF9kZXRlY3Rpb24ucHJvdG9zItgUChFQcmVwcm9jZXNzaW5nU3Rl", - "cBJCCg9ub3JtYWxpemVfaW1hZ2UYASABKAsyJy5vYmplY3RfZGV0ZWN0aW9u", - "LnByb3Rvcy5Ob3JtYWxpemVJbWFnZUgAEk8KFnJhbmRvbV9ob3Jpem9udGFs", - "X2ZsaXAYAiABKAsyLS5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5SYW5kb21I", - "b3Jpem9udGFsRmxpcEgAElIKGHJhbmRvbV9waXhlbF92YWx1ZV9zY2FsZRgD", - "IAEoCzIuLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJhbmRvbVBpeGVsVmFs", - "dWVTY2FsZUgAEkcKEnJhbmRvbV9pbWFnZV9zY2FsZRgEIAEoCzIpLm9iamVj", - "dF9kZXRlY3Rpb24ucHJvdG9zLlJhbmRvbUltYWdlU2NhbGVIABJGChJyYW5k", - "b21fcmdiX3RvX2dyYXkYBSABKAsyKC5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv", - "cy5SYW5kb21SR0J0b0dyYXlIABJTChhyYW5kb21fYWRqdXN0X2JyaWdodG5l", - "c3MYBiABKAsyLy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5SYW5kb21BZGp1", - "c3RCcmlnaHRuZXNzSAASTwoWcmFuZG9tX2FkanVzdF9jb250cmFzdBgHIAEo", - "CzItLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJhbmRvbUFkanVzdENvbnRy", - "YXN0SAASRQoRcmFuZG9tX2FkanVzdF9odWUYCCABKAsyKC5vYmplY3RfZGV0", - "ZWN0aW9uLnByb3Rvcy5SYW5kb21BZGp1c3RIdWVIABJTChhyYW5kb21fYWRq", - "dXN0X3NhdHVyYXRpb24YCSABKAsyLy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv", - "cy5SYW5kb21BZGp1c3RTYXR1cmF0aW9uSAASSwoUcmFuZG9tX2Rpc3RvcnRf", - "Y29sb3IYCiABKAsyKy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5SYW5kb21E", - "aXN0b3J0Q29sb3JIABJJChNyYW5kb21faml0dGVyX2JveGVzGAsgASgLMiou", - "b2JqZWN0X2RldGVjdGlvbi5wcm90b3MuUmFuZG9tSml0dGVyQm94ZXNIABJF", - "ChFyYW5kb21fY3JvcF9pbWFnZRgMIAEoCzIoLm9iamVjdF9kZXRlY3Rpb24u", - "cHJvdG9zLlJhbmRvbUNyb3BJbWFnZUgAEkMKEHJhbmRvbV9wYWRfaW1hZ2UY", - "DSABKAsyJy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5SYW5kb21QYWRJbWFn", - "ZUgAEkwKFXJhbmRvbV9jcm9wX3BhZF9pbWFnZRgOIAEoCzIrLm9iamVjdF9k", - "ZXRlY3Rpb24ucHJvdG9zLlJhbmRvbUNyb3BQYWRJbWFnZUgAElcKG3JhbmRv", - "bV9jcm9wX3RvX2FzcGVjdF9yYXRpbxgPIAEoCzIwLm9iamVjdF9kZXRlY3Rp", - "b24ucHJvdG9zLlJhbmRvbUNyb3BUb0FzcGVjdFJhdGlvSAASSwoUcmFuZG9t", - "X2JsYWNrX3BhdGNoZXMYECABKAsyKy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rv", - "cy5SYW5kb21CbGFja1BhdGNoZXNIABJLChRyYW5kb21fcmVzaXplX21ldGhv", - "ZBgRIAEoCzIrLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJhbmRvbVJlc2l6", - "ZU1ldGhvZEgAEmEKIHNjYWxlX2JveGVzX3RvX3BpeGVsX2Nvb3JkaW5hdGVz", - "GBIgASgLMjUub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuU2NhbGVCb3hlc1Rv", - "UGl4ZWxDb29yZGluYXRlc0gAEjwKDHJlc2l6ZV9pbWFnZRgTIAEoCzIkLm9i", - "amVjdF9kZXRlY3Rpb24ucHJvdG9zLlJlc2l6ZUltYWdlSAASTQoVc3VidHJh", - "Y3RfY2hhbm5lbF9tZWFuGBQgASgLMiwub2JqZWN0X2RldGVjdGlvbi5wcm90", - "b3MuU3VidHJhY3RDaGFubmVsTWVhbkgAEkEKD3NzZF9yYW5kb21fY3JvcBgV", - "IAEoCzImLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlNTRFJhbmRvbUNyb3BI", - "ABJIChNzc2RfcmFuZG9tX2Nyb3BfcGFkGBYgASgLMikub2JqZWN0X2RldGVj", - "dGlvbi5wcm90b3MuU1NEUmFuZG9tQ3JvcFBhZEgAEmQKInNzZF9yYW5kb21f", - "Y3JvcF9maXhlZF9hc3BlY3RfcmF0aW8YFyABKAsyNi5vYmplY3RfZGV0ZWN0", - "aW9uLnByb3Rvcy5TU0RSYW5kb21Dcm9wRml4ZWRBc3BlY3RSYXRpb0gAEmsK", - "JnNzZF9yYW5kb21fY3JvcF9wYWRfZml4ZWRfYXNwZWN0X3JhdGlvGBggASgL", - "Mjkub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuU1NEUmFuZG9tQ3JvcFBhZEZp", - "eGVkQXNwZWN0UmF0aW9IABJLChRyYW5kb21fdmVydGljYWxfZmxpcBgZIAEo", - "CzIrLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJhbmRvbVZlcnRpY2FsRmxp", - "cEgAEkYKEXJhbmRvbV9yb3RhdGlvbjkwGBogASgLMikub2JqZWN0X2RldGVj", - "dGlvbi5wcm90b3MuUmFuZG9tUm90YXRpb245MEgAEjkKC3JnYl90b19ncmF5", - "GBsgASgLMiIub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuUkdCdG9HcmF5SAAS", - "XwofY29udmVydF9jbGFzc19sb2dpdHNfdG9fc29mdG1heBgcIAEoCzI0Lm9i", - "amVjdF9kZXRlY3Rpb24ucHJvdG9zLkNvbnZlcnRDbGFzc0xvZ2l0c1RvU29m", - "dG1heEgAElQKGXJhbmRvbV9hYnNvbHV0ZV9wYWRfaW1hZ2UYHSABKAsyLy5v", - "YmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5SYW5kb21BYnNvbHV0ZVBhZEltYWdl", - "SAASUgoYcmFuZG9tX3NlbGZfY29uY2F0X2ltYWdlGB4gASgLMi4ub2JqZWN0", - "X2RldGVjdGlvbi5wcm90b3MuUmFuZG9tU2VsZkNvbmNhdEltYWdlSAASRgoR", - "YXV0b2F1Z21lbnRfaW1hZ2UYHyABKAsyKS5vYmplY3RfZGV0ZWN0aW9uLnBy", - "b3Rvcy5BdXRvQXVnbWVudEltYWdlSAASWwocZHJvcF9sYWJlbF9wcm9iYWJp", - "bGlzdGljYWxseRggIAEoCzIzLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLkRy", - "b3BMYWJlbFByb2JhYmlsaXN0aWNhbGx5SAASPAoMcmVtYXBfbGFiZWxzGCEg", - "ASgLMiQub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuUmVtYXBMYWJlbHNIAEIU", - "ChJwcmVwcm9jZXNzaW5nX3N0ZXAicAoOTm9ybWFsaXplSW1hZ2USFwoPb3Jp", - "Z2luYWxfbWludmFsGAEgASgCEhcKD29yaWdpbmFsX21heHZhbBgCIAEoAhIV", - "Cg10YXJnZXRfbWludmFsGAMgASgCEhUKDXRhcmdldF9tYXh2YWwYBCABKAIi", - "OQoUUmFuZG9tSG9yaXpvbnRhbEZsaXASIQoZa2V5cG9pbnRfZmxpcF9wZXJt", - "dXRhdGlvbhgBIAMoBSI3ChJSYW5kb21WZXJ0aWNhbEZsaXASIQoZa2V5cG9p", - "bnRfZmxpcF9wZXJtdXRhdGlvbhgBIAMoBSISChBSYW5kb21Sb3RhdGlvbjkw", - "IjcKFVJhbmRvbVBpeGVsVmFsdWVTY2FsZRIOCgZtaW52YWwYASABKAISDgoG", - "bWF4dmFsGAIgASgCIkQKEFJhbmRvbUltYWdlU2NhbGUSFwoPbWluX3NjYWxl", - "X3JhdGlvGAEgASgCEhcKD21heF9zY2FsZV9yYXRpbxgCIAEoAiImCg9SYW5k", - "b21SR0J0b0dyYXkSEwoLcHJvYmFiaWxpdHkYASABKAIiKwoWUmFuZG9tQWRq", - "dXN0QnJpZ2h0bmVzcxIRCgltYXhfZGVsdGEYASABKAIiPAoUUmFuZG9tQWRq", - "dXN0Q29udHJhc3QSEQoJbWluX2RlbHRhGAEgASgCEhEKCW1heF9kZWx0YRgC", - "IAEoAiIkCg9SYW5kb21BZGp1c3RIdWUSEQoJbWF4X2RlbHRhGAEgASgCIj4K", - "FlJhbmRvbUFkanVzdFNhdHVyYXRpb24SEQoJbWluX2RlbHRhGAEgASgCEhEK", - "CW1heF9kZWx0YRgCIAEoAiIsChJSYW5kb21EaXN0b3J0Q29sb3ISFgoOY29s", - "b3Jfb3JkZXJpbmcYASABKAUiIgoRUmFuZG9tSml0dGVyQm94ZXMSDQoFcmF0", - "aW8YASABKAIixgEKD1JhbmRvbUNyb3BJbWFnZRIaChJtaW5fb2JqZWN0X2Nv", - "dmVyZWQYASABKAISGAoQbWluX2FzcGVjdF9yYXRpbxgCIAEoAhIYChBtYXhf", - "YXNwZWN0X3JhdGlvGAMgASgCEhAKCG1pbl9hcmVhGAQgASgCEhAKCG1heF9h", - "cmVhGAUgASgCEhYKDm92ZXJsYXBfdGhyZXNoGAYgASgCEhIKCmNsaXBfYm94", - "ZXMYCCABKAgSEwoLcmFuZG9tX2NvZWYYByABKAIiiQEKDlJhbmRvbVBhZElt", - "YWdlEhgKEG1pbl9pbWFnZV9oZWlnaHQYASABKAUSFwoPbWluX2ltYWdlX3dp", - "ZHRoGAIgASgFEhgKEG1heF9pbWFnZV9oZWlnaHQYAyABKAUSFwoPbWF4X2lt", - "YWdlX3dpZHRoGAQgASgFEhEKCXBhZF9jb2xvchgFIAMoAiJiChZSYW5kb21B", - "YnNvbHV0ZVBhZEltYWdlEhoKEm1heF9oZWlnaHRfcGFkZGluZxgBIAEoBRIZ", - "ChFtYXhfd2lkdGhfcGFkZGluZxgCIAEoBRIRCglwYWRfY29sb3IYAyADKAIi", - "mgIKElJhbmRvbUNyb3BQYWRJbWFnZRIaChJtaW5fb2JqZWN0X2NvdmVyZWQY", - "ASABKAISGAoQbWluX2FzcGVjdF9yYXRpbxgCIAEoAhIYChBtYXhfYXNwZWN0", - "X3JhdGlvGAMgASgCEhAKCG1pbl9hcmVhGAQgASgCEhAKCG1heF9hcmVhGAUg", - "ASgCEhYKDm92ZXJsYXBfdGhyZXNoGAYgASgCEhIKCmNsaXBfYm94ZXMYCyAB", - "KAgSEwoLcmFuZG9tX2NvZWYYByABKAISHQoVbWluX3BhZGRlZF9zaXplX3Jh", - "dGlvGAggAygCEh0KFW1heF9wYWRkZWRfc2l6ZV9yYXRpbxgJIAMoAhIRCglw", - "YWRfY29sb3IYCiADKAIiWwoXUmFuZG9tQ3JvcFRvQXNwZWN0UmF0aW8SFAoM", - "YXNwZWN0X3JhdGlvGAEgASgCEhYKDm92ZXJsYXBfdGhyZXNoGAIgASgCEhIK", - "CmNsaXBfYm94ZXMYAyABKAgiYQoSUmFuZG9tQmxhY2tQYXRjaGVzEhkKEW1h", - "eF9ibGFja19wYXRjaGVzGAEgASgFEhMKC3Byb2JhYmlsaXR5GAIgASgCEhsK", - "E3NpemVfdG9faW1hZ2VfcmF0aW8YAyABKAIiQQoSUmFuZG9tUmVzaXplTWV0", - "aG9kEhUKDXRhcmdldF9oZWlnaHQYASABKAUSFAoMdGFyZ2V0X3dpZHRoGAIg", - "ASgFIgsKCVJHQnRvR3JheSIeChxTY2FsZUJveGVzVG9QaXhlbENvb3JkaW5h", - "dGVzIsABCgtSZXNpemVJbWFnZRISCgpuZXdfaGVpZ2h0GAEgASgFEhEKCW5l", - "d193aWR0aBgCIAEoBRI7CgZtZXRob2QYAyABKA4yKy5vYmplY3RfZGV0ZWN0", - "aW9uLnByb3Rvcy5SZXNpemVJbWFnZS5NZXRob2QiTQoGTWV0aG9kEggKBE5P", - "TkUQABIICgRBUkVBEAESCwoHQklDVUJJQxACEgwKCEJJTElORUFSEAMSFAoQ", - "TkVBUkVTVF9ORUlHSEJPUhAEIiQKE1N1YnRyYWN0Q2hhbm5lbE1lYW4SDQoF", - "bWVhbnMYASADKAIizQEKFlNTRFJhbmRvbUNyb3BPcGVyYXRpb24SGgoSbWlu", - "X29iamVjdF9jb3ZlcmVkGAEgASgCEhgKEG1pbl9hc3BlY3RfcmF0aW8YAiAB", - "KAISGAoQbWF4X2FzcGVjdF9yYXRpbxgDIAEoAhIQCghtaW5fYXJlYRgEIAEo", - "AhIQCghtYXhfYXJlYRgFIAEoAhIWCg5vdmVybGFwX3RocmVzaBgGIAEoAhIS", - "CgpjbGlwX2JveGVzGAggASgIEhMKC3JhbmRvbV9jb2VmGAcgASgCIlQKDVNT", - "RFJhbmRvbUNyb3ASQwoKb3BlcmF0aW9ucxgBIAMoCzIvLm9iamVjdF9kZXRl", - "Y3Rpb24ucHJvdG9zLlNTRFJhbmRvbUNyb3BPcGVyYXRpb24izQIKGVNTRFJh", - "bmRvbUNyb3BQYWRPcGVyYXRpb24SGgoSbWluX29iamVjdF9jb3ZlcmVkGAEg", - "ASgCEhgKEG1pbl9hc3BlY3RfcmF0aW8YAiABKAISGAoQbWF4X2FzcGVjdF9y", - "YXRpbxgDIAEoAhIQCghtaW5fYXJlYRgEIAEoAhIQCghtYXhfYXJlYRgFIAEo", - "AhIWCg5vdmVybGFwX3RocmVzaBgGIAEoAhISCgpjbGlwX2JveGVzGA0gASgI", - "EhMKC3JhbmRvbV9jb2VmGAcgASgCEh0KFW1pbl9wYWRkZWRfc2l6ZV9yYXRp", - "bxgIIAMoAhIdChVtYXhfcGFkZGVkX3NpemVfcmF0aW8YCSADKAISEwoLcGFk", - "X2NvbG9yX3IYCiABKAISEwoLcGFkX2NvbG9yX2cYCyABKAISEwoLcGFkX2Nv", - "bG9yX2IYDCABKAIiWgoQU1NEUmFuZG9tQ3JvcFBhZBJGCgpvcGVyYXRpb25z", - "GAEgAygLMjIub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuU1NEUmFuZG9tQ3Jv", - "cFBhZE9wZXJhdGlvbiKpAQomU1NEUmFuZG9tQ3JvcEZpeGVkQXNwZWN0UmF0", - "aW9PcGVyYXRpb24SGgoSbWluX29iamVjdF9jb3ZlcmVkGAEgASgCEhAKCG1p", - "bl9hcmVhGAQgASgCEhAKCG1heF9hcmVhGAUgASgCEhYKDm92ZXJsYXBfdGhy", - "ZXNoGAYgASgCEhIKCmNsaXBfYm94ZXMYCCABKAgSEwoLcmFuZG9tX2NvZWYY", - "ByABKAIiigEKHVNTRFJhbmRvbUNyb3BGaXhlZEFzcGVjdFJhdGlvElMKCm9w", - "ZXJhdGlvbnMYASADKAsyPy5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5TU0RS", - "YW5kb21Dcm9wRml4ZWRBc3BlY3RSYXRpb09wZXJhdGlvbhIUCgxhc3BlY3Rf", - "cmF0aW8YAiABKAIi4AEKKVNTRFJhbmRvbUNyb3BQYWRGaXhlZEFzcGVjdFJh", - "dGlvT3BlcmF0aW9uEhoKEm1pbl9vYmplY3RfY292ZXJlZBgBIAEoAhIYChBt", - "aW5fYXNwZWN0X3JhdGlvGAIgASgCEhgKEG1heF9hc3BlY3RfcmF0aW8YAyAB", - "KAISEAoIbWluX2FyZWEYBCABKAISEAoIbWF4X2FyZWEYBSABKAISFgoOb3Zl", - "cmxhcF90aHJlc2gYBiABKAISEgoKY2xpcF9ib3hlcxgIIAEoCBITCgtyYW5k", - "b21fY29lZhgHIAEoAiLOAQogU1NEUmFuZG9tQ3JvcFBhZEZpeGVkQXNwZWN0", - "UmF0aW8SVgoKb3BlcmF0aW9ucxgBIAMoCzJCLm9iamVjdF9kZXRlY3Rpb24u", - "cHJvdG9zLlNTRFJhbmRvbUNyb3BQYWRGaXhlZEFzcGVjdFJhdGlvT3BlcmF0", - "aW9uEhQKDGFzcGVjdF9yYXRpbxgCIAEoAhIdChVtaW5fcGFkZGVkX3NpemVf", - "cmF0aW8YAyADKAISHQoVbWF4X3BhZGRlZF9zaXplX3JhdGlvGAQgAygCIjIK", - "G0NvbnZlcnRDbGFzc0xvZ2l0c1RvU29mdG1heBITCgt0ZW1wZXJhdHVyZRgB", - "IAEoAiJjChVSYW5kb21TZWxmQ29uY2F0SW1hZ2USIwobY29uY2F0X3ZlcnRp", - "Y2FsX3Byb2JhYmlsaXR5GAEgASgCEiUKHWNvbmNhdF9ob3Jpem9udGFsX3By", - "b2JhYmlsaXR5GAIgASgCIicKEEF1dG9BdWdtZW50SW1hZ2USEwoLcG9saWN5", - "X25hbWUYASABKAkiRQoaRHJvcExhYmVsUHJvYmFiaWxpc3RpY2FsbHkSDQoF", - "bGFiZWwYASABKAUSGAoQZHJvcF9wcm9iYWJpbGl0eRgCIAEoAiI5CgtSZW1h", - "cExhYmVscxIXCg9vcmlnaW5hbF9sYWJlbHMYASADKAUSEQoJbmV3X2xhYmVs", - "GAIgASgFYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.PreprocessingStep), global::Tensorflow.Models.ObjectDetection.Protos.PreprocessingStep.Parser, new[]{ "NormalizeImage", "RandomHorizontalFlip", "RandomPixelValueScale", "RandomImageScale", "RandomRgbToGray", "RandomAdjustBrightness", "RandomAdjustContrast", "RandomAdjustHue", "RandomAdjustSaturation", "RandomDistortColor", "RandomJitterBoxes", "RandomCropImage", "RandomPadImage", "RandomCropPadImage", "RandomCropToAspectRatio", "RandomBlackPatches", "RandomResizeMethod", "ScaleBoxesToPixelCoordinates", "ResizeImage", "SubtractChannelMean", "SsdRandomCrop", "SsdRandomCropPad", "SsdRandomCropFixedAspectRatio", "SsdRandomCropPadFixedAspectRatio", "RandomVerticalFlip", "RandomRotation90", "RgbToGray", "ConvertClassLogitsToSoftmax", "RandomAbsolutePadImage", "RandomSelfConcatImage", "AutoaugmentImage", "DropLabelProbabilistically", "RemapLabels" }, new[]{ "PreprocessingStep" }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.NormalizeImage), global::Tensorflow.Models.ObjectDetection.Protos.NormalizeImage.Parser, new[]{ "OriginalMinval", "OriginalMaxval", "TargetMinval", "TargetMaxval" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip), global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip.Parser, new[]{ "KeypointFlipPermutation" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip), global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip.Parser, new[]{ "KeypointFlipPermutation" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90), global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90.Parser, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale), global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale.Parser, new[]{ "Minval", "Maxval" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale), global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale.Parser, new[]{ "MinScaleRatio", "MaxScaleRatio" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray), global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray.Parser, new[]{ "Probability" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness), global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness.Parser, new[]{ "MaxDelta" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast), global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast.Parser, new[]{ "MinDelta", "MaxDelta" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue), global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue.Parser, new[]{ "MaxDelta" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation), global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation.Parser, new[]{ "MinDelta", "MaxDelta" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor), global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor.Parser, new[]{ "ColorOrdering" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes), global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes.Parser, new[]{ "Ratio" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage), global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage.Parser, new[]{ "MinObjectCovered", "MinAspectRatio", "MaxAspectRatio", "MinArea", "MaxArea", "OverlapThresh", "ClipBoxes", "RandomCoef" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage), global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage.Parser, new[]{ "MinImageHeight", "MinImageWidth", "MaxImageHeight", "MaxImageWidth", "PadColor" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage), global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage.Parser, new[]{ "MaxHeightPadding", "MaxWidthPadding", "PadColor" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage), global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage.Parser, new[]{ "MinObjectCovered", "MinAspectRatio", "MaxAspectRatio", "MinArea", "MaxArea", "OverlapThresh", "ClipBoxes", "RandomCoef", "MinPaddedSizeRatio", "MaxPaddedSizeRatio", "PadColor" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio), global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio.Parser, new[]{ "AspectRatio", "OverlapThresh", "ClipBoxes" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches), global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches.Parser, new[]{ "MaxBlackPatches", "Probability", "SizeToImageRatio" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod), global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod.Parser, new[]{ "TargetHeight", "TargetWidth" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray), global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray.Parser, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates), global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates.Parser, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage), global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage.Parser, new[]{ "NewHeight", "NewWidth", "Method" }, null, new[]{ typeof(global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage.Types.Method) }, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean), global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean.Parser, new[]{ "Means" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropOperation), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropOperation.Parser, new[]{ "MinObjectCovered", "MinAspectRatio", "MaxAspectRatio", "MinArea", "MaxArea", "OverlapThresh", "ClipBoxes", "RandomCoef" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop.Parser, new[]{ "Operations" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadOperation), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadOperation.Parser, new[]{ "MinObjectCovered", "MinAspectRatio", "MaxAspectRatio", "MinArea", "MaxArea", "OverlapThresh", "ClipBoxes", "RandomCoef", "MinPaddedSizeRatio", "MaxPaddedSizeRatio", "PadColorR", "PadColorG", "PadColorB" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad.Parser, new[]{ "Operations" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatioOperation), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatioOperation.Parser, new[]{ "MinObjectCovered", "MinArea", "MaxArea", "OverlapThresh", "ClipBoxes", "RandomCoef" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio.Parser, new[]{ "Operations", "AspectRatio" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatioOperation), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatioOperation.Parser, new[]{ "MinObjectCovered", "MinAspectRatio", "MaxAspectRatio", "MinArea", "MaxArea", "OverlapThresh", "ClipBoxes", "RandomCoef" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio), global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio.Parser, new[]{ "Operations", "AspectRatio", "MinPaddedSizeRatio", "MaxPaddedSizeRatio" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax), global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax.Parser, new[]{ "Temperature" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage), global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage.Parser, new[]{ "ConcatVerticalProbability", "ConcatHorizontalProbability" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage), global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage.Parser, new[]{ "PolicyName" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically), global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically.Parser, new[]{ "Label", "DropProbability" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels), global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels.Parser, new[]{ "OriginalLabels", "NewLabel" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Message for defining a preprocessing operation on input data. - /// See: //third_party/tensorflow_models/object_detection/core/preprocessor.py - /// - public sealed partial class PreprocessingStep : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PreprocessingStep()); - 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.PreprocessorReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PreprocessingStep() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PreprocessingStep(PreprocessingStep other) : this() { - switch (other.PreprocessingStepCase) { - case PreprocessingStepOneofCase.NormalizeImage: - NormalizeImage = other.NormalizeImage.Clone(); - break; - case PreprocessingStepOneofCase.RandomHorizontalFlip: - RandomHorizontalFlip = other.RandomHorizontalFlip.Clone(); - break; - case PreprocessingStepOneofCase.RandomPixelValueScale: - RandomPixelValueScale = other.RandomPixelValueScale.Clone(); - break; - case PreprocessingStepOneofCase.RandomImageScale: - RandomImageScale = other.RandomImageScale.Clone(); - break; - case PreprocessingStepOneofCase.RandomRgbToGray: - RandomRgbToGray = other.RandomRgbToGray.Clone(); - break; - case PreprocessingStepOneofCase.RandomAdjustBrightness: - RandomAdjustBrightness = other.RandomAdjustBrightness.Clone(); - break; - case PreprocessingStepOneofCase.RandomAdjustContrast: - RandomAdjustContrast = other.RandomAdjustContrast.Clone(); - break; - case PreprocessingStepOneofCase.RandomAdjustHue: - RandomAdjustHue = other.RandomAdjustHue.Clone(); - break; - case PreprocessingStepOneofCase.RandomAdjustSaturation: - RandomAdjustSaturation = other.RandomAdjustSaturation.Clone(); - break; - case PreprocessingStepOneofCase.RandomDistortColor: - RandomDistortColor = other.RandomDistortColor.Clone(); - break; - case PreprocessingStepOneofCase.RandomJitterBoxes: - RandomJitterBoxes = other.RandomJitterBoxes.Clone(); - break; - case PreprocessingStepOneofCase.RandomCropImage: - RandomCropImage = other.RandomCropImage.Clone(); - break; - case PreprocessingStepOneofCase.RandomPadImage: - RandomPadImage = other.RandomPadImage.Clone(); - break; - case PreprocessingStepOneofCase.RandomCropPadImage: - RandomCropPadImage = other.RandomCropPadImage.Clone(); - break; - case PreprocessingStepOneofCase.RandomCropToAspectRatio: - RandomCropToAspectRatio = other.RandomCropToAspectRatio.Clone(); - break; - case PreprocessingStepOneofCase.RandomBlackPatches: - RandomBlackPatches = other.RandomBlackPatches.Clone(); - break; - case PreprocessingStepOneofCase.RandomResizeMethod: - RandomResizeMethod = other.RandomResizeMethod.Clone(); - break; - case PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates: - ScaleBoxesToPixelCoordinates = other.ScaleBoxesToPixelCoordinates.Clone(); - break; - case PreprocessingStepOneofCase.ResizeImage: - ResizeImage = other.ResizeImage.Clone(); - break; - case PreprocessingStepOneofCase.SubtractChannelMean: - SubtractChannelMean = other.SubtractChannelMean.Clone(); - break; - case PreprocessingStepOneofCase.SsdRandomCrop: - SsdRandomCrop = other.SsdRandomCrop.Clone(); - break; - case PreprocessingStepOneofCase.SsdRandomCropPad: - SsdRandomCropPad = other.SsdRandomCropPad.Clone(); - break; - case PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio: - SsdRandomCropFixedAspectRatio = other.SsdRandomCropFixedAspectRatio.Clone(); - break; - case PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio: - SsdRandomCropPadFixedAspectRatio = other.SsdRandomCropPadFixedAspectRatio.Clone(); - break; - case PreprocessingStepOneofCase.RandomVerticalFlip: - RandomVerticalFlip = other.RandomVerticalFlip.Clone(); - break; - case PreprocessingStepOneofCase.RandomRotation90: - RandomRotation90 = other.RandomRotation90.Clone(); - break; - case PreprocessingStepOneofCase.RgbToGray: - RgbToGray = other.RgbToGray.Clone(); - break; - case PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax: - ConvertClassLogitsToSoftmax = other.ConvertClassLogitsToSoftmax.Clone(); - break; - case PreprocessingStepOneofCase.RandomAbsolutePadImage: - RandomAbsolutePadImage = other.RandomAbsolutePadImage.Clone(); - break; - case PreprocessingStepOneofCase.RandomSelfConcatImage: - RandomSelfConcatImage = other.RandomSelfConcatImage.Clone(); - break; - case PreprocessingStepOneofCase.AutoaugmentImage: - AutoaugmentImage = other.AutoaugmentImage.Clone(); - break; - case PreprocessingStepOneofCase.DropLabelProbabilistically: - DropLabelProbabilistically = other.DropLabelProbabilistically.Clone(); - break; - case PreprocessingStepOneofCase.RemapLabels: - RemapLabels = other.RemapLabels.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PreprocessingStep Clone() { - return new PreprocessingStep(this); - } - - /// Field number for the "normalize_image" field. - public const int NormalizeImageFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.NormalizeImage NormalizeImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.NormalizeImage ? (global::Tensorflow.Models.ObjectDetection.Protos.NormalizeImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.NormalizeImage; - } - } - - /// Field number for the "random_horizontal_flip" field. - public const int RandomHorizontalFlipFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip RandomHorizontalFlip { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomHorizontalFlip ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomHorizontalFlip; - } - } - - /// Field number for the "random_pixel_value_scale" field. - public const int RandomPixelValueScaleFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale RandomPixelValueScale { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPixelValueScale ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomPixelValueScale; - } - } - - /// Field number for the "random_image_scale" field. - public const int RandomImageScaleFieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale RandomImageScale { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomImageScale ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomImageScale; - } - } - - /// Field number for the "random_rgb_to_gray" field. - public const int RandomRgbToGrayFieldNumber = 5; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray RandomRgbToGray { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRgbToGray ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomRgbToGray; - } - } - - /// Field number for the "random_adjust_brightness" field. - public const int RandomAdjustBrightnessFieldNumber = 6; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness RandomAdjustBrightness { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustBrightness ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomAdjustBrightness; - } - } - - /// Field number for the "random_adjust_contrast" field. - public const int RandomAdjustContrastFieldNumber = 7; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast RandomAdjustContrast { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustContrast ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomAdjustContrast; - } - } - - /// Field number for the "random_adjust_hue" field. - public const int RandomAdjustHueFieldNumber = 8; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue RandomAdjustHue { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustHue ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomAdjustHue; - } - } - - /// Field number for the "random_adjust_saturation" field. - public const int RandomAdjustSaturationFieldNumber = 9; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation RandomAdjustSaturation { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustSaturation ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomAdjustSaturation; - } - } - - /// Field number for the "random_distort_color" field. - public const int RandomDistortColorFieldNumber = 10; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor RandomDistortColor { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomDistortColor ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomDistortColor; - } - } - - /// Field number for the "random_jitter_boxes" field. - public const int RandomJitterBoxesFieldNumber = 11; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes RandomJitterBoxes { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomJitterBoxes ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomJitterBoxes; - } - } - - /// Field number for the "random_crop_image" field. - public const int RandomCropImageFieldNumber = 12; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage RandomCropImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropImage ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomCropImage; - } - } - - /// Field number for the "random_pad_image" field. - public const int RandomPadImageFieldNumber = 13; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage RandomPadImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPadImage ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomPadImage; - } - } - - /// Field number for the "random_crop_pad_image" field. - public const int RandomCropPadImageFieldNumber = 14; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage RandomCropPadImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropPadImage ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomCropPadImage; - } - } - - /// Field number for the "random_crop_to_aspect_ratio" field. - public const int RandomCropToAspectRatioFieldNumber = 15; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio RandomCropToAspectRatio { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropToAspectRatio ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomCropToAspectRatio; - } - } - - /// Field number for the "random_black_patches" field. - public const int RandomBlackPatchesFieldNumber = 16; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches RandomBlackPatches { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomBlackPatches ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomBlackPatches; - } - } - - /// Field number for the "random_resize_method" field. - public const int RandomResizeMethodFieldNumber = 17; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod RandomResizeMethod { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomResizeMethod ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomResizeMethod; - } - } - - /// Field number for the "scale_boxes_to_pixel_coordinates" field. - public const int ScaleBoxesToPixelCoordinatesFieldNumber = 18; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates ScaleBoxesToPixelCoordinates { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates ? (global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates; - } - } - - /// Field number for the "resize_image" field. - public const int ResizeImageFieldNumber = 19; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage ResizeImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.ResizeImage ? (global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.ResizeImage; - } - } - - /// Field number for the "subtract_channel_mean" field. - public const int SubtractChannelMeanFieldNumber = 20; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean SubtractChannelMean { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.SubtractChannelMean ? (global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.SubtractChannelMean; - } - } - - /// Field number for the "ssd_random_crop" field. - public const int SsdRandomCropFieldNumber = 21; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop SsdRandomCrop { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCrop ? (global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.SsdRandomCrop; - } - } - - /// Field number for the "ssd_random_crop_pad" field. - public const int SsdRandomCropPadFieldNumber = 22; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad SsdRandomCropPad { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPad ? (global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.SsdRandomCropPad; - } - } - - /// Field number for the "ssd_random_crop_fixed_aspect_ratio" field. - public const int SsdRandomCropFixedAspectRatioFieldNumber = 23; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio SsdRandomCropFixedAspectRatio { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio ? (global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio; - } - } - - /// Field number for the "ssd_random_crop_pad_fixed_aspect_ratio" field. - public const int SsdRandomCropPadFixedAspectRatioFieldNumber = 24; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio SsdRandomCropPadFixedAspectRatio { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio ? (global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio; - } - } - - /// Field number for the "random_vertical_flip" field. - public const int RandomVerticalFlipFieldNumber = 25; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip RandomVerticalFlip { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomVerticalFlip ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomVerticalFlip; - } - } - - /// Field number for the "random_rotation90" field. - public const int RandomRotation90FieldNumber = 26; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90 RandomRotation90 { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRotation90 ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomRotation90; - } - } - - /// Field number for the "rgb_to_gray" field. - public const int RgbToGrayFieldNumber = 27; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray RgbToGray { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RgbToGray ? (global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RgbToGray; - } - } - - /// Field number for the "convert_class_logits_to_softmax" field. - public const int ConvertClassLogitsToSoftmaxFieldNumber = 28; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax ConvertClassLogitsToSoftmax { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax ? (global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax; - } - } - - /// Field number for the "random_absolute_pad_image" field. - public const int RandomAbsolutePadImageFieldNumber = 29; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage RandomAbsolutePadImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAbsolutePadImage ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomAbsolutePadImage; - } - } - - /// Field number for the "random_self_concat_image" field. - public const int RandomSelfConcatImageFieldNumber = 30; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage RandomSelfConcatImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RandomSelfConcatImage ? (global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RandomSelfConcatImage; - } - } - - /// Field number for the "autoaugment_image" field. - public const int AutoaugmentImageFieldNumber = 31; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage AutoaugmentImage { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.AutoaugmentImage ? (global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.AutoaugmentImage; - } - } - - /// Field number for the "drop_label_probabilistically" field. - public const int DropLabelProbabilisticallyFieldNumber = 32; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically DropLabelProbabilistically { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.DropLabelProbabilistically ? (global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.DropLabelProbabilistically; - } - } - - /// Field number for the "remap_labels" field. - public const int RemapLabelsFieldNumber = 33; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels RemapLabels { - get { return preprocessingStepCase_ == PreprocessingStepOneofCase.RemapLabels ? (global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels) preprocessingStep_ : null; } - set { - preprocessingStep_ = value; - preprocessingStepCase_ = value == null ? PreprocessingStepOneofCase.None : PreprocessingStepOneofCase.RemapLabels; - } - } - - private object preprocessingStep_; - /// Enum of possible cases for the "preprocessing_step" oneof. - public enum PreprocessingStepOneofCase { - None = 0, - NormalizeImage = 1, - RandomHorizontalFlip = 2, - RandomPixelValueScale = 3, - RandomImageScale = 4, - RandomRgbToGray = 5, - RandomAdjustBrightness = 6, - RandomAdjustContrast = 7, - RandomAdjustHue = 8, - RandomAdjustSaturation = 9, - RandomDistortColor = 10, - RandomJitterBoxes = 11, - RandomCropImage = 12, - RandomPadImage = 13, - RandomCropPadImage = 14, - RandomCropToAspectRatio = 15, - RandomBlackPatches = 16, - RandomResizeMethod = 17, - ScaleBoxesToPixelCoordinates = 18, - ResizeImage = 19, - SubtractChannelMean = 20, - SsdRandomCrop = 21, - SsdRandomCropPad = 22, - SsdRandomCropFixedAspectRatio = 23, - SsdRandomCropPadFixedAspectRatio = 24, - RandomVerticalFlip = 25, - RandomRotation90 = 26, - RgbToGray = 27, - ConvertClassLogitsToSoftmax = 28, - RandomAbsolutePadImage = 29, - RandomSelfConcatImage = 30, - AutoaugmentImage = 31, - DropLabelProbabilistically = 32, - RemapLabels = 33, - } - private PreprocessingStepOneofCase preprocessingStepCase_ = PreprocessingStepOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public PreprocessingStepOneofCase PreprocessingStepCase { - get { return preprocessingStepCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearPreprocessingStep() { - preprocessingStepCase_ = PreprocessingStepOneofCase.None; - preprocessingStep_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as PreprocessingStep); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(PreprocessingStep other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(NormalizeImage, other.NormalizeImage)) return false; - if (!object.Equals(RandomHorizontalFlip, other.RandomHorizontalFlip)) return false; - if (!object.Equals(RandomPixelValueScale, other.RandomPixelValueScale)) return false; - if (!object.Equals(RandomImageScale, other.RandomImageScale)) return false; - if (!object.Equals(RandomRgbToGray, other.RandomRgbToGray)) return false; - if (!object.Equals(RandomAdjustBrightness, other.RandomAdjustBrightness)) return false; - if (!object.Equals(RandomAdjustContrast, other.RandomAdjustContrast)) return false; - if (!object.Equals(RandomAdjustHue, other.RandomAdjustHue)) return false; - if (!object.Equals(RandomAdjustSaturation, other.RandomAdjustSaturation)) return false; - if (!object.Equals(RandomDistortColor, other.RandomDistortColor)) return false; - if (!object.Equals(RandomJitterBoxes, other.RandomJitterBoxes)) return false; - if (!object.Equals(RandomCropImage, other.RandomCropImage)) return false; - if (!object.Equals(RandomPadImage, other.RandomPadImage)) return false; - if (!object.Equals(RandomCropPadImage, other.RandomCropPadImage)) return false; - if (!object.Equals(RandomCropToAspectRatio, other.RandomCropToAspectRatio)) return false; - if (!object.Equals(RandomBlackPatches, other.RandomBlackPatches)) return false; - if (!object.Equals(RandomResizeMethod, other.RandomResizeMethod)) return false; - if (!object.Equals(ScaleBoxesToPixelCoordinates, other.ScaleBoxesToPixelCoordinates)) return false; - if (!object.Equals(ResizeImage, other.ResizeImage)) return false; - if (!object.Equals(SubtractChannelMean, other.SubtractChannelMean)) return false; - if (!object.Equals(SsdRandomCrop, other.SsdRandomCrop)) return false; - if (!object.Equals(SsdRandomCropPad, other.SsdRandomCropPad)) return false; - if (!object.Equals(SsdRandomCropFixedAspectRatio, other.SsdRandomCropFixedAspectRatio)) return false; - if (!object.Equals(SsdRandomCropPadFixedAspectRatio, other.SsdRandomCropPadFixedAspectRatio)) return false; - if (!object.Equals(RandomVerticalFlip, other.RandomVerticalFlip)) return false; - if (!object.Equals(RandomRotation90, other.RandomRotation90)) return false; - if (!object.Equals(RgbToGray, other.RgbToGray)) return false; - if (!object.Equals(ConvertClassLogitsToSoftmax, other.ConvertClassLogitsToSoftmax)) return false; - if (!object.Equals(RandomAbsolutePadImage, other.RandomAbsolutePadImage)) return false; - if (!object.Equals(RandomSelfConcatImage, other.RandomSelfConcatImage)) return false; - if (!object.Equals(AutoaugmentImage, other.AutoaugmentImage)) return false; - if (!object.Equals(DropLabelProbabilistically, other.DropLabelProbabilistically)) return false; - if (!object.Equals(RemapLabels, other.RemapLabels)) return false; - if (PreprocessingStepCase != other.PreprocessingStepCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (preprocessingStepCase_ == PreprocessingStepOneofCase.NormalizeImage) hash ^= NormalizeImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomHorizontalFlip) hash ^= RandomHorizontalFlip.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPixelValueScale) hash ^= RandomPixelValueScale.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomImageScale) hash ^= RandomImageScale.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRgbToGray) hash ^= RandomRgbToGray.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustBrightness) hash ^= RandomAdjustBrightness.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustContrast) hash ^= RandomAdjustContrast.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustHue) hash ^= RandomAdjustHue.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustSaturation) hash ^= RandomAdjustSaturation.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomDistortColor) hash ^= RandomDistortColor.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomJitterBoxes) hash ^= RandomJitterBoxes.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropImage) hash ^= RandomCropImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPadImage) hash ^= RandomPadImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropPadImage) hash ^= RandomCropPadImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropToAspectRatio) hash ^= RandomCropToAspectRatio.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomBlackPatches) hash ^= RandomBlackPatches.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomResizeMethod) hash ^= RandomResizeMethod.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates) hash ^= ScaleBoxesToPixelCoordinates.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ResizeImage) hash ^= ResizeImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SubtractChannelMean) hash ^= SubtractChannelMean.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCrop) hash ^= SsdRandomCrop.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPad) hash ^= SsdRandomCropPad.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio) hash ^= SsdRandomCropFixedAspectRatio.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio) hash ^= SsdRandomCropPadFixedAspectRatio.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomVerticalFlip) hash ^= RandomVerticalFlip.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRotation90) hash ^= RandomRotation90.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RgbToGray) hash ^= RgbToGray.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax) hash ^= ConvertClassLogitsToSoftmax.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAbsolutePadImage) hash ^= RandomAbsolutePadImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomSelfConcatImage) hash ^= RandomSelfConcatImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.AutoaugmentImage) hash ^= AutoaugmentImage.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.DropLabelProbabilistically) hash ^= DropLabelProbabilistically.GetHashCode(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RemapLabels) hash ^= RemapLabels.GetHashCode(); - hash ^= (int) preprocessingStepCase_; - 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 (preprocessingStepCase_ == PreprocessingStepOneofCase.NormalizeImage) { - output.WriteRawTag(10); - output.WriteMessage(NormalizeImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomHorizontalFlip) { - output.WriteRawTag(18); - output.WriteMessage(RandomHorizontalFlip); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPixelValueScale) { - output.WriteRawTag(26); - output.WriteMessage(RandomPixelValueScale); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomImageScale) { - output.WriteRawTag(34); - output.WriteMessage(RandomImageScale); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRgbToGray) { - output.WriteRawTag(42); - output.WriteMessage(RandomRgbToGray); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustBrightness) { - output.WriteRawTag(50); - output.WriteMessage(RandomAdjustBrightness); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustContrast) { - output.WriteRawTag(58); - output.WriteMessage(RandomAdjustContrast); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustHue) { - output.WriteRawTag(66); - output.WriteMessage(RandomAdjustHue); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustSaturation) { - output.WriteRawTag(74); - output.WriteMessage(RandomAdjustSaturation); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomDistortColor) { - output.WriteRawTag(82); - output.WriteMessage(RandomDistortColor); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomJitterBoxes) { - output.WriteRawTag(90); - output.WriteMessage(RandomJitterBoxes); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropImage) { - output.WriteRawTag(98); - output.WriteMessage(RandomCropImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPadImage) { - output.WriteRawTag(106); - output.WriteMessage(RandomPadImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropPadImage) { - output.WriteRawTag(114); - output.WriteMessage(RandomCropPadImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropToAspectRatio) { - output.WriteRawTag(122); - output.WriteMessage(RandomCropToAspectRatio); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomBlackPatches) { - output.WriteRawTag(130, 1); - output.WriteMessage(RandomBlackPatches); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomResizeMethod) { - output.WriteRawTag(138, 1); - output.WriteMessage(RandomResizeMethod); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates) { - output.WriteRawTag(146, 1); - output.WriteMessage(ScaleBoxesToPixelCoordinates); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ResizeImage) { - output.WriteRawTag(154, 1); - output.WriteMessage(ResizeImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SubtractChannelMean) { - output.WriteRawTag(162, 1); - output.WriteMessage(SubtractChannelMean); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCrop) { - output.WriteRawTag(170, 1); - output.WriteMessage(SsdRandomCrop); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPad) { - output.WriteRawTag(178, 1); - output.WriteMessage(SsdRandomCropPad); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio) { - output.WriteRawTag(186, 1); - output.WriteMessage(SsdRandomCropFixedAspectRatio); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio) { - output.WriteRawTag(194, 1); - output.WriteMessage(SsdRandomCropPadFixedAspectRatio); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomVerticalFlip) { - output.WriteRawTag(202, 1); - output.WriteMessage(RandomVerticalFlip); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRotation90) { - output.WriteRawTag(210, 1); - output.WriteMessage(RandomRotation90); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RgbToGray) { - output.WriteRawTag(218, 1); - output.WriteMessage(RgbToGray); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax) { - output.WriteRawTag(226, 1); - output.WriteMessage(ConvertClassLogitsToSoftmax); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAbsolutePadImage) { - output.WriteRawTag(234, 1); - output.WriteMessage(RandomAbsolutePadImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomSelfConcatImage) { - output.WriteRawTag(242, 1); - output.WriteMessage(RandomSelfConcatImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.AutoaugmentImage) { - output.WriteRawTag(250, 1); - output.WriteMessage(AutoaugmentImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.DropLabelProbabilistically) { - output.WriteRawTag(130, 2); - output.WriteMessage(DropLabelProbabilistically); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RemapLabels) { - output.WriteRawTag(138, 2); - output.WriteMessage(RemapLabels); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (preprocessingStepCase_ == PreprocessingStepOneofCase.NormalizeImage) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(NormalizeImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomHorizontalFlip) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomHorizontalFlip); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPixelValueScale) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomPixelValueScale); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomImageScale) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomImageScale); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRgbToGray) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomRgbToGray); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustBrightness) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomAdjustBrightness); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustContrast) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomAdjustContrast); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustHue) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomAdjustHue); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustSaturation) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomAdjustSaturation); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomDistortColor) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomDistortColor); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomJitterBoxes) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomJitterBoxes); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropImage) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomCropImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPadImage) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomPadImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropPadImage) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomCropPadImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropToAspectRatio) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(RandomCropToAspectRatio); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomBlackPatches) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RandomBlackPatches); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomResizeMethod) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RandomResizeMethod); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(ScaleBoxesToPixelCoordinates); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ResizeImage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(ResizeImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SubtractChannelMean) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(SubtractChannelMean); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCrop) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(SsdRandomCrop); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPad) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(SsdRandomCropPad); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(SsdRandomCropFixedAspectRatio); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(SsdRandomCropPadFixedAspectRatio); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomVerticalFlip) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RandomVerticalFlip); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRotation90) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RandomRotation90); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RgbToGray) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RgbToGray); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(ConvertClassLogitsToSoftmax); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAbsolutePadImage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RandomAbsolutePadImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomSelfConcatImage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RandomSelfConcatImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.AutoaugmentImage) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(AutoaugmentImage); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.DropLabelProbabilistically) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(DropLabelProbabilistically); - } - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RemapLabels) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(RemapLabels); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(PreprocessingStep other) { - if (other == null) { - return; - } - switch (other.PreprocessingStepCase) { - case PreprocessingStepOneofCase.NormalizeImage: - if (NormalizeImage == null) { - NormalizeImage = new global::Tensorflow.Models.ObjectDetection.Protos.NormalizeImage(); - } - NormalizeImage.MergeFrom(other.NormalizeImage); - break; - case PreprocessingStepOneofCase.RandomHorizontalFlip: - if (RandomHorizontalFlip == null) { - RandomHorizontalFlip = new global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip(); - } - RandomHorizontalFlip.MergeFrom(other.RandomHorizontalFlip); - break; - case PreprocessingStepOneofCase.RandomPixelValueScale: - if (RandomPixelValueScale == null) { - RandomPixelValueScale = new global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale(); - } - RandomPixelValueScale.MergeFrom(other.RandomPixelValueScale); - break; - case PreprocessingStepOneofCase.RandomImageScale: - if (RandomImageScale == null) { - RandomImageScale = new global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale(); - } - RandomImageScale.MergeFrom(other.RandomImageScale); - break; - case PreprocessingStepOneofCase.RandomRgbToGray: - if (RandomRgbToGray == null) { - RandomRgbToGray = new global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray(); - } - RandomRgbToGray.MergeFrom(other.RandomRgbToGray); - break; - case PreprocessingStepOneofCase.RandomAdjustBrightness: - if (RandomAdjustBrightness == null) { - RandomAdjustBrightness = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness(); - } - RandomAdjustBrightness.MergeFrom(other.RandomAdjustBrightness); - break; - case PreprocessingStepOneofCase.RandomAdjustContrast: - if (RandomAdjustContrast == null) { - RandomAdjustContrast = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast(); - } - RandomAdjustContrast.MergeFrom(other.RandomAdjustContrast); - break; - case PreprocessingStepOneofCase.RandomAdjustHue: - if (RandomAdjustHue == null) { - RandomAdjustHue = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue(); - } - RandomAdjustHue.MergeFrom(other.RandomAdjustHue); - break; - case PreprocessingStepOneofCase.RandomAdjustSaturation: - if (RandomAdjustSaturation == null) { - RandomAdjustSaturation = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation(); - } - RandomAdjustSaturation.MergeFrom(other.RandomAdjustSaturation); - break; - case PreprocessingStepOneofCase.RandomDistortColor: - if (RandomDistortColor == null) { - RandomDistortColor = new global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor(); - } - RandomDistortColor.MergeFrom(other.RandomDistortColor); - break; - case PreprocessingStepOneofCase.RandomJitterBoxes: - if (RandomJitterBoxes == null) { - RandomJitterBoxes = new global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes(); - } - RandomJitterBoxes.MergeFrom(other.RandomJitterBoxes); - break; - case PreprocessingStepOneofCase.RandomCropImage: - if (RandomCropImage == null) { - RandomCropImage = new global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage(); - } - RandomCropImage.MergeFrom(other.RandomCropImage); - break; - case PreprocessingStepOneofCase.RandomPadImage: - if (RandomPadImage == null) { - RandomPadImage = new global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage(); - } - RandomPadImage.MergeFrom(other.RandomPadImage); - break; - case PreprocessingStepOneofCase.RandomCropPadImage: - if (RandomCropPadImage == null) { - RandomCropPadImage = new global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage(); - } - RandomCropPadImage.MergeFrom(other.RandomCropPadImage); - break; - case PreprocessingStepOneofCase.RandomCropToAspectRatio: - if (RandomCropToAspectRatio == null) { - RandomCropToAspectRatio = new global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio(); - } - RandomCropToAspectRatio.MergeFrom(other.RandomCropToAspectRatio); - break; - case PreprocessingStepOneofCase.RandomBlackPatches: - if (RandomBlackPatches == null) { - RandomBlackPatches = new global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches(); - } - RandomBlackPatches.MergeFrom(other.RandomBlackPatches); - break; - case PreprocessingStepOneofCase.RandomResizeMethod: - if (RandomResizeMethod == null) { - RandomResizeMethod = new global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod(); - } - RandomResizeMethod.MergeFrom(other.RandomResizeMethod); - break; - case PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates: - if (ScaleBoxesToPixelCoordinates == null) { - ScaleBoxesToPixelCoordinates = new global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates(); - } - ScaleBoxesToPixelCoordinates.MergeFrom(other.ScaleBoxesToPixelCoordinates); - break; - case PreprocessingStepOneofCase.ResizeImage: - if (ResizeImage == null) { - ResizeImage = new global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage(); - } - ResizeImage.MergeFrom(other.ResizeImage); - break; - case PreprocessingStepOneofCase.SubtractChannelMean: - if (SubtractChannelMean == null) { - SubtractChannelMean = new global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean(); - } - SubtractChannelMean.MergeFrom(other.SubtractChannelMean); - break; - case PreprocessingStepOneofCase.SsdRandomCrop: - if (SsdRandomCrop == null) { - SsdRandomCrop = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop(); - } - SsdRandomCrop.MergeFrom(other.SsdRandomCrop); - break; - case PreprocessingStepOneofCase.SsdRandomCropPad: - if (SsdRandomCropPad == null) { - SsdRandomCropPad = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad(); - } - SsdRandomCropPad.MergeFrom(other.SsdRandomCropPad); - break; - case PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio: - if (SsdRandomCropFixedAspectRatio == null) { - SsdRandomCropFixedAspectRatio = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio(); - } - SsdRandomCropFixedAspectRatio.MergeFrom(other.SsdRandomCropFixedAspectRatio); - break; - case PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio: - if (SsdRandomCropPadFixedAspectRatio == null) { - SsdRandomCropPadFixedAspectRatio = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio(); - } - SsdRandomCropPadFixedAspectRatio.MergeFrom(other.SsdRandomCropPadFixedAspectRatio); - break; - case PreprocessingStepOneofCase.RandomVerticalFlip: - if (RandomVerticalFlip == null) { - RandomVerticalFlip = new global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip(); - } - RandomVerticalFlip.MergeFrom(other.RandomVerticalFlip); - break; - case PreprocessingStepOneofCase.RandomRotation90: - if (RandomRotation90 == null) { - RandomRotation90 = new global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90(); - } - RandomRotation90.MergeFrom(other.RandomRotation90); - break; - case PreprocessingStepOneofCase.RgbToGray: - if (RgbToGray == null) { - RgbToGray = new global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray(); - } - RgbToGray.MergeFrom(other.RgbToGray); - break; - case PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax: - if (ConvertClassLogitsToSoftmax == null) { - ConvertClassLogitsToSoftmax = new global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax(); - } - ConvertClassLogitsToSoftmax.MergeFrom(other.ConvertClassLogitsToSoftmax); - break; - case PreprocessingStepOneofCase.RandomAbsolutePadImage: - if (RandomAbsolutePadImage == null) { - RandomAbsolutePadImage = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage(); - } - RandomAbsolutePadImage.MergeFrom(other.RandomAbsolutePadImage); - break; - case PreprocessingStepOneofCase.RandomSelfConcatImage: - if (RandomSelfConcatImage == null) { - RandomSelfConcatImage = new global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage(); - } - RandomSelfConcatImage.MergeFrom(other.RandomSelfConcatImage); - break; - case PreprocessingStepOneofCase.AutoaugmentImage: - if (AutoaugmentImage == null) { - AutoaugmentImage = new global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage(); - } - AutoaugmentImage.MergeFrom(other.AutoaugmentImage); - break; - case PreprocessingStepOneofCase.DropLabelProbabilistically: - if (DropLabelProbabilistically == null) { - DropLabelProbabilistically = new global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically(); - } - DropLabelProbabilistically.MergeFrom(other.DropLabelProbabilistically); - break; - case PreprocessingStepOneofCase.RemapLabels: - if (RemapLabels == null) { - RemapLabels = new global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels(); - } - RemapLabels.MergeFrom(other.RemapLabels); - 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.NormalizeImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.NormalizeImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.NormalizeImage) { - subBuilder.MergeFrom(NormalizeImage); - } - input.ReadMessage(subBuilder); - NormalizeImage = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomHorizontalFlip(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomHorizontalFlip) { - subBuilder.MergeFrom(RandomHorizontalFlip); - } - input.ReadMessage(subBuilder); - RandomHorizontalFlip = subBuilder; - break; - } - case 26: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomPixelValueScale(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPixelValueScale) { - subBuilder.MergeFrom(RandomPixelValueScale); - } - input.ReadMessage(subBuilder); - RandomPixelValueScale = subBuilder; - break; - } - case 34: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomImageScale(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomImageScale) { - subBuilder.MergeFrom(RandomImageScale); - } - input.ReadMessage(subBuilder); - RandomImageScale = subBuilder; - break; - } - case 42: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomRGBtoGray(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRgbToGray) { - subBuilder.MergeFrom(RandomRgbToGray); - } - input.ReadMessage(subBuilder); - RandomRgbToGray = subBuilder; - break; - } - case 50: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustBrightness(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustBrightness) { - subBuilder.MergeFrom(RandomAdjustBrightness); - } - input.ReadMessage(subBuilder); - RandomAdjustBrightness = subBuilder; - break; - } - case 58: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustContrast(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustContrast) { - subBuilder.MergeFrom(RandomAdjustContrast); - } - input.ReadMessage(subBuilder); - RandomAdjustContrast = subBuilder; - break; - } - case 66: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustHue(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustHue) { - subBuilder.MergeFrom(RandomAdjustHue); - } - input.ReadMessage(subBuilder); - RandomAdjustHue = subBuilder; - break; - } - case 74: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAdjustSaturation(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAdjustSaturation) { - subBuilder.MergeFrom(RandomAdjustSaturation); - } - input.ReadMessage(subBuilder); - RandomAdjustSaturation = subBuilder; - break; - } - case 82: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomDistortColor(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomDistortColor) { - subBuilder.MergeFrom(RandomDistortColor); - } - input.ReadMessage(subBuilder); - RandomDistortColor = subBuilder; - break; - } - case 90: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomJitterBoxes(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomJitterBoxes) { - subBuilder.MergeFrom(RandomJitterBoxes); - } - input.ReadMessage(subBuilder); - RandomJitterBoxes = subBuilder; - break; - } - case 98: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomCropImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropImage) { - subBuilder.MergeFrom(RandomCropImage); - } - input.ReadMessage(subBuilder); - RandomCropImage = subBuilder; - break; - } - case 106: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomPadImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomPadImage) { - subBuilder.MergeFrom(RandomPadImage); - } - input.ReadMessage(subBuilder); - RandomPadImage = subBuilder; - break; - } - case 114: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomCropPadImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropPadImage) { - subBuilder.MergeFrom(RandomCropPadImage); - } - input.ReadMessage(subBuilder); - RandomCropPadImage = subBuilder; - break; - } - case 122: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomCropToAspectRatio(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomCropToAspectRatio) { - subBuilder.MergeFrom(RandomCropToAspectRatio); - } - input.ReadMessage(subBuilder); - RandomCropToAspectRatio = subBuilder; - break; - } - case 130: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomBlackPatches(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomBlackPatches) { - subBuilder.MergeFrom(RandomBlackPatches); - } - input.ReadMessage(subBuilder); - RandomBlackPatches = subBuilder; - break; - } - case 138: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomResizeMethod(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomResizeMethod) { - subBuilder.MergeFrom(RandomResizeMethod); - } - input.ReadMessage(subBuilder); - RandomResizeMethod = subBuilder; - break; - } - case 146: { - global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ScaleBoxesToPixelCoordinates(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ScaleBoxesToPixelCoordinates) { - subBuilder.MergeFrom(ScaleBoxesToPixelCoordinates); - } - input.ReadMessage(subBuilder); - ScaleBoxesToPixelCoordinates = subBuilder; - break; - } - case 154: { - global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ResizeImage) { - subBuilder.MergeFrom(ResizeImage); - } - input.ReadMessage(subBuilder); - ResizeImage = subBuilder; - break; - } - case 162: { - global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SubtractChannelMean(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SubtractChannelMean) { - subBuilder.MergeFrom(SubtractChannelMean); - } - input.ReadMessage(subBuilder); - SubtractChannelMean = subBuilder; - break; - } - case 170: { - global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCrop(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCrop) { - subBuilder.MergeFrom(SsdRandomCrop); - } - input.ReadMessage(subBuilder); - SsdRandomCrop = subBuilder; - break; - } - case 178: { - global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPad(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPad) { - subBuilder.MergeFrom(SsdRandomCropPad); - } - input.ReadMessage(subBuilder); - SsdRandomCropPad = subBuilder; - break; - } - case 186: { - global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatio(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropFixedAspectRatio) { - subBuilder.MergeFrom(SsdRandomCropFixedAspectRatio); - } - input.ReadMessage(subBuilder); - SsdRandomCropFixedAspectRatio = subBuilder; - break; - } - case 194: { - global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatio(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.SsdRandomCropPadFixedAspectRatio) { - subBuilder.MergeFrom(SsdRandomCropPadFixedAspectRatio); - } - input.ReadMessage(subBuilder); - SsdRandomCropPadFixedAspectRatio = subBuilder; - break; - } - case 202: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomVerticalFlip(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomVerticalFlip) { - subBuilder.MergeFrom(RandomVerticalFlip); - } - input.ReadMessage(subBuilder); - RandomVerticalFlip = subBuilder; - break; - } - case 210: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90 subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomRotation90(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomRotation90) { - subBuilder.MergeFrom(RandomRotation90); - } - input.ReadMessage(subBuilder); - RandomRotation90 = subBuilder; - break; - } - case 218: { - global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RGBtoGray(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RgbToGray) { - subBuilder.MergeFrom(RgbToGray); - } - input.ReadMessage(subBuilder); - RgbToGray = subBuilder; - break; - } - case 226: { - global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ConvertClassLogitsToSoftmax(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.ConvertClassLogitsToSoftmax) { - subBuilder.MergeFrom(ConvertClassLogitsToSoftmax); - } - input.ReadMessage(subBuilder); - ConvertClassLogitsToSoftmax = subBuilder; - break; - } - case 234: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomAbsolutePadImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomAbsolutePadImage) { - subBuilder.MergeFrom(RandomAbsolutePadImage); - } - input.ReadMessage(subBuilder); - RandomAbsolutePadImage = subBuilder; - break; - } - case 242: { - global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RandomSelfConcatImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RandomSelfConcatImage) { - subBuilder.MergeFrom(RandomSelfConcatImage); - } - input.ReadMessage(subBuilder); - RandomSelfConcatImage = subBuilder; - break; - } - case 250: { - global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.AutoAugmentImage(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.AutoaugmentImage) { - subBuilder.MergeFrom(AutoaugmentImage); - } - input.ReadMessage(subBuilder); - AutoaugmentImage = subBuilder; - break; - } - case 258: { - global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.DropLabelProbabilistically(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.DropLabelProbabilistically) { - subBuilder.MergeFrom(DropLabelProbabilistically); - } - input.ReadMessage(subBuilder); - DropLabelProbabilistically = subBuilder; - break; - } - case 266: { - global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.RemapLabels(); - if (preprocessingStepCase_ == PreprocessingStepOneofCase.RemapLabels) { - subBuilder.MergeFrom(RemapLabels); - } - input.ReadMessage(subBuilder); - RemapLabels = subBuilder; - break; - } - } - } - } - - } - - /// - /// Normalizes pixel values in an image. - /// For every channel in the image, moves the pixel values from the range - /// [original_minval, original_maxval] to [target_minval, target_maxval]. - /// - public sealed partial class NormalizeImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NormalizeImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NormalizeImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NormalizeImage(NormalizeImage other) : this() { - originalMinval_ = other.originalMinval_; - originalMaxval_ = other.originalMaxval_; - targetMinval_ = other.targetMinval_; - targetMaxval_ = other.targetMaxval_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NormalizeImage Clone() { - return new NormalizeImage(this); - } - - /// Field number for the "original_minval" field. - public const int OriginalMinvalFieldNumber = 1; - private float originalMinval_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OriginalMinval { - get { return originalMinval_; } - set { - originalMinval_ = value; - } - } - - /// Field number for the "original_maxval" field. - public const int OriginalMaxvalFieldNumber = 2; - private float originalMaxval_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OriginalMaxval { - get { return originalMaxval_; } - set { - originalMaxval_ = value; - } - } - - /// Field number for the "target_minval" field. - public const int TargetMinvalFieldNumber = 3; - private float targetMinval_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float TargetMinval { - get { return targetMinval_; } - set { - targetMinval_ = value; - } - } - - /// Field number for the "target_maxval" field. - public const int TargetMaxvalFieldNumber = 4; - private float targetMaxval_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float TargetMaxval { - get { return targetMaxval_; } - set { - targetMaxval_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as NormalizeImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NormalizeImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OriginalMinval, other.OriginalMinval)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OriginalMaxval, other.OriginalMaxval)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TargetMinval, other.TargetMinval)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(TargetMaxval, other.TargetMaxval)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (OriginalMinval != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OriginalMinval); - if (OriginalMaxval != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OriginalMaxval); - if (TargetMinval != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TargetMinval); - if (TargetMaxval != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(TargetMaxval); - 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 (OriginalMinval != 0F) { - output.WriteRawTag(13); - output.WriteFloat(OriginalMinval); - } - if (OriginalMaxval != 0F) { - output.WriteRawTag(21); - output.WriteFloat(OriginalMaxval); - } - if (TargetMinval != 0F) { - output.WriteRawTag(29); - output.WriteFloat(TargetMinval); - } - if (TargetMaxval != 0F) { - output.WriteRawTag(37); - output.WriteFloat(TargetMaxval); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (OriginalMinval != 0F) { - size += 1 + 4; - } - if (OriginalMaxval != 0F) { - size += 1 + 4; - } - if (TargetMinval != 0F) { - size += 1 + 4; - } - if (TargetMaxval != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(NormalizeImage other) { - if (other == null) { - return; - } - if (other.OriginalMinval != 0F) { - OriginalMinval = other.OriginalMinval; - } - if (other.OriginalMaxval != 0F) { - OriginalMaxval = other.OriginalMaxval; - } - if (other.TargetMinval != 0F) { - TargetMinval = other.TargetMinval; - } - if (other.TargetMaxval != 0F) { - TargetMaxval = other.TargetMaxval; - } - _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: { - OriginalMinval = input.ReadFloat(); - break; - } - case 21: { - OriginalMaxval = input.ReadFloat(); - break; - } - case 29: { - TargetMinval = input.ReadFloat(); - break; - } - case 37: { - TargetMaxval = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly horizontally flips the image and detections 50% of the time. - /// - public sealed partial class RandomHorizontalFlip : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomHorizontalFlip()); - 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.PreprocessorReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomHorizontalFlip() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomHorizontalFlip(RandomHorizontalFlip other) : this() { - keypointFlipPermutation_ = other.keypointFlipPermutation_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomHorizontalFlip Clone() { - return new RandomHorizontalFlip(this); - } - - /// Field number for the "keypoint_flip_permutation" field. - public const int KeypointFlipPermutationFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_keypointFlipPermutation_codec - = pb::FieldCodec.ForInt32(10); - private readonly pbc::RepeatedField keypointFlipPermutation_ = new pbc::RepeatedField(); - /// - /// Specifies a mapping from the original keypoint indices to horizontally - /// flipped indices. This is used in the event that keypoints are specified, - /// in which case when the image is horizontally flipped the keypoints will - /// need to be permuted. E.g. for keypoints representing left_eye, right_eye, - /// nose_tip, mouth, left_ear, right_ear (in that order), one might specify - /// the keypoint_flip_permutation below: - /// keypoint_flip_permutation: 1 - /// keypoint_flip_permutation: 0 - /// keypoint_flip_permutation: 2 - /// keypoint_flip_permutation: 3 - /// keypoint_flip_permutation: 5 - /// keypoint_flip_permutation: 4 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField KeypointFlipPermutation { - get { return keypointFlipPermutation_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomHorizontalFlip); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomHorizontalFlip other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!keypointFlipPermutation_.Equals(other.keypointFlipPermutation_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= keypointFlipPermutation_.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) { - keypointFlipPermutation_.WriteTo(output, _repeated_keypointFlipPermutation_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += keypointFlipPermutation_.CalculateSize(_repeated_keypointFlipPermutation_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomHorizontalFlip other) { - if (other == null) { - return; - } - keypointFlipPermutation_.Add(other.keypointFlipPermutation_); - _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 8: { - keypointFlipPermutation_.AddEntriesFrom(input, _repeated_keypointFlipPermutation_codec); - break; - } - } - } - } - - } - - /// - /// Randomly vertically flips the image and detections 50% of the time. - /// - public sealed partial class RandomVerticalFlip : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomVerticalFlip()); - 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.PreprocessorReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomVerticalFlip() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomVerticalFlip(RandomVerticalFlip other) : this() { - keypointFlipPermutation_ = other.keypointFlipPermutation_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomVerticalFlip Clone() { - return new RandomVerticalFlip(this); - } - - /// Field number for the "keypoint_flip_permutation" field. - public const int KeypointFlipPermutationFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_keypointFlipPermutation_codec - = pb::FieldCodec.ForInt32(10); - private readonly pbc::RepeatedField keypointFlipPermutation_ = new pbc::RepeatedField(); - /// - /// Specifies a mapping from the original keypoint indices to vertically - /// flipped indices. This is used in the event that keypoints are specified, - /// in which case when the image is vertically flipped the keypoints will - /// need to be permuted. E.g. for keypoints representing left_eye, right_eye, - /// nose_tip, mouth, left_ear, right_ear (in that order), one might specify - /// the keypoint_flip_permutation below: - /// keypoint_flip_permutation: 1 - /// keypoint_flip_permutation: 0 - /// keypoint_flip_permutation: 2 - /// keypoint_flip_permutation: 3 - /// keypoint_flip_permutation: 5 - /// keypoint_flip_permutation: 4 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField KeypointFlipPermutation { - get { return keypointFlipPermutation_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomVerticalFlip); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomVerticalFlip other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!keypointFlipPermutation_.Equals(other.keypointFlipPermutation_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= keypointFlipPermutation_.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) { - keypointFlipPermutation_.WriteTo(output, _repeated_keypointFlipPermutation_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += keypointFlipPermutation_.CalculateSize(_repeated_keypointFlipPermutation_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomVerticalFlip other) { - if (other == null) { - return; - } - keypointFlipPermutation_.Add(other.keypointFlipPermutation_); - _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 8: { - keypointFlipPermutation_.AddEntriesFrom(input, _repeated_keypointFlipPermutation_codec); - break; - } - } - } - } - - } - - /// - /// Randomly rotates the image and detections by 90 degrees counter-clockwise - /// 50% of the time. - /// - public sealed partial class RandomRotation90 : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomRotation90()); - 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.PreprocessorReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomRotation90() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomRotation90(RandomRotation90 other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomRotation90 Clone() { - return new RandomRotation90(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomRotation90); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomRotation90 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(RandomRotation90 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; - } - } - } - - } - - /// - /// Randomly scales the values of all pixels in the image by some constant value - /// between [minval, maxval], then clip the value to a range between [0, 1.0]. - /// - public sealed partial class RandomPixelValueScale : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomPixelValueScale()); - 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.PreprocessorReflection.Descriptor.MessageTypes[5]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomPixelValueScale() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomPixelValueScale(RandomPixelValueScale other) : this() { - minval_ = other.minval_; - maxval_ = other.maxval_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomPixelValueScale Clone() { - return new RandomPixelValueScale(this); - } - - /// Field number for the "minval" field. - public const int MinvalFieldNumber = 1; - private float minval_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Minval { - get { return minval_; } - set { - minval_ = value; - } - } - - /// Field number for the "maxval" field. - public const int MaxvalFieldNumber = 2; - private float maxval_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Maxval { - get { return maxval_; } - set { - maxval_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomPixelValueScale); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomPixelValueScale other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Minval, other.Minval)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Maxval, other.Maxval)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Minval != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Minval); - if (Maxval != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Maxval); - 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 (Minval != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Minval); - } - if (Maxval != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Maxval); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Minval != 0F) { - size += 1 + 4; - } - if (Maxval != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomPixelValueScale other) { - if (other == null) { - return; - } - if (other.Minval != 0F) { - Minval = other.Minval; - } - if (other.Maxval != 0F) { - Maxval = other.Maxval; - } - _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: { - Minval = input.ReadFloat(); - break; - } - case 21: { - Maxval = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly enlarges or shrinks image (keeping aspect ratio). - /// - public sealed partial class RandomImageScale : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomImageScale()); - 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.PreprocessorReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomImageScale() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomImageScale(RandomImageScale other) : this() { - minScaleRatio_ = other.minScaleRatio_; - maxScaleRatio_ = other.maxScaleRatio_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomImageScale Clone() { - return new RandomImageScale(this); - } - - /// Field number for the "min_scale_ratio" field. - public const int MinScaleRatioFieldNumber = 1; - private float minScaleRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinScaleRatio { - get { return minScaleRatio_; } - set { - minScaleRatio_ = value; - } - } - - /// Field number for the "max_scale_ratio" field. - public const int MaxScaleRatioFieldNumber = 2; - private float maxScaleRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxScaleRatio { - get { return maxScaleRatio_; } - set { - maxScaleRatio_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomImageScale); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomImageScale other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScaleRatio, other.MinScaleRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxScaleRatio, other.MaxScaleRatio)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinScaleRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScaleRatio); - if (MaxScaleRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxScaleRatio); - 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 (MinScaleRatio != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinScaleRatio); - } - if (MaxScaleRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MaxScaleRatio); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinScaleRatio != 0F) { - size += 1 + 4; - } - if (MaxScaleRatio != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomImageScale other) { - if (other == null) { - return; - } - if (other.MinScaleRatio != 0F) { - MinScaleRatio = other.MinScaleRatio; - } - if (other.MaxScaleRatio != 0F) { - MaxScaleRatio = other.MaxScaleRatio; - } - _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: { - MinScaleRatio = input.ReadFloat(); - break; - } - case 21: { - MaxScaleRatio = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly convert entire image to grey scale. - /// - public sealed partial class RandomRGBtoGray : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomRGBtoGray()); - 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.PreprocessorReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomRGBtoGray() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomRGBtoGray(RandomRGBtoGray other) : this() { - probability_ = other.probability_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomRGBtoGray Clone() { - return new RandomRGBtoGray(this); - } - - /// Field number for the "probability" field. - public const int ProbabilityFieldNumber = 1; - private float probability_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Probability { - get { return probability_; } - set { - probability_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomRGBtoGray); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomRGBtoGray other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Probability, other.Probability)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Probability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Probability); - 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 (Probability != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Probability); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Probability != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomRGBtoGray other) { - if (other == null) { - return; - } - if (other.Probability != 0F) { - Probability = other.Probability; - } - _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: { - Probability = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly changes image brightness by up to max_delta. Image outputs will be - /// saturated between 0 and 1. - /// - public sealed partial class RandomAdjustBrightness : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomAdjustBrightness()); - 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.PreprocessorReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustBrightness() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustBrightness(RandomAdjustBrightness other) : this() { - maxDelta_ = other.maxDelta_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustBrightness Clone() { - return new RandomAdjustBrightness(this); - } - - /// Field number for the "max_delta" field. - public const int MaxDeltaFieldNumber = 1; - private float maxDelta_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxDelta { - get { return maxDelta_; } - set { - maxDelta_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomAdjustBrightness); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomAdjustBrightness other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxDelta, other.MaxDelta)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MaxDelta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxDelta); - 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 (MaxDelta != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MaxDelta); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MaxDelta != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomAdjustBrightness other) { - if (other == null) { - return; - } - if (other.MaxDelta != 0F) { - MaxDelta = other.MaxDelta; - } - _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: { - MaxDelta = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly scales contract by a value between [min_delta, max_delta]. - /// - public sealed partial class RandomAdjustContrast : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomAdjustContrast()); - 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.PreprocessorReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustContrast() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustContrast(RandomAdjustContrast other) : this() { - minDelta_ = other.minDelta_; - maxDelta_ = other.maxDelta_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustContrast Clone() { - return new RandomAdjustContrast(this); - } - - /// Field number for the "min_delta" field. - public const int MinDeltaFieldNumber = 1; - private float minDelta_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinDelta { - get { return minDelta_; } - set { - minDelta_ = value; - } - } - - /// Field number for the "max_delta" field. - public const int MaxDeltaFieldNumber = 2; - private float maxDelta_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxDelta { - get { return maxDelta_; } - set { - maxDelta_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomAdjustContrast); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomAdjustContrast other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinDelta, other.MinDelta)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxDelta, other.MaxDelta)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinDelta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinDelta); - if (MaxDelta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxDelta); - 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 (MinDelta != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinDelta); - } - if (MaxDelta != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MaxDelta); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinDelta != 0F) { - size += 1 + 4; - } - if (MaxDelta != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomAdjustContrast other) { - if (other == null) { - return; - } - if (other.MinDelta != 0F) { - MinDelta = other.MinDelta; - } - if (other.MaxDelta != 0F) { - MaxDelta = other.MaxDelta; - } - _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: { - MinDelta = input.ReadFloat(); - break; - } - case 21: { - MaxDelta = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly alters hue by a value of up to max_delta. - /// - public sealed partial class RandomAdjustHue : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomAdjustHue()); - 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.PreprocessorReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustHue() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustHue(RandomAdjustHue other) : this() { - maxDelta_ = other.maxDelta_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustHue Clone() { - return new RandomAdjustHue(this); - } - - /// Field number for the "max_delta" field. - public const int MaxDeltaFieldNumber = 1; - private float maxDelta_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxDelta { - get { return maxDelta_; } - set { - maxDelta_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomAdjustHue); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomAdjustHue other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxDelta, other.MaxDelta)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MaxDelta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxDelta); - 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 (MaxDelta != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MaxDelta); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MaxDelta != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomAdjustHue other) { - if (other == null) { - return; - } - if (other.MaxDelta != 0F) { - MaxDelta = other.MaxDelta; - } - _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: { - MaxDelta = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly changes saturation by a value between [min_delta, max_delta]. - /// - public sealed partial class RandomAdjustSaturation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomAdjustSaturation()); - 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.PreprocessorReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustSaturation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustSaturation(RandomAdjustSaturation other) : this() { - minDelta_ = other.minDelta_; - maxDelta_ = other.maxDelta_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAdjustSaturation Clone() { - return new RandomAdjustSaturation(this); - } - - /// Field number for the "min_delta" field. - public const int MinDeltaFieldNumber = 1; - private float minDelta_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinDelta { - get { return minDelta_; } - set { - minDelta_ = value; - } - } - - /// Field number for the "max_delta" field. - public const int MaxDeltaFieldNumber = 2; - private float maxDelta_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxDelta { - get { return maxDelta_; } - set { - maxDelta_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomAdjustSaturation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomAdjustSaturation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinDelta, other.MinDelta)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxDelta, other.MaxDelta)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinDelta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinDelta); - if (MaxDelta != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxDelta); - 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 (MinDelta != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinDelta); - } - if (MaxDelta != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MaxDelta); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinDelta != 0F) { - size += 1 + 4; - } - if (MaxDelta != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomAdjustSaturation other) { - if (other == null) { - return; - } - if (other.MinDelta != 0F) { - MinDelta = other.MinDelta; - } - if (other.MaxDelta != 0F) { - MaxDelta = other.MaxDelta; - } - _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: { - MinDelta = input.ReadFloat(); - break; - } - case 21: { - MaxDelta = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Performs a random color distortion. color_orderings should either be 0 or 1. - /// - public sealed partial class RandomDistortColor : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomDistortColor()); - 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.PreprocessorReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomDistortColor() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomDistortColor(RandomDistortColor other) : this() { - colorOrdering_ = other.colorOrdering_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomDistortColor Clone() { - return new RandomDistortColor(this); - } - - /// Field number for the "color_ordering" field. - public const int ColorOrderingFieldNumber = 1; - private int colorOrdering_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int ColorOrdering { - get { return colorOrdering_; } - set { - colorOrdering_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomDistortColor); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomDistortColor other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (ColorOrdering != other.ColorOrdering) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (ColorOrdering != 0) hash ^= ColorOrdering.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 (ColorOrdering != 0) { - output.WriteRawTag(8); - output.WriteInt32(ColorOrdering); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (ColorOrdering != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(ColorOrdering); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomDistortColor other) { - if (other == null) { - return; - } - if (other.ColorOrdering != 0) { - ColorOrdering = other.ColorOrdering; - } - _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: { - ColorOrdering = input.ReadInt32(); - break; - } - } - } - } - - } - - /// - /// Randomly jitters corners of boxes in the image determined by ratio. - /// ie. If a box is [100, 200] and ratio is 0.02, the corners can move by [1, 4]. - /// - public sealed partial class RandomJitterBoxes : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomJitterBoxes()); - 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.PreprocessorReflection.Descriptor.MessageTypes[13]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomJitterBoxes() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomJitterBoxes(RandomJitterBoxes other) : this() { - ratio_ = other.ratio_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomJitterBoxes Clone() { - return new RandomJitterBoxes(this); - } - - /// Field number for the "ratio" field. - public const int RatioFieldNumber = 1; - private float ratio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Ratio { - get { return ratio_; } - set { - ratio_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomJitterBoxes); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomJitterBoxes other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Ratio, other.Ratio)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Ratio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Ratio); - 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 (Ratio != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Ratio); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Ratio != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomJitterBoxes other) { - if (other == null) { - return; - } - if (other.Ratio != 0F) { - Ratio = other.Ratio; - } - _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: { - Ratio = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly crops the image and bounding boxes. - /// - public sealed partial class RandomCropImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomCropImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[14]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropImage(RandomCropImage other) : this() { - minObjectCovered_ = other.minObjectCovered_; - minAspectRatio_ = other.minAspectRatio_; - maxAspectRatio_ = other.maxAspectRatio_; - minArea_ = other.minArea_; - maxArea_ = other.maxArea_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - randomCoef_ = other.randomCoef_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropImage Clone() { - return new RandomCropImage(this); - } - - /// Field number for the "min_object_covered" field. - public const int MinObjectCoveredFieldNumber = 1; - private float minObjectCovered_; - /// - /// Cropped image must cover at least one box by this fraction. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinObjectCovered { - get { return minObjectCovered_; } - set { - minObjectCovered_ = value; - } - } - - /// Field number for the "min_aspect_ratio" field. - public const int MinAspectRatioFieldNumber = 2; - private float minAspectRatio_; - /// - /// Aspect ratio bounds of cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinAspectRatio { - get { return minAspectRatio_; } - set { - minAspectRatio_ = value; - } - } - - /// Field number for the "max_aspect_ratio" field. - public const int MaxAspectRatioFieldNumber = 3; - private float maxAspectRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxAspectRatio { - get { return maxAspectRatio_; } - set { - maxAspectRatio_ = value; - } - } - - /// Field number for the "min_area" field. - public const int MinAreaFieldNumber = 4; - private float minArea_; - /// - /// Allowed area ratio of cropped image to original image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinArea { - get { return minArea_; } - set { - minArea_ = value; - } - } - - /// Field number for the "max_area" field. - public const int MaxAreaFieldNumber = 5; - private float maxArea_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxArea { - get { return maxArea_; } - set { - maxArea_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 6; - private float overlapThresh_; - /// - /// Minimum overlap threshold of cropped boxes to keep in new image. If the - /// ratio between a cropped bounding box and the original is less than this - /// value, it is removed from the new image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 8; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - /// Field number for the "random_coef" field. - public const int RandomCoefFieldNumber = 7; - private float randomCoef_; - /// - /// Probability of keeping the original image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float RandomCoef { - get { return randomCoef_; } - set { - randomCoef_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomCropImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomCropImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinObjectCovered, other.MinObjectCovered)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAspectRatio, other.MinAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxAspectRatio, other.MaxAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinArea, other.MinArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxArea, other.MaxArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RandomCoef, other.RandomCoef)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinObjectCovered != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinObjectCovered); - if (MinAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAspectRatio); - if (MaxAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxAspectRatio); - if (MinArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinArea); - if (MaxArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxArea); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.GetHashCode(); - if (RandomCoef != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RandomCoef); - 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 (MinObjectCovered != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinObjectCovered); - } - if (MinAspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MinAspectRatio); - } - if (MaxAspectRatio != 0F) { - output.WriteRawTag(29); - output.WriteFloat(MaxAspectRatio); - } - if (MinArea != 0F) { - output.WriteRawTag(37); - output.WriteFloat(MinArea); - } - if (MaxArea != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MaxArea); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(53); - output.WriteFloat(OverlapThresh); - } - if (RandomCoef != 0F) { - output.WriteRawTag(61); - output.WriteFloat(RandomCoef); - } - if (ClipBoxes != false) { - output.WriteRawTag(64); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinObjectCovered != 0F) { - size += 1 + 4; - } - if (MinAspectRatio != 0F) { - size += 1 + 4; - } - if (MaxAspectRatio != 0F) { - size += 1 + 4; - } - if (MinArea != 0F) { - size += 1 + 4; - } - if (MaxArea != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (RandomCoef != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomCropImage other) { - if (other == null) { - return; - } - if (other.MinObjectCovered != 0F) { - MinObjectCovered = other.MinObjectCovered; - } - if (other.MinAspectRatio != 0F) { - MinAspectRatio = other.MinAspectRatio; - } - if (other.MaxAspectRatio != 0F) { - MaxAspectRatio = other.MaxAspectRatio; - } - if (other.MinArea != 0F) { - MinArea = other.MinArea; - } - if (other.MaxArea != 0F) { - MaxArea = other.MaxArea; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - if (other.RandomCoef != 0F) { - RandomCoef = other.RandomCoef; - } - _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: { - MinObjectCovered = input.ReadFloat(); - break; - } - case 21: { - MinAspectRatio = input.ReadFloat(); - break; - } - case 29: { - MaxAspectRatio = input.ReadFloat(); - break; - } - case 37: { - MinArea = input.ReadFloat(); - break; - } - case 45: { - MaxArea = input.ReadFloat(); - break; - } - case 53: { - OverlapThresh = input.ReadFloat(); - break; - } - case 61: { - RandomCoef = input.ReadFloat(); - break; - } - case 64: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly adds padding to the image. - /// - public sealed partial class RandomPadImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomPadImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[15]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomPadImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomPadImage(RandomPadImage other) : this() { - minImageHeight_ = other.minImageHeight_; - minImageWidth_ = other.minImageWidth_; - maxImageHeight_ = other.maxImageHeight_; - maxImageWidth_ = other.maxImageWidth_; - padColor_ = other.padColor_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomPadImage Clone() { - return new RandomPadImage(this); - } - - /// Field number for the "min_image_height" field. - public const int MinImageHeightFieldNumber = 1; - private int minImageHeight_; - /// - /// Minimum dimensions for padded image. If unset, will use original image - /// dimension as a lower bound. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinImageHeight { - get { return minImageHeight_; } - set { - minImageHeight_ = value; - } - } - - /// Field number for the "min_image_width" field. - public const int MinImageWidthFieldNumber = 2; - private int minImageWidth_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinImageWidth { - get { return minImageWidth_; } - set { - minImageWidth_ = value; - } - } - - /// Field number for the "max_image_height" field. - public const int MaxImageHeightFieldNumber = 3; - private int maxImageHeight_; - /// - /// Maximum dimensions for padded image. If unset, will use double the original - /// image dimension as a lower bound. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxImageHeight { - get { return maxImageHeight_; } - set { - maxImageHeight_ = value; - } - } - - /// Field number for the "max_image_width" field. - public const int MaxImageWidthFieldNumber = 4; - private int maxImageWidth_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxImageWidth { - get { return maxImageWidth_; } - set { - maxImageWidth_ = value; - } - } - - /// Field number for the "pad_color" field. - public const int PadColorFieldNumber = 5; - private static readonly pb::FieldCodec _repeated_padColor_codec - = pb::FieldCodec.ForFloat(42); - private readonly pbc::RepeatedField padColor_ = new pbc::RepeatedField(); - /// - /// Color of the padding. If unset, will pad using average color of the input - /// image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField PadColor { - get { return padColor_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomPadImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomPadImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MinImageHeight != other.MinImageHeight) return false; - if (MinImageWidth != other.MinImageWidth) return false; - if (MaxImageHeight != other.MaxImageHeight) return false; - if (MaxImageWidth != other.MaxImageWidth) return false; - if(!padColor_.Equals(other.padColor_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinImageHeight != 0) hash ^= MinImageHeight.GetHashCode(); - if (MinImageWidth != 0) hash ^= MinImageWidth.GetHashCode(); - if (MaxImageHeight != 0) hash ^= MaxImageHeight.GetHashCode(); - if (MaxImageWidth != 0) hash ^= MaxImageWidth.GetHashCode(); - hash ^= padColor_.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 (MinImageHeight != 0) { - output.WriteRawTag(8); - output.WriteInt32(MinImageHeight); - } - if (MinImageWidth != 0) { - output.WriteRawTag(16); - output.WriteInt32(MinImageWidth); - } - if (MaxImageHeight != 0) { - output.WriteRawTag(24); - output.WriteInt32(MaxImageHeight); - } - if (MaxImageWidth != 0) { - output.WriteRawTag(32); - output.WriteInt32(MaxImageWidth); - } - padColor_.WriteTo(output, _repeated_padColor_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinImageHeight != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinImageHeight); - } - if (MinImageWidth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinImageWidth); - } - if (MaxImageHeight != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxImageHeight); - } - if (MaxImageWidth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxImageWidth); - } - size += padColor_.CalculateSize(_repeated_padColor_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomPadImage other) { - if (other == null) { - return; - } - if (other.MinImageHeight != 0) { - MinImageHeight = other.MinImageHeight; - } - if (other.MinImageWidth != 0) { - MinImageWidth = other.MinImageWidth; - } - if (other.MaxImageHeight != 0) { - MaxImageHeight = other.MaxImageHeight; - } - if (other.MaxImageWidth != 0) { - MaxImageWidth = other.MaxImageWidth; - } - padColor_.Add(other.padColor_); - _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: { - MinImageHeight = input.ReadInt32(); - break; - } - case 16: { - MinImageWidth = input.ReadInt32(); - break; - } - case 24: { - MaxImageHeight = input.ReadInt32(); - break; - } - case 32: { - MaxImageWidth = input.ReadInt32(); - break; - } - case 42: - case 45: { - padColor_.AddEntriesFrom(input, _repeated_padColor_codec); - break; - } - } - } - } - - } - - /// - /// Randomly adds a padding of size [0, max_height_padding), [0, max_width_padding). - /// - public sealed partial class RandomAbsolutePadImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomAbsolutePadImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[16]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAbsolutePadImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAbsolutePadImage(RandomAbsolutePadImage other) : this() { - maxHeightPadding_ = other.maxHeightPadding_; - maxWidthPadding_ = other.maxWidthPadding_; - padColor_ = other.padColor_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomAbsolutePadImage Clone() { - return new RandomAbsolutePadImage(this); - } - - /// Field number for the "max_height_padding" field. - public const int MaxHeightPaddingFieldNumber = 1; - private int maxHeightPadding_; - /// - /// Height will be padded uniformly at random from [0, max_height_padding). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxHeightPadding { - get { return maxHeightPadding_; } - set { - maxHeightPadding_ = value; - } - } - - /// Field number for the "max_width_padding" field. - public const int MaxWidthPaddingFieldNumber = 2; - private int maxWidthPadding_; - /// - /// Width will be padded uniformly at random from [0, max_width_padding). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxWidthPadding { - get { return maxWidthPadding_; } - set { - maxWidthPadding_ = value; - } - } - - /// Field number for the "pad_color" field. - public const int PadColorFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_padColor_codec - = pb::FieldCodec.ForFloat(26); - private readonly pbc::RepeatedField padColor_ = new pbc::RepeatedField(); - /// - /// Color of the padding. If unset, will pad using average color of the input - /// image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField PadColor { - get { return padColor_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomAbsolutePadImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomAbsolutePadImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MaxHeightPadding != other.MaxHeightPadding) return false; - if (MaxWidthPadding != other.MaxWidthPadding) return false; - if(!padColor_.Equals(other.padColor_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MaxHeightPadding != 0) hash ^= MaxHeightPadding.GetHashCode(); - if (MaxWidthPadding != 0) hash ^= MaxWidthPadding.GetHashCode(); - hash ^= padColor_.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 (MaxHeightPadding != 0) { - output.WriteRawTag(8); - output.WriteInt32(MaxHeightPadding); - } - if (MaxWidthPadding != 0) { - output.WriteRawTag(16); - output.WriteInt32(MaxWidthPadding); - } - padColor_.WriteTo(output, _repeated_padColor_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MaxHeightPadding != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxHeightPadding); - } - if (MaxWidthPadding != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxWidthPadding); - } - size += padColor_.CalculateSize(_repeated_padColor_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomAbsolutePadImage other) { - if (other == null) { - return; - } - if (other.MaxHeightPadding != 0) { - MaxHeightPadding = other.MaxHeightPadding; - } - if (other.MaxWidthPadding != 0) { - MaxWidthPadding = other.MaxWidthPadding; - } - padColor_.Add(other.padColor_); - _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: { - MaxHeightPadding = input.ReadInt32(); - break; - } - case 16: { - MaxWidthPadding = input.ReadInt32(); - break; - } - case 26: - case 29: { - padColor_.AddEntriesFrom(input, _repeated_padColor_codec); - break; - } - } - } - } - - } - - /// - /// Randomly crops an image followed by a random pad. - /// - public sealed partial class RandomCropPadImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomCropPadImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[17]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropPadImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropPadImage(RandomCropPadImage other) : this() { - minObjectCovered_ = other.minObjectCovered_; - minAspectRatio_ = other.minAspectRatio_; - maxAspectRatio_ = other.maxAspectRatio_; - minArea_ = other.minArea_; - maxArea_ = other.maxArea_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - randomCoef_ = other.randomCoef_; - minPaddedSizeRatio_ = other.minPaddedSizeRatio_.Clone(); - maxPaddedSizeRatio_ = other.maxPaddedSizeRatio_.Clone(); - padColor_ = other.padColor_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropPadImage Clone() { - return new RandomCropPadImage(this); - } - - /// Field number for the "min_object_covered" field. - public const int MinObjectCoveredFieldNumber = 1; - private float minObjectCovered_; - /// - /// Cropping operation must cover at least one box by this fraction. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinObjectCovered { - get { return minObjectCovered_; } - set { - minObjectCovered_ = value; - } - } - - /// Field number for the "min_aspect_ratio" field. - public const int MinAspectRatioFieldNumber = 2; - private float minAspectRatio_; - /// - /// Aspect ratio bounds of image after cropping operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinAspectRatio { - get { return minAspectRatio_; } - set { - minAspectRatio_ = value; - } - } - - /// Field number for the "max_aspect_ratio" field. - public const int MaxAspectRatioFieldNumber = 3; - private float maxAspectRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxAspectRatio { - get { return maxAspectRatio_; } - set { - maxAspectRatio_ = value; - } - } - - /// Field number for the "min_area" field. - public const int MinAreaFieldNumber = 4; - private float minArea_; - /// - /// Allowed area ratio of image after cropping operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinArea { - get { return minArea_; } - set { - minArea_ = value; - } - } - - /// Field number for the "max_area" field. - public const int MaxAreaFieldNumber = 5; - private float maxArea_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxArea { - get { return maxArea_; } - set { - maxArea_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 6; - private float overlapThresh_; - /// - /// Minimum overlap threshold of cropped boxes to keep in new image. If the - /// ratio between a cropped bounding box and the original is less than this - /// value, it is removed from the new image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 11; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - /// Field number for the "random_coef" field. - public const int RandomCoefFieldNumber = 7; - private float randomCoef_; - /// - /// Probability of keeping the original image during the crop operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float RandomCoef { - get { return randomCoef_; } - set { - randomCoef_ = value; - } - } - - /// Field number for the "min_padded_size_ratio" field. - public const int MinPaddedSizeRatioFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_minPaddedSizeRatio_codec - = pb::FieldCodec.ForFloat(66); - private readonly pbc::RepeatedField minPaddedSizeRatio_ = new pbc::RepeatedField(); - /// - /// Maximum dimensions for padded image. If unset, will use double the original - /// image dimension as a lower bound. Both of the following fields should be - /// length 2. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField MinPaddedSizeRatio { - get { return minPaddedSizeRatio_; } - } - - /// Field number for the "max_padded_size_ratio" field. - public const int MaxPaddedSizeRatioFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_maxPaddedSizeRatio_codec - = pb::FieldCodec.ForFloat(74); - private readonly pbc::RepeatedField maxPaddedSizeRatio_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField MaxPaddedSizeRatio { - get { return maxPaddedSizeRatio_; } - } - - /// Field number for the "pad_color" field. - public const int PadColorFieldNumber = 10; - private static readonly pb::FieldCodec _repeated_padColor_codec - = pb::FieldCodec.ForFloat(82); - private readonly pbc::RepeatedField padColor_ = new pbc::RepeatedField(); - /// - /// Color of the padding. If unset, will pad using average color of the input - /// image. This field should be of length 3. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField PadColor { - get { return padColor_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomCropPadImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomCropPadImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinObjectCovered, other.MinObjectCovered)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAspectRatio, other.MinAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxAspectRatio, other.MaxAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinArea, other.MinArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxArea, other.MaxArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RandomCoef, other.RandomCoef)) return false; - if(!minPaddedSizeRatio_.Equals(other.minPaddedSizeRatio_)) return false; - if(!maxPaddedSizeRatio_.Equals(other.maxPaddedSizeRatio_)) return false; - if(!padColor_.Equals(other.padColor_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinObjectCovered != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinObjectCovered); - if (MinAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAspectRatio); - if (MaxAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxAspectRatio); - if (MinArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinArea); - if (MaxArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxArea); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.GetHashCode(); - if (RandomCoef != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RandomCoef); - hash ^= minPaddedSizeRatio_.GetHashCode(); - hash ^= maxPaddedSizeRatio_.GetHashCode(); - hash ^= padColor_.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 (MinObjectCovered != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinObjectCovered); - } - if (MinAspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MinAspectRatio); - } - if (MaxAspectRatio != 0F) { - output.WriteRawTag(29); - output.WriteFloat(MaxAspectRatio); - } - if (MinArea != 0F) { - output.WriteRawTag(37); - output.WriteFloat(MinArea); - } - if (MaxArea != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MaxArea); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(53); - output.WriteFloat(OverlapThresh); - } - if (RandomCoef != 0F) { - output.WriteRawTag(61); - output.WriteFloat(RandomCoef); - } - minPaddedSizeRatio_.WriteTo(output, _repeated_minPaddedSizeRatio_codec); - maxPaddedSizeRatio_.WriteTo(output, _repeated_maxPaddedSizeRatio_codec); - padColor_.WriteTo(output, _repeated_padColor_codec); - if (ClipBoxes != false) { - output.WriteRawTag(88); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinObjectCovered != 0F) { - size += 1 + 4; - } - if (MinAspectRatio != 0F) { - size += 1 + 4; - } - if (MaxAspectRatio != 0F) { - size += 1 + 4; - } - if (MinArea != 0F) { - size += 1 + 4; - } - if (MaxArea != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (RandomCoef != 0F) { - size += 1 + 4; - } - size += minPaddedSizeRatio_.CalculateSize(_repeated_minPaddedSizeRatio_codec); - size += maxPaddedSizeRatio_.CalculateSize(_repeated_maxPaddedSizeRatio_codec); - size += padColor_.CalculateSize(_repeated_padColor_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomCropPadImage other) { - if (other == null) { - return; - } - if (other.MinObjectCovered != 0F) { - MinObjectCovered = other.MinObjectCovered; - } - if (other.MinAspectRatio != 0F) { - MinAspectRatio = other.MinAspectRatio; - } - if (other.MaxAspectRatio != 0F) { - MaxAspectRatio = other.MaxAspectRatio; - } - if (other.MinArea != 0F) { - MinArea = other.MinArea; - } - if (other.MaxArea != 0F) { - MaxArea = other.MaxArea; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - if (other.RandomCoef != 0F) { - RandomCoef = other.RandomCoef; - } - minPaddedSizeRatio_.Add(other.minPaddedSizeRatio_); - maxPaddedSizeRatio_.Add(other.maxPaddedSizeRatio_); - padColor_.Add(other.padColor_); - _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: { - MinObjectCovered = input.ReadFloat(); - break; - } - case 21: { - MinAspectRatio = input.ReadFloat(); - break; - } - case 29: { - MaxAspectRatio = input.ReadFloat(); - break; - } - case 37: { - MinArea = input.ReadFloat(); - break; - } - case 45: { - MaxArea = input.ReadFloat(); - break; - } - case 53: { - OverlapThresh = input.ReadFloat(); - break; - } - case 61: { - RandomCoef = input.ReadFloat(); - break; - } - case 66: - case 69: { - minPaddedSizeRatio_.AddEntriesFrom(input, _repeated_minPaddedSizeRatio_codec); - break; - } - case 74: - case 77: { - maxPaddedSizeRatio_.AddEntriesFrom(input, _repeated_maxPaddedSizeRatio_codec); - break; - } - case 82: - case 85: { - padColor_.AddEntriesFrom(input, _repeated_padColor_codec); - break; - } - case 88: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly crops an iamge to a given aspect ratio. - /// - public sealed partial class RandomCropToAspectRatio : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomCropToAspectRatio()); - 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.PreprocessorReflection.Descriptor.MessageTypes[18]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropToAspectRatio() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropToAspectRatio(RandomCropToAspectRatio other) : this() { - aspectRatio_ = other.aspectRatio_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomCropToAspectRatio Clone() { - return new RandomCropToAspectRatio(this); - } - - /// Field number for the "aspect_ratio" field. - public const int AspectRatioFieldNumber = 1; - private float aspectRatio_; - /// - /// Aspect ratio. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float AspectRatio { - get { return aspectRatio_; } - set { - aspectRatio_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 2; - private float overlapThresh_; - /// - /// Minimum overlap threshold of cropped boxes to keep in new image. If the - /// ratio between a cropped bounding box and the original is less than this - /// value, it is removed from the new image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 3; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomCropToAspectRatio); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomCropToAspectRatio other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AspectRatio, other.AspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (AspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AspectRatio); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.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 (AspectRatio != 0F) { - output.WriteRawTag(13); - output.WriteFloat(AspectRatio); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(21); - output.WriteFloat(OverlapThresh); - } - if (ClipBoxes != false) { - output.WriteRawTag(24); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (AspectRatio != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomCropToAspectRatio other) { - if (other == null) { - return; - } - if (other.AspectRatio != 0F) { - AspectRatio = other.AspectRatio; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - _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: { - AspectRatio = input.ReadFloat(); - break; - } - case 21: { - OverlapThresh = input.ReadFloat(); - break; - } - case 24: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly adds black square patches to an image. - /// - public sealed partial class RandomBlackPatches : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomBlackPatches()); - 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.PreprocessorReflection.Descriptor.MessageTypes[19]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomBlackPatches() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomBlackPatches(RandomBlackPatches other) : this() { - maxBlackPatches_ = other.maxBlackPatches_; - probability_ = other.probability_; - sizeToImageRatio_ = other.sizeToImageRatio_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomBlackPatches Clone() { - return new RandomBlackPatches(this); - } - - /// Field number for the "max_black_patches" field. - public const int MaxBlackPatchesFieldNumber = 1; - private int maxBlackPatches_; - /// - /// The maximum number of black patches to add. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxBlackPatches { - get { return maxBlackPatches_; } - set { - maxBlackPatches_ = value; - } - } - - /// Field number for the "probability" field. - public const int ProbabilityFieldNumber = 2; - private float probability_; - /// - /// The probability of a black patch being added to an image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Probability { - get { return probability_; } - set { - probability_ = value; - } - } - - /// Field number for the "size_to_image_ratio" field. - public const int SizeToImageRatioFieldNumber = 3; - private float sizeToImageRatio_; - /// - /// Ratio between the dimension of the black patch to the minimum dimension of - /// the image (patch_width = patch_height = min(image_height, image_width)). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float SizeToImageRatio { - get { return sizeToImageRatio_; } - set { - sizeToImageRatio_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomBlackPatches); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomBlackPatches other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MaxBlackPatches != other.MaxBlackPatches) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Probability, other.Probability)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(SizeToImageRatio, other.SizeToImageRatio)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MaxBlackPatches != 0) hash ^= MaxBlackPatches.GetHashCode(); - if (Probability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Probability); - if (SizeToImageRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(SizeToImageRatio); - 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 (MaxBlackPatches != 0) { - output.WriteRawTag(8); - output.WriteInt32(MaxBlackPatches); - } - if (Probability != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Probability); - } - if (SizeToImageRatio != 0F) { - output.WriteRawTag(29); - output.WriteFloat(SizeToImageRatio); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MaxBlackPatches != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxBlackPatches); - } - if (Probability != 0F) { - size += 1 + 4; - } - if (SizeToImageRatio != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomBlackPatches other) { - if (other == null) { - return; - } - if (other.MaxBlackPatches != 0) { - MaxBlackPatches = other.MaxBlackPatches; - } - if (other.Probability != 0F) { - Probability = other.Probability; - } - if (other.SizeToImageRatio != 0F) { - SizeToImageRatio = other.SizeToImageRatio; - } - _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: { - MaxBlackPatches = input.ReadInt32(); - break; - } - case 21: { - Probability = input.ReadFloat(); - break; - } - case 29: { - SizeToImageRatio = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly resizes the image up to [target_height, target_width]. - /// - public sealed partial class RandomResizeMethod : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomResizeMethod()); - 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.PreprocessorReflection.Descriptor.MessageTypes[20]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomResizeMethod() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomResizeMethod(RandomResizeMethod other) : this() { - targetHeight_ = other.targetHeight_; - targetWidth_ = other.targetWidth_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomResizeMethod Clone() { - return new RandomResizeMethod(this); - } - - /// Field number for the "target_height" field. - public const int TargetHeightFieldNumber = 1; - private int targetHeight_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int TargetHeight { - get { return targetHeight_; } - set { - targetHeight_ = value; - } - } - - /// Field number for the "target_width" field. - public const int TargetWidthFieldNumber = 2; - private int targetWidth_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int TargetWidth { - get { return targetWidth_; } - set { - targetWidth_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomResizeMethod); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomResizeMethod other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TargetHeight != other.TargetHeight) return false; - if (TargetWidth != other.TargetWidth) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TargetHeight != 0) hash ^= TargetHeight.GetHashCode(); - if (TargetWidth != 0) hash ^= TargetWidth.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 (TargetHeight != 0) { - output.WriteRawTag(8); - output.WriteInt32(TargetHeight); - } - if (TargetWidth != 0) { - output.WriteRawTag(16); - output.WriteInt32(TargetWidth); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TargetHeight != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(TargetHeight); - } - if (TargetWidth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(TargetWidth); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomResizeMethod other) { - if (other == null) { - return; - } - if (other.TargetHeight != 0) { - TargetHeight = other.TargetHeight; - } - if (other.TargetWidth != 0) { - TargetWidth = other.TargetWidth; - } - _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: { - TargetHeight = input.ReadInt32(); - break; - } - case 16: { - TargetWidth = input.ReadInt32(); - break; - } - } - } - } - - } - - /// - /// Converts the RGB image to a grayscale image. This also converts the image - /// depth from 3 to 1, unlike RandomRGBtoGray which does not change the image - /// depth. - /// - public sealed partial class RGBtoGray : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RGBtoGray()); - 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.PreprocessorReflection.Descriptor.MessageTypes[21]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RGBtoGray() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RGBtoGray(RGBtoGray other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RGBtoGray Clone() { - return new RGBtoGray(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RGBtoGray); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RGBtoGray 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(RGBtoGray 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; - } - } - } - - } - - /// - /// Scales boxes from normalized coordinates to pixel coordinates. - /// - public sealed partial class ScaleBoxesToPixelCoordinates : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScaleBoxesToPixelCoordinates()); - 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.PreprocessorReflection.Descriptor.MessageTypes[22]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScaleBoxesToPixelCoordinates() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScaleBoxesToPixelCoordinates(ScaleBoxesToPixelCoordinates other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ScaleBoxesToPixelCoordinates Clone() { - return new ScaleBoxesToPixelCoordinates(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ScaleBoxesToPixelCoordinates); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ScaleBoxesToPixelCoordinates 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(ScaleBoxesToPixelCoordinates 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; - } - } - } - - } - - /// - /// Resizes images to [new_height, new_width]. - /// - public sealed partial class ResizeImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResizeImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[23]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ResizeImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ResizeImage(ResizeImage other) : this() { - newHeight_ = other.newHeight_; - newWidth_ = other.newWidth_; - method_ = other.method_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ResizeImage Clone() { - return new ResizeImage(this); - } - - /// Field number for the "new_height" field. - public const int NewHeightFieldNumber = 1; - private int newHeight_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NewHeight { - get { return newHeight_; } - set { - newHeight_ = value; - } - } - - /// Field number for the "new_width" field. - public const int NewWidthFieldNumber = 2; - private int newWidth_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NewWidth { - get { return newWidth_; } - set { - newWidth_ = value; - } - } - - /// Field number for the "method" field. - public const int MethodFieldNumber = 3; - private global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage.Types.Method method_ = 0; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage.Types.Method Method { - get { return method_; } - set { - method_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ResizeImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ResizeImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (NewHeight != other.NewHeight) return false; - if (NewWidth != other.NewWidth) return false; - if (Method != other.Method) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (NewHeight != 0) hash ^= NewHeight.GetHashCode(); - if (NewWidth != 0) hash ^= NewWidth.GetHashCode(); - if (Method != 0) hash ^= Method.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 (NewHeight != 0) { - output.WriteRawTag(8); - output.WriteInt32(NewHeight); - } - if (NewWidth != 0) { - output.WriteRawTag(16); - output.WriteInt32(NewWidth); - } - if (Method != 0) { - output.WriteRawTag(24); - output.WriteEnum((int) Method); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (NewHeight != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NewHeight); - } - if (NewWidth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NewWidth); - } - if (Method != 0) { - size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Method); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ResizeImage other) { - if (other == null) { - return; - } - if (other.NewHeight != 0) { - NewHeight = other.NewHeight; - } - if (other.NewWidth != 0) { - NewWidth = other.NewWidth; - } - if (other.Method != 0) { - Method = other.Method; - } - _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: { - NewHeight = input.ReadInt32(); - break; - } - case 16: { - NewWidth = input.ReadInt32(); - break; - } - case 24: { - method_ = (global::Tensorflow.Models.ObjectDetection.Protos.ResizeImage.Types.Method) input.ReadEnum(); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the ResizeImage message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - public enum Method { - [pbr::OriginalName("NONE")] None = 0, - [pbr::OriginalName("AREA")] Area = 1, - [pbr::OriginalName("BICUBIC")] Bicubic = 2, - [pbr::OriginalName("BILINEAR")] Bilinear = 3, - [pbr::OriginalName("NEAREST_NEIGHBOR")] NearestNeighbor = 4, - } - - } - #endregion - - } - - /// - /// Normalizes an image by subtracting a mean from each channel. - /// - public sealed partial class SubtractChannelMean : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SubtractChannelMean()); - 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.PreprocessorReflection.Descriptor.MessageTypes[24]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubtractChannelMean() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubtractChannelMean(SubtractChannelMean other) : this() { - means_ = other.means_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SubtractChannelMean Clone() { - return new SubtractChannelMean(this); - } - - /// Field number for the "means" field. - public const int MeansFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_means_codec - = pb::FieldCodec.ForFloat(10); - private readonly pbc::RepeatedField means_ = new pbc::RepeatedField(); - /// - /// The mean to subtract from each channel. Should be of same dimension of - /// channels in the input image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Means { - get { return means_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SubtractChannelMean); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SubtractChannelMean other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!means_.Equals(other.means_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= means_.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) { - means_.WriteTo(output, _repeated_means_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += means_.CalculateSize(_repeated_means_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SubtractChannelMean other) { - if (other == null) { - return; - } - means_.Add(other.means_); - _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: { - means_.AddEntriesFrom(input, _repeated_means_codec); - break; - } - } - } - } - - } - - public sealed partial class SSDRandomCropOperation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropOperation()); - 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.PreprocessorReflection.Descriptor.MessageTypes[25]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropOperation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropOperation(SSDRandomCropOperation other) : this() { - minObjectCovered_ = other.minObjectCovered_; - minAspectRatio_ = other.minAspectRatio_; - maxAspectRatio_ = other.maxAspectRatio_; - minArea_ = other.minArea_; - maxArea_ = other.maxArea_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - randomCoef_ = other.randomCoef_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropOperation Clone() { - return new SSDRandomCropOperation(this); - } - - /// Field number for the "min_object_covered" field. - public const int MinObjectCoveredFieldNumber = 1; - private float minObjectCovered_; - /// - /// Cropped image must cover at least this fraction of one original bounding - /// box. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinObjectCovered { - get { return minObjectCovered_; } - set { - minObjectCovered_ = value; - } - } - - /// Field number for the "min_aspect_ratio" field. - public const int MinAspectRatioFieldNumber = 2; - private float minAspectRatio_; - /// - /// The aspect ratio of the cropped image must be within the range of - /// [min_aspect_ratio, max_aspect_ratio]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinAspectRatio { - get { return minAspectRatio_; } - set { - minAspectRatio_ = value; - } - } - - /// Field number for the "max_aspect_ratio" field. - public const int MaxAspectRatioFieldNumber = 3; - private float maxAspectRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxAspectRatio { - get { return maxAspectRatio_; } - set { - maxAspectRatio_ = value; - } - } - - /// Field number for the "min_area" field. - public const int MinAreaFieldNumber = 4; - private float minArea_; - /// - /// The area of the cropped image must be within the range of - /// [min_area, max_area]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinArea { - get { return minArea_; } - set { - minArea_ = value; - } - } - - /// Field number for the "max_area" field. - public const int MaxAreaFieldNumber = 5; - private float maxArea_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxArea { - get { return maxArea_; } - set { - maxArea_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 6; - private float overlapThresh_; - /// - /// Cropped box area ratio must be above this threhold to be kept. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 8; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - /// Field number for the "random_coef" field. - public const int RandomCoefFieldNumber = 7; - private float randomCoef_; - /// - /// Probability a crop operation is skipped. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float RandomCoef { - get { return randomCoef_; } - set { - randomCoef_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropOperation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropOperation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinObjectCovered, other.MinObjectCovered)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAspectRatio, other.MinAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxAspectRatio, other.MaxAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinArea, other.MinArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxArea, other.MaxArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RandomCoef, other.RandomCoef)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinObjectCovered != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinObjectCovered); - if (MinAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAspectRatio); - if (MaxAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxAspectRatio); - if (MinArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinArea); - if (MaxArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxArea); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.GetHashCode(); - if (RandomCoef != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RandomCoef); - 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 (MinObjectCovered != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinObjectCovered); - } - if (MinAspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MinAspectRatio); - } - if (MaxAspectRatio != 0F) { - output.WriteRawTag(29); - output.WriteFloat(MaxAspectRatio); - } - if (MinArea != 0F) { - output.WriteRawTag(37); - output.WriteFloat(MinArea); - } - if (MaxArea != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MaxArea); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(53); - output.WriteFloat(OverlapThresh); - } - if (RandomCoef != 0F) { - output.WriteRawTag(61); - output.WriteFloat(RandomCoef); - } - if (ClipBoxes != false) { - output.WriteRawTag(64); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinObjectCovered != 0F) { - size += 1 + 4; - } - if (MinAspectRatio != 0F) { - size += 1 + 4; - } - if (MaxAspectRatio != 0F) { - size += 1 + 4; - } - if (MinArea != 0F) { - size += 1 + 4; - } - if (MaxArea != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (RandomCoef != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropOperation other) { - if (other == null) { - return; - } - if (other.MinObjectCovered != 0F) { - MinObjectCovered = other.MinObjectCovered; - } - if (other.MinAspectRatio != 0F) { - MinAspectRatio = other.MinAspectRatio; - } - if (other.MaxAspectRatio != 0F) { - MaxAspectRatio = other.MaxAspectRatio; - } - if (other.MinArea != 0F) { - MinArea = other.MinArea; - } - if (other.MaxArea != 0F) { - MaxArea = other.MaxArea; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - if (other.RandomCoef != 0F) { - RandomCoef = other.RandomCoef; - } - _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: { - MinObjectCovered = input.ReadFloat(); - break; - } - case 21: { - MinAspectRatio = input.ReadFloat(); - break; - } - case 29: { - MaxAspectRatio = input.ReadFloat(); - break; - } - case 37: { - MinArea = input.ReadFloat(); - break; - } - case 45: { - MaxArea = input.ReadFloat(); - break; - } - case 53: { - OverlapThresh = input.ReadFloat(); - break; - } - case 61: { - RandomCoef = input.ReadFloat(); - break; - } - case 64: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly crops a image according to: - /// Liu et al., SSD: Single shot multibox detector. - /// This preprocessing step defines multiple SSDRandomCropOperations. Only one - /// operation (chosen at random) is actually performed on an image. - /// - public sealed partial class SSDRandomCrop : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCrop()); - 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.PreprocessorReflection.Descriptor.MessageTypes[26]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCrop() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCrop(SSDRandomCrop other) : this() { - operations_ = other.operations_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCrop Clone() { - return new SSDRandomCrop(this); - } - - /// Field number for the "operations" field. - public const int OperationsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_operations_codec - = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropOperation.Parser); - private readonly pbc::RepeatedField operations_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Operations { - get { return operations_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCrop); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCrop other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!operations_.Equals(other.operations_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= operations_.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) { - operations_.WriteTo(output, _repeated_operations_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += operations_.CalculateSize(_repeated_operations_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCrop other) { - if (other == null) { - return; - } - operations_.Add(other.operations_); - _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: { - operations_.AddEntriesFrom(input, _repeated_operations_codec); - break; - } - } - } - } - - } - - public sealed partial class SSDRandomCropPadOperation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropPadOperation()); - 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.PreprocessorReflection.Descriptor.MessageTypes[27]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadOperation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadOperation(SSDRandomCropPadOperation other) : this() { - minObjectCovered_ = other.minObjectCovered_; - minAspectRatio_ = other.minAspectRatio_; - maxAspectRatio_ = other.maxAspectRatio_; - minArea_ = other.minArea_; - maxArea_ = other.maxArea_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - randomCoef_ = other.randomCoef_; - minPaddedSizeRatio_ = other.minPaddedSizeRatio_.Clone(); - maxPaddedSizeRatio_ = other.maxPaddedSizeRatio_.Clone(); - padColorR_ = other.padColorR_; - padColorG_ = other.padColorG_; - padColorB_ = other.padColorB_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadOperation Clone() { - return new SSDRandomCropPadOperation(this); - } - - /// Field number for the "min_object_covered" field. - public const int MinObjectCoveredFieldNumber = 1; - private float minObjectCovered_; - /// - /// Cropped image must cover at least this fraction of one original bounding - /// box. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinObjectCovered { - get { return minObjectCovered_; } - set { - minObjectCovered_ = value; - } - } - - /// Field number for the "min_aspect_ratio" field. - public const int MinAspectRatioFieldNumber = 2; - private float minAspectRatio_; - /// - /// The aspect ratio of the cropped image must be within the range of - /// [min_aspect_ratio, max_aspect_ratio]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinAspectRatio { - get { return minAspectRatio_; } - set { - minAspectRatio_ = value; - } - } - - /// Field number for the "max_aspect_ratio" field. - public const int MaxAspectRatioFieldNumber = 3; - private float maxAspectRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxAspectRatio { - get { return maxAspectRatio_; } - set { - maxAspectRatio_ = value; - } - } - - /// Field number for the "min_area" field. - public const int MinAreaFieldNumber = 4; - private float minArea_; - /// - /// The area of the cropped image must be within the range of - /// [min_area, max_area]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinArea { - get { return minArea_; } - set { - minArea_ = value; - } - } - - /// Field number for the "max_area" field. - public const int MaxAreaFieldNumber = 5; - private float maxArea_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxArea { - get { return maxArea_; } - set { - maxArea_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 6; - private float overlapThresh_; - /// - /// Cropped box area ratio must be above this threhold to be kept. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 13; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - /// Field number for the "random_coef" field. - public const int RandomCoefFieldNumber = 7; - private float randomCoef_; - /// - /// Probability a crop operation is skipped. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float RandomCoef { - get { return randomCoef_; } - set { - randomCoef_ = value; - } - } - - /// Field number for the "min_padded_size_ratio" field. - public const int MinPaddedSizeRatioFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_minPaddedSizeRatio_codec - = pb::FieldCodec.ForFloat(66); - private readonly pbc::RepeatedField minPaddedSizeRatio_ = new pbc::RepeatedField(); - /// - /// Min ratio of padded image height and width to the input image's height and - /// width. Two entries per operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField MinPaddedSizeRatio { - get { return minPaddedSizeRatio_; } - } - - /// Field number for the "max_padded_size_ratio" field. - public const int MaxPaddedSizeRatioFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_maxPaddedSizeRatio_codec - = pb::FieldCodec.ForFloat(74); - private readonly pbc::RepeatedField maxPaddedSizeRatio_ = new pbc::RepeatedField(); - /// - /// Max ratio of padded image height and width to the input image's height and - /// width. Two entries per operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField MaxPaddedSizeRatio { - get { return maxPaddedSizeRatio_; } - } - - /// Field number for the "pad_color_r" field. - public const int PadColorRFieldNumber = 10; - private float padColorR_; - /// - /// Padding color. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float PadColorR { - get { return padColorR_; } - set { - padColorR_ = value; - } - } - - /// Field number for the "pad_color_g" field. - public const int PadColorGFieldNumber = 11; - private float padColorG_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float PadColorG { - get { return padColorG_; } - set { - padColorG_ = value; - } - } - - /// Field number for the "pad_color_b" field. - public const int PadColorBFieldNumber = 12; - private float padColorB_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float PadColorB { - get { return padColorB_; } - set { - padColorB_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropPadOperation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropPadOperation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinObjectCovered, other.MinObjectCovered)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAspectRatio, other.MinAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxAspectRatio, other.MaxAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinArea, other.MinArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxArea, other.MaxArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RandomCoef, other.RandomCoef)) return false; - if(!minPaddedSizeRatio_.Equals(other.minPaddedSizeRatio_)) return false; - if(!maxPaddedSizeRatio_.Equals(other.maxPaddedSizeRatio_)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PadColorR, other.PadColorR)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PadColorG, other.PadColorG)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(PadColorB, other.PadColorB)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinObjectCovered != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinObjectCovered); - if (MinAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAspectRatio); - if (MaxAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxAspectRatio); - if (MinArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinArea); - if (MaxArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxArea); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.GetHashCode(); - if (RandomCoef != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RandomCoef); - hash ^= minPaddedSizeRatio_.GetHashCode(); - hash ^= maxPaddedSizeRatio_.GetHashCode(); - if (PadColorR != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PadColorR); - if (PadColorG != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PadColorG); - if (PadColorB != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(PadColorB); - 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 (MinObjectCovered != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinObjectCovered); - } - if (MinAspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MinAspectRatio); - } - if (MaxAspectRatio != 0F) { - output.WriteRawTag(29); - output.WriteFloat(MaxAspectRatio); - } - if (MinArea != 0F) { - output.WriteRawTag(37); - output.WriteFloat(MinArea); - } - if (MaxArea != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MaxArea); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(53); - output.WriteFloat(OverlapThresh); - } - if (RandomCoef != 0F) { - output.WriteRawTag(61); - output.WriteFloat(RandomCoef); - } - minPaddedSizeRatio_.WriteTo(output, _repeated_minPaddedSizeRatio_codec); - maxPaddedSizeRatio_.WriteTo(output, _repeated_maxPaddedSizeRatio_codec); - if (PadColorR != 0F) { - output.WriteRawTag(85); - output.WriteFloat(PadColorR); - } - if (PadColorG != 0F) { - output.WriteRawTag(93); - output.WriteFloat(PadColorG); - } - if (PadColorB != 0F) { - output.WriteRawTag(101); - output.WriteFloat(PadColorB); - } - if (ClipBoxes != false) { - output.WriteRawTag(104); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinObjectCovered != 0F) { - size += 1 + 4; - } - if (MinAspectRatio != 0F) { - size += 1 + 4; - } - if (MaxAspectRatio != 0F) { - size += 1 + 4; - } - if (MinArea != 0F) { - size += 1 + 4; - } - if (MaxArea != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (RandomCoef != 0F) { - size += 1 + 4; - } - size += minPaddedSizeRatio_.CalculateSize(_repeated_minPaddedSizeRatio_codec); - size += maxPaddedSizeRatio_.CalculateSize(_repeated_maxPaddedSizeRatio_codec); - if (PadColorR != 0F) { - size += 1 + 4; - } - if (PadColorG != 0F) { - size += 1 + 4; - } - if (PadColorB != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropPadOperation other) { - if (other == null) { - return; - } - if (other.MinObjectCovered != 0F) { - MinObjectCovered = other.MinObjectCovered; - } - if (other.MinAspectRatio != 0F) { - MinAspectRatio = other.MinAspectRatio; - } - if (other.MaxAspectRatio != 0F) { - MaxAspectRatio = other.MaxAspectRatio; - } - if (other.MinArea != 0F) { - MinArea = other.MinArea; - } - if (other.MaxArea != 0F) { - MaxArea = other.MaxArea; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - if (other.RandomCoef != 0F) { - RandomCoef = other.RandomCoef; - } - minPaddedSizeRatio_.Add(other.minPaddedSizeRatio_); - maxPaddedSizeRatio_.Add(other.maxPaddedSizeRatio_); - if (other.PadColorR != 0F) { - PadColorR = other.PadColorR; - } - if (other.PadColorG != 0F) { - PadColorG = other.PadColorG; - } - if (other.PadColorB != 0F) { - PadColorB = other.PadColorB; - } - _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: { - MinObjectCovered = input.ReadFloat(); - break; - } - case 21: { - MinAspectRatio = input.ReadFloat(); - break; - } - case 29: { - MaxAspectRatio = input.ReadFloat(); - break; - } - case 37: { - MinArea = input.ReadFloat(); - break; - } - case 45: { - MaxArea = input.ReadFloat(); - break; - } - case 53: { - OverlapThresh = input.ReadFloat(); - break; - } - case 61: { - RandomCoef = input.ReadFloat(); - break; - } - case 66: - case 69: { - minPaddedSizeRatio_.AddEntriesFrom(input, _repeated_minPaddedSizeRatio_codec); - break; - } - case 74: - case 77: { - maxPaddedSizeRatio_.AddEntriesFrom(input, _repeated_maxPaddedSizeRatio_codec); - break; - } - case 85: { - PadColorR = input.ReadFloat(); - break; - } - case 93: { - PadColorG = input.ReadFloat(); - break; - } - case 101: { - PadColorB = input.ReadFloat(); - break; - } - case 104: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly crops and pads an image according to: - /// Liu et al., SSD: Single shot multibox detector. - /// This preprocessing step defines multiple SSDRandomCropPadOperations. Only one - /// operation (chosen at random) is actually performed on an image. - /// - public sealed partial class SSDRandomCropPad : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropPad()); - 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.PreprocessorReflection.Descriptor.MessageTypes[28]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPad() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPad(SSDRandomCropPad other) : this() { - operations_ = other.operations_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPad Clone() { - return new SSDRandomCropPad(this); - } - - /// Field number for the "operations" field. - public const int OperationsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_operations_codec - = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadOperation.Parser); - private readonly pbc::RepeatedField operations_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Operations { - get { return operations_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropPad); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropPad other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!operations_.Equals(other.operations_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= operations_.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) { - operations_.WriteTo(output, _repeated_operations_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += operations_.CalculateSize(_repeated_operations_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropPad other) { - if (other == null) { - return; - } - operations_.Add(other.operations_); - _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: { - operations_.AddEntriesFrom(input, _repeated_operations_codec); - break; - } - } - } - } - - } - - public sealed partial class SSDRandomCropFixedAspectRatioOperation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropFixedAspectRatioOperation()); - 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.PreprocessorReflection.Descriptor.MessageTypes[29]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropFixedAspectRatioOperation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropFixedAspectRatioOperation(SSDRandomCropFixedAspectRatioOperation other) : this() { - minObjectCovered_ = other.minObjectCovered_; - minArea_ = other.minArea_; - maxArea_ = other.maxArea_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - randomCoef_ = other.randomCoef_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropFixedAspectRatioOperation Clone() { - return new SSDRandomCropFixedAspectRatioOperation(this); - } - - /// Field number for the "min_object_covered" field. - public const int MinObjectCoveredFieldNumber = 1; - private float minObjectCovered_; - /// - /// Cropped image must cover at least this fraction of one original bounding - /// box. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinObjectCovered { - get { return minObjectCovered_; } - set { - minObjectCovered_ = value; - } - } - - /// Field number for the "min_area" field. - public const int MinAreaFieldNumber = 4; - private float minArea_; - /// - /// The area of the cropped image must be within the range of - /// [min_area, max_area]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinArea { - get { return minArea_; } - set { - minArea_ = value; - } - } - - /// Field number for the "max_area" field. - public const int MaxAreaFieldNumber = 5; - private float maxArea_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxArea { - get { return maxArea_; } - set { - maxArea_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 6; - private float overlapThresh_; - /// - /// Cropped box area ratio must be above this threhold to be kept. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 8; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - /// Field number for the "random_coef" field. - public const int RandomCoefFieldNumber = 7; - private float randomCoef_; - /// - /// Probability a crop operation is skipped. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float RandomCoef { - get { return randomCoef_; } - set { - randomCoef_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropFixedAspectRatioOperation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropFixedAspectRatioOperation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinObjectCovered, other.MinObjectCovered)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinArea, other.MinArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxArea, other.MaxArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RandomCoef, other.RandomCoef)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinObjectCovered != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinObjectCovered); - if (MinArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinArea); - if (MaxArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxArea); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.GetHashCode(); - if (RandomCoef != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RandomCoef); - 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 (MinObjectCovered != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinObjectCovered); - } - if (MinArea != 0F) { - output.WriteRawTag(37); - output.WriteFloat(MinArea); - } - if (MaxArea != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MaxArea); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(53); - output.WriteFloat(OverlapThresh); - } - if (RandomCoef != 0F) { - output.WriteRawTag(61); - output.WriteFloat(RandomCoef); - } - if (ClipBoxes != false) { - output.WriteRawTag(64); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinObjectCovered != 0F) { - size += 1 + 4; - } - if (MinArea != 0F) { - size += 1 + 4; - } - if (MaxArea != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (RandomCoef != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropFixedAspectRatioOperation other) { - if (other == null) { - return; - } - if (other.MinObjectCovered != 0F) { - MinObjectCovered = other.MinObjectCovered; - } - if (other.MinArea != 0F) { - MinArea = other.MinArea; - } - if (other.MaxArea != 0F) { - MaxArea = other.MaxArea; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - if (other.RandomCoef != 0F) { - RandomCoef = other.RandomCoef; - } - _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: { - MinObjectCovered = input.ReadFloat(); - break; - } - case 37: { - MinArea = input.ReadFloat(); - break; - } - case 45: { - MaxArea = input.ReadFloat(); - break; - } - case 53: { - OverlapThresh = input.ReadFloat(); - break; - } - case 61: { - RandomCoef = input.ReadFloat(); - break; - } - case 64: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly crops a image to a fixed aspect ratio according to: - /// Liu et al., SSD: Single shot multibox detector. - /// Multiple SSDRandomCropFixedAspectRatioOperations are defined by this - /// preprocessing step. Only one operation (chosen at random) is actually - /// performed on an image. - /// - public sealed partial class SSDRandomCropFixedAspectRatio : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropFixedAspectRatio()); - 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.PreprocessorReflection.Descriptor.MessageTypes[30]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropFixedAspectRatio() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropFixedAspectRatio(SSDRandomCropFixedAspectRatio other) : this() { - operations_ = other.operations_.Clone(); - aspectRatio_ = other.aspectRatio_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropFixedAspectRatio Clone() { - return new SSDRandomCropFixedAspectRatio(this); - } - - /// Field number for the "operations" field. - public const int OperationsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_operations_codec - = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropFixedAspectRatioOperation.Parser); - private readonly pbc::RepeatedField operations_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Operations { - get { return operations_; } - } - - /// Field number for the "aspect_ratio" field. - public const int AspectRatioFieldNumber = 2; - private float aspectRatio_; - /// - /// Aspect ratio to crop to. This value is used for all crop operations. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float AspectRatio { - get { return aspectRatio_; } - set { - aspectRatio_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropFixedAspectRatio); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropFixedAspectRatio other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!operations_.Equals(other.operations_)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AspectRatio, other.AspectRatio)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= operations_.GetHashCode(); - if (AspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AspectRatio); - 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) { - operations_.WriteTo(output, _repeated_operations_codec); - if (AspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(AspectRatio); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += operations_.CalculateSize(_repeated_operations_codec); - if (AspectRatio != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropFixedAspectRatio other) { - if (other == null) { - return; - } - operations_.Add(other.operations_); - if (other.AspectRatio != 0F) { - AspectRatio = other.AspectRatio; - } - _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: { - operations_.AddEntriesFrom(input, _repeated_operations_codec); - break; - } - case 21: { - AspectRatio = input.ReadFloat(); - break; - } - } - } - } - - } - - public sealed partial class SSDRandomCropPadFixedAspectRatioOperation : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropPadFixedAspectRatioOperation()); - 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.PreprocessorReflection.Descriptor.MessageTypes[31]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadFixedAspectRatioOperation() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadFixedAspectRatioOperation(SSDRandomCropPadFixedAspectRatioOperation other) : this() { - minObjectCovered_ = other.minObjectCovered_; - minAspectRatio_ = other.minAspectRatio_; - maxAspectRatio_ = other.maxAspectRatio_; - minArea_ = other.minArea_; - maxArea_ = other.maxArea_; - overlapThresh_ = other.overlapThresh_; - clipBoxes_ = other.clipBoxes_; - randomCoef_ = other.randomCoef_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadFixedAspectRatioOperation Clone() { - return new SSDRandomCropPadFixedAspectRatioOperation(this); - } - - /// Field number for the "min_object_covered" field. - public const int MinObjectCoveredFieldNumber = 1; - private float minObjectCovered_; - /// - /// Cropped image must cover at least this fraction of one original bounding - /// box. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinObjectCovered { - get { return minObjectCovered_; } - set { - minObjectCovered_ = value; - } - } - - /// Field number for the "min_aspect_ratio" field. - public const int MinAspectRatioFieldNumber = 2; - private float minAspectRatio_; - /// - /// The aspect ratio of the cropped image must be within the range of - /// [min_aspect_ratio, max_aspect_ratio]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinAspectRatio { - get { return minAspectRatio_; } - set { - minAspectRatio_ = value; - } - } - - /// Field number for the "max_aspect_ratio" field. - public const int MaxAspectRatioFieldNumber = 3; - private float maxAspectRatio_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxAspectRatio { - get { return maxAspectRatio_; } - set { - maxAspectRatio_ = value; - } - } - - /// Field number for the "min_area" field. - public const int MinAreaFieldNumber = 4; - private float minArea_; - /// - /// The area of the cropped image must be within the range of - /// [min_area, max_area]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinArea { - get { return minArea_; } - set { - minArea_ = value; - } - } - - /// Field number for the "max_area" field. - public const int MaxAreaFieldNumber = 5; - private float maxArea_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxArea { - get { return maxArea_; } - set { - maxArea_ = value; - } - } - - /// Field number for the "overlap_thresh" field. - public const int OverlapThreshFieldNumber = 6; - private float overlapThresh_; - /// - /// Cropped box area ratio must be above this threhold to be kept. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float OverlapThresh { - get { return overlapThresh_; } - set { - overlapThresh_ = value; - } - } - - /// Field number for the "clip_boxes" field. - public const int ClipBoxesFieldNumber = 8; - private bool clipBoxes_; - /// - /// Whether to clip the boxes to the cropped image. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ClipBoxes { - get { return clipBoxes_; } - set { - clipBoxes_ = value; - } - } - - /// Field number for the "random_coef" field. - public const int RandomCoefFieldNumber = 7; - private float randomCoef_; - /// - /// Probability a crop operation is skipped. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float RandomCoef { - get { return randomCoef_; } - set { - randomCoef_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropPadFixedAspectRatioOperation); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropPadFixedAspectRatioOperation other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinObjectCovered, other.MinObjectCovered)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinAspectRatio, other.MinAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxAspectRatio, other.MaxAspectRatio)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinArea, other.MinArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxArea, other.MaxArea)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(OverlapThresh, other.OverlapThresh)) return false; - if (ClipBoxes != other.ClipBoxes) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(RandomCoef, other.RandomCoef)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinObjectCovered != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinObjectCovered); - if (MinAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinAspectRatio); - if (MaxAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxAspectRatio); - if (MinArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinArea); - if (MaxArea != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxArea); - if (OverlapThresh != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(OverlapThresh); - if (ClipBoxes != false) hash ^= ClipBoxes.GetHashCode(); - if (RandomCoef != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(RandomCoef); - 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 (MinObjectCovered != 0F) { - output.WriteRawTag(13); - output.WriteFloat(MinObjectCovered); - } - if (MinAspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MinAspectRatio); - } - if (MaxAspectRatio != 0F) { - output.WriteRawTag(29); - output.WriteFloat(MaxAspectRatio); - } - if (MinArea != 0F) { - output.WriteRawTag(37); - output.WriteFloat(MinArea); - } - if (MaxArea != 0F) { - output.WriteRawTag(45); - output.WriteFloat(MaxArea); - } - if (OverlapThresh != 0F) { - output.WriteRawTag(53); - output.WriteFloat(OverlapThresh); - } - if (RandomCoef != 0F) { - output.WriteRawTag(61); - output.WriteFloat(RandomCoef); - } - if (ClipBoxes != false) { - output.WriteRawTag(64); - output.WriteBool(ClipBoxes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinObjectCovered != 0F) { - size += 1 + 4; - } - if (MinAspectRatio != 0F) { - size += 1 + 4; - } - if (MaxAspectRatio != 0F) { - size += 1 + 4; - } - if (MinArea != 0F) { - size += 1 + 4; - } - if (MaxArea != 0F) { - size += 1 + 4; - } - if (OverlapThresh != 0F) { - size += 1 + 4; - } - if (ClipBoxes != false) { - size += 1 + 1; - } - if (RandomCoef != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropPadFixedAspectRatioOperation other) { - if (other == null) { - return; - } - if (other.MinObjectCovered != 0F) { - MinObjectCovered = other.MinObjectCovered; - } - if (other.MinAspectRatio != 0F) { - MinAspectRatio = other.MinAspectRatio; - } - if (other.MaxAspectRatio != 0F) { - MaxAspectRatio = other.MaxAspectRatio; - } - if (other.MinArea != 0F) { - MinArea = other.MinArea; - } - if (other.MaxArea != 0F) { - MaxArea = other.MaxArea; - } - if (other.OverlapThresh != 0F) { - OverlapThresh = other.OverlapThresh; - } - if (other.ClipBoxes != false) { - ClipBoxes = other.ClipBoxes; - } - if (other.RandomCoef != 0F) { - RandomCoef = other.RandomCoef; - } - _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: { - MinObjectCovered = input.ReadFloat(); - break; - } - case 21: { - MinAspectRatio = input.ReadFloat(); - break; - } - case 29: { - MaxAspectRatio = input.ReadFloat(); - break; - } - case 37: { - MinArea = input.ReadFloat(); - break; - } - case 45: { - MaxArea = input.ReadFloat(); - break; - } - case 53: { - OverlapThresh = input.ReadFloat(); - break; - } - case 61: { - RandomCoef = input.ReadFloat(); - break; - } - case 64: { - ClipBoxes = input.ReadBool(); - break; - } - } - } - } - - } - - /// - /// Randomly crops and pads an image to a fixed aspect ratio according to: - /// Liu et al., SSD: Single shot multibox detector. - /// Multiple SSDRandomCropPadFixedAspectRatioOperations are defined by this - /// preprocessing step. Only one operation (chosen at random) is actually - /// performed on an image. - /// - public sealed partial class SSDRandomCropPadFixedAspectRatio : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SSDRandomCropPadFixedAspectRatio()); - 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.PreprocessorReflection.Descriptor.MessageTypes[32]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadFixedAspectRatio() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadFixedAspectRatio(SSDRandomCropPadFixedAspectRatio other) : this() { - operations_ = other.operations_.Clone(); - aspectRatio_ = other.aspectRatio_; - minPaddedSizeRatio_ = other.minPaddedSizeRatio_.Clone(); - maxPaddedSizeRatio_ = other.maxPaddedSizeRatio_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SSDRandomCropPadFixedAspectRatio Clone() { - return new SSDRandomCropPadFixedAspectRatio(this); - } - - /// Field number for the "operations" field. - public const int OperationsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_operations_codec - = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.SSDRandomCropPadFixedAspectRatioOperation.Parser); - private readonly pbc::RepeatedField operations_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Operations { - get { return operations_; } - } - - /// Field number for the "aspect_ratio" field. - public const int AspectRatioFieldNumber = 2; - private float aspectRatio_; - /// - /// Aspect ratio to pad to. This value is used for all crop and pad operations. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float AspectRatio { - get { return aspectRatio_; } - set { - aspectRatio_ = value; - } - } - - /// Field number for the "min_padded_size_ratio" field. - public const int MinPaddedSizeRatioFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_minPaddedSizeRatio_codec - = pb::FieldCodec.ForFloat(26); - private readonly pbc::RepeatedField minPaddedSizeRatio_ = new pbc::RepeatedField(); - /// - /// Min ratio of padded image height and width to the input image's height and - /// width. Two entries per operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField MinPaddedSizeRatio { - get { return minPaddedSizeRatio_; } - } - - /// Field number for the "max_padded_size_ratio" field. - public const int MaxPaddedSizeRatioFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_maxPaddedSizeRatio_codec - = pb::FieldCodec.ForFloat(34); - private readonly pbc::RepeatedField maxPaddedSizeRatio_ = new pbc::RepeatedField(); - /// - /// Max ratio of padded image height and width to the input image's height and - /// width. Two entries per operation. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField MaxPaddedSizeRatio { - get { return maxPaddedSizeRatio_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SSDRandomCropPadFixedAspectRatio); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SSDRandomCropPadFixedAspectRatio other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!operations_.Equals(other.operations_)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AspectRatio, other.AspectRatio)) return false; - if(!minPaddedSizeRatio_.Equals(other.minPaddedSizeRatio_)) return false; - if(!maxPaddedSizeRatio_.Equals(other.maxPaddedSizeRatio_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= operations_.GetHashCode(); - if (AspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AspectRatio); - hash ^= minPaddedSizeRatio_.GetHashCode(); - hash ^= maxPaddedSizeRatio_.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) { - operations_.WriteTo(output, _repeated_operations_codec); - if (AspectRatio != 0F) { - output.WriteRawTag(21); - output.WriteFloat(AspectRatio); - } - minPaddedSizeRatio_.WriteTo(output, _repeated_minPaddedSizeRatio_codec); - maxPaddedSizeRatio_.WriteTo(output, _repeated_maxPaddedSizeRatio_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += operations_.CalculateSize(_repeated_operations_codec); - if (AspectRatio != 0F) { - size += 1 + 4; - } - size += minPaddedSizeRatio_.CalculateSize(_repeated_minPaddedSizeRatio_codec); - size += maxPaddedSizeRatio_.CalculateSize(_repeated_maxPaddedSizeRatio_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SSDRandomCropPadFixedAspectRatio other) { - if (other == null) { - return; - } - operations_.Add(other.operations_); - if (other.AspectRatio != 0F) { - AspectRatio = other.AspectRatio; - } - minPaddedSizeRatio_.Add(other.minPaddedSizeRatio_); - maxPaddedSizeRatio_.Add(other.maxPaddedSizeRatio_); - _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: { - operations_.AddEntriesFrom(input, _repeated_operations_codec); - break; - } - case 21: { - AspectRatio = input.ReadFloat(); - break; - } - case 26: - case 29: { - minPaddedSizeRatio_.AddEntriesFrom(input, _repeated_minPaddedSizeRatio_codec); - break; - } - case 34: - case 37: { - maxPaddedSizeRatio_.AddEntriesFrom(input, _repeated_maxPaddedSizeRatio_codec); - break; - } - } - } - } - - } - - /// - /// Converts class logits to softmax optionally scaling the values by temperature - /// first. - /// - public sealed partial class ConvertClassLogitsToSoftmax : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ConvertClassLogitsToSoftmax()); - 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.PreprocessorReflection.Descriptor.MessageTypes[33]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ConvertClassLogitsToSoftmax() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ConvertClassLogitsToSoftmax(ConvertClassLogitsToSoftmax other) : this() { - temperature_ = other.temperature_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ConvertClassLogitsToSoftmax Clone() { - return new ConvertClassLogitsToSoftmax(this); - } - - /// Field number for the "temperature" field. - public const int TemperatureFieldNumber = 1; - private float temperature_; - /// - /// Scale to use on logits before applying softmax. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float Temperature { - get { return temperature_; } - set { - temperature_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ConvertClassLogitsToSoftmax); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ConvertClassLogitsToSoftmax other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Temperature, other.Temperature)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Temperature != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Temperature); - 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 (Temperature != 0F) { - output.WriteRawTag(13); - output.WriteFloat(Temperature); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Temperature != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ConvertClassLogitsToSoftmax other) { - if (other == null) { - return; - } - if (other.Temperature != 0F) { - Temperature = other.Temperature; - } - _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: { - Temperature = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Randomly concatenates the image with itself horizontally and/or vertically. - /// - public sealed partial class RandomSelfConcatImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RandomSelfConcatImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[34]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomSelfConcatImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomSelfConcatImage(RandomSelfConcatImage other) : this() { - concatVerticalProbability_ = other.concatVerticalProbability_; - concatHorizontalProbability_ = other.concatHorizontalProbability_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RandomSelfConcatImage Clone() { - return new RandomSelfConcatImage(this); - } - - /// Field number for the "concat_vertical_probability" field. - public const int ConcatVerticalProbabilityFieldNumber = 1; - private float concatVerticalProbability_; - /// - /// Probability of concatenating the image vertically. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float ConcatVerticalProbability { - get { return concatVerticalProbability_; } - set { - concatVerticalProbability_ = value; - } - } - - /// Field number for the "concat_horizontal_probability" field. - public const int ConcatHorizontalProbabilityFieldNumber = 2; - private float concatHorizontalProbability_; - /// - /// Probability of concatenating the image horizontally. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float ConcatHorizontalProbability { - get { return concatHorizontalProbability_; } - set { - concatHorizontalProbability_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RandomSelfConcatImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RandomSelfConcatImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ConcatVerticalProbability, other.ConcatVerticalProbability)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ConcatHorizontalProbability, other.ConcatHorizontalProbability)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (ConcatVerticalProbability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ConcatVerticalProbability); - if (ConcatHorizontalProbability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ConcatHorizontalProbability); - 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 (ConcatVerticalProbability != 0F) { - output.WriteRawTag(13); - output.WriteFloat(ConcatVerticalProbability); - } - if (ConcatHorizontalProbability != 0F) { - output.WriteRawTag(21); - output.WriteFloat(ConcatHorizontalProbability); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (ConcatVerticalProbability != 0F) { - size += 1 + 4; - } - if (ConcatHorizontalProbability != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RandomSelfConcatImage other) { - if (other == null) { - return; - } - if (other.ConcatVerticalProbability != 0F) { - ConcatVerticalProbability = other.ConcatVerticalProbability; - } - if (other.ConcatHorizontalProbability != 0F) { - ConcatHorizontalProbability = other.ConcatHorizontalProbability; - } - _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: { - ConcatVerticalProbability = input.ReadFloat(); - break; - } - case 21: { - ConcatHorizontalProbability = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - /// Apply an Autoaugment policy to the image and bounding boxes. - /// - public sealed partial class AutoAugmentImage : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AutoAugmentImage()); - 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.PreprocessorReflection.Descriptor.MessageTypes[35]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AutoAugmentImage() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AutoAugmentImage(AutoAugmentImage other) : this() { - policyName_ = other.policyName_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public AutoAugmentImage Clone() { - return new AutoAugmentImage(this); - } - - /// Field number for the "policy_name" field. - public const int PolicyNameFieldNumber = 1; - private string policyName_ = ""; - /// - /// What AutoAugment policy to apply to the Image - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string PolicyName { - get { return policyName_; } - set { - policyName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as AutoAugmentImage); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(AutoAugmentImage other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (PolicyName != other.PolicyName) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (PolicyName.Length != 0) hash ^= PolicyName.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 (PolicyName.Length != 0) { - output.WriteRawTag(10); - output.WriteString(PolicyName); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (PolicyName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(PolicyName); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(AutoAugmentImage other) { - if (other == null) { - return; - } - if (other.PolicyName.Length != 0) { - PolicyName = other.PolicyName; - } - _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: { - PolicyName = input.ReadString(); - break; - } - } - } - } - - } - - /// - /// Randomly drops ground truth boxes for a label with some probability. - /// - public sealed partial class DropLabelProbabilistically : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DropLabelProbabilistically()); - 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.PreprocessorReflection.Descriptor.MessageTypes[36]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DropLabelProbabilistically() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DropLabelProbabilistically(DropLabelProbabilistically other) : this() { - label_ = other.label_; - dropProbability_ = other.dropProbability_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public DropLabelProbabilistically Clone() { - return new DropLabelProbabilistically(this); - } - - /// Field number for the "label" field. - public const int LabelFieldNumber = 1; - private int label_; - /// - /// The label that should be dropped. This corresponds to one of the entries - /// in the label map. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Label { - get { return label_; } - set { - label_ = value; - } - } - - /// Field number for the "drop_probability" field. - public const int DropProbabilityFieldNumber = 2; - private float dropProbability_; - /// - /// Probability of dropping the label. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float DropProbability { - get { return dropProbability_; } - set { - dropProbability_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as DropLabelProbabilistically); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(DropLabelProbabilistically other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Label != other.Label) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DropProbability, other.DropProbability)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (Label != 0) hash ^= Label.GetHashCode(); - if (DropProbability != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DropProbability); - 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 (Label != 0) { - output.WriteRawTag(8); - output.WriteInt32(Label); - } - if (DropProbability != 0F) { - output.WriteRawTag(21); - output.WriteFloat(DropProbability); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Label != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Label); - } - if (DropProbability != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(DropLabelProbabilistically other) { - if (other == null) { - return; - } - if (other.Label != 0) { - Label = other.Label; - } - if (other.DropProbability != 0F) { - DropProbability = other.DropProbability; - } - _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: { - Label = input.ReadInt32(); - break; - } - case 21: { - DropProbability = input.ReadFloat(); - break; - } - } - } - } - - } - - /// - ///Remap a set of labels to a new label. - /// - public sealed partial class RemapLabels : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RemapLabels()); - 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.PreprocessorReflection.Descriptor.MessageTypes[37]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RemapLabels() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RemapLabels(RemapLabels other) : this() { - originalLabels_ = other.originalLabels_.Clone(); - newLabel_ = other.newLabel_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RemapLabels Clone() { - return new RemapLabels(this); - } - - /// Field number for the "original_labels" field. - public const int OriginalLabelsFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_originalLabels_codec - = pb::FieldCodec.ForInt32(10); - private readonly pbc::RepeatedField originalLabels_ = new pbc::RepeatedField(); - /// - /// Labels to be remapped. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField OriginalLabels { - get { return originalLabels_; } - } - - /// Field number for the "new_label" field. - public const int NewLabelFieldNumber = 2; - private int newLabel_; - /// - /// Label to map to. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NewLabel { - get { return newLabel_; } - set { - newLabel_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RemapLabels); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RemapLabels other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!originalLabels_.Equals(other.originalLabels_)) return false; - if (NewLabel != other.NewLabel) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= originalLabels_.GetHashCode(); - if (NewLabel != 0) hash ^= NewLabel.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) { - originalLabels_.WriteTo(output, _repeated_originalLabels_codec); - if (NewLabel != 0) { - output.WriteRawTag(16); - output.WriteInt32(NewLabel); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += originalLabels_.CalculateSize(_repeated_originalLabels_codec); - if (NewLabel != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NewLabel); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RemapLabels other) { - if (other == null) { - return; - } - originalLabels_.Add(other.originalLabels_); - if (other.NewLabel != 0) { - NewLabel = other.NewLabel; - } - _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 8: { - originalLabels_.AddEntriesFrom(input, _repeated_originalLabels_codec); - break; - } - case 16: { - NewLabel = input.ReadInt32(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/RegionSimilarityCalculator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/RegionSimilarityCalculator.cs deleted file mode 100644 index 9b06eebc..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/RegionSimilarityCalculator.cs +++ /dev/null @@ -1,791 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/region_similarity_calculator.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/region_similarity_calculator.proto - public static partial class RegionSimilarityCalculatorReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/region_similarity_calculator.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static RegionSimilarityCalculatorReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjpvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9yZWdpb25fc2ltaWxhcml0eV9j", - "YWxjdWxhdG9yLnByb3RvEhdvYmplY3RfZGV0ZWN0aW9uLnByb3RvcyLeAgoa", - "UmVnaW9uU2ltaWxhcml0eUNhbGN1bGF0b3ISTgoWbmVnX3NxX2Rpc3Rfc2lt", - "aWxhcml0eRgBIAEoCzIsLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLk5lZ1Nx", - "RGlzdFNpbWlsYXJpdHlIABJACg5pb3Vfc2ltaWxhcml0eRgCIAEoCzImLm9i", - "amVjdF9kZXRlY3Rpb24ucHJvdG9zLklvdVNpbWlsYXJpdHlIABJACg5pb2Ff", - "c2ltaWxhcml0eRgDIAEoCzImLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLklv", - "YVNpbWlsYXJpdHlIABJXChp0aHJlc2hvbGRlZF9pb3Vfc2ltaWxhcml0eRgE", - "IAEoCzIxLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlRocmVzaG9sZGVkSW91", - "U2ltaWxhcml0eUgAQhMKEXJlZ2lvbl9zaW1pbGFyaXR5IhUKE05lZ1NxRGlz", - "dFNpbWlsYXJpdHkiDwoNSW91U2ltaWxhcml0eSIPCg1Jb2FTaW1pbGFyaXR5", - "IjEKGFRocmVzaG9sZGVkSW91U2ltaWxhcml0eRIVCg1pb3VfdGhyZXNob2xk", - "GAEgASgCYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculator), global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculator.Parser, new[]{ "NegSqDistSimilarity", "IouSimilarity", "IoaSimilarity", "ThresholdedIouSimilarity" }, new[]{ "RegionSimilarity" }, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.NegSqDistSimilarity), global::Tensorflow.Models.ObjectDetection.Protos.NegSqDistSimilarity.Parser, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity), global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity.Parser, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity), global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity.Parser, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity), global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity.Parser, new[]{ "IouThreshold" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for region similarity calculators. See - /// core/region_similarity_calculator.py for details. - /// - public sealed partial class RegionSimilarityCalculator : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RegionSimilarityCalculator()); - 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.RegionSimilarityCalculatorReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RegionSimilarityCalculator() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RegionSimilarityCalculator(RegionSimilarityCalculator other) : this() { - switch (other.RegionSimilarityCase) { - case RegionSimilarityOneofCase.NegSqDistSimilarity: - NegSqDistSimilarity = other.NegSqDistSimilarity.Clone(); - break; - case RegionSimilarityOneofCase.IouSimilarity: - IouSimilarity = other.IouSimilarity.Clone(); - break; - case RegionSimilarityOneofCase.IoaSimilarity: - IoaSimilarity = other.IoaSimilarity.Clone(); - break; - case RegionSimilarityOneofCase.ThresholdedIouSimilarity: - ThresholdedIouSimilarity = other.ThresholdedIouSimilarity.Clone(); - break; - } - - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RegionSimilarityCalculator Clone() { - return new RegionSimilarityCalculator(this); - } - - /// Field number for the "neg_sq_dist_similarity" field. - public const int NegSqDistSimilarityFieldNumber = 1; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.NegSqDistSimilarity NegSqDistSimilarity { - get { return regionSimilarityCase_ == RegionSimilarityOneofCase.NegSqDistSimilarity ? (global::Tensorflow.Models.ObjectDetection.Protos.NegSqDistSimilarity) regionSimilarity_ : null; } - set { - regionSimilarity_ = value; - regionSimilarityCase_ = value == null ? RegionSimilarityOneofCase.None : RegionSimilarityOneofCase.NegSqDistSimilarity; - } - } - - /// Field number for the "iou_similarity" field. - public const int IouSimilarityFieldNumber = 2; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity IouSimilarity { - get { return regionSimilarityCase_ == RegionSimilarityOneofCase.IouSimilarity ? (global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity) regionSimilarity_ : null; } - set { - regionSimilarity_ = value; - regionSimilarityCase_ = value == null ? RegionSimilarityOneofCase.None : RegionSimilarityOneofCase.IouSimilarity; - } - } - - /// Field number for the "ioa_similarity" field. - public const int IoaSimilarityFieldNumber = 3; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity IoaSimilarity { - get { return regionSimilarityCase_ == RegionSimilarityOneofCase.IoaSimilarity ? (global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity) regionSimilarity_ : null; } - set { - regionSimilarity_ = value; - regionSimilarityCase_ = value == null ? RegionSimilarityOneofCase.None : RegionSimilarityOneofCase.IoaSimilarity; - } - } - - /// Field number for the "thresholded_iou_similarity" field. - public const int ThresholdedIouSimilarityFieldNumber = 4; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity ThresholdedIouSimilarity { - get { return regionSimilarityCase_ == RegionSimilarityOneofCase.ThresholdedIouSimilarity ? (global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity) regionSimilarity_ : null; } - set { - regionSimilarity_ = value; - regionSimilarityCase_ = value == null ? RegionSimilarityOneofCase.None : RegionSimilarityOneofCase.ThresholdedIouSimilarity; - } - } - - private object regionSimilarity_; - /// Enum of possible cases for the "region_similarity" oneof. - public enum RegionSimilarityOneofCase { - None = 0, - NegSqDistSimilarity = 1, - IouSimilarity = 2, - IoaSimilarity = 3, - ThresholdedIouSimilarity = 4, - } - private RegionSimilarityOneofCase regionSimilarityCase_ = RegionSimilarityOneofCase.None; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public RegionSimilarityOneofCase RegionSimilarityCase { - get { return regionSimilarityCase_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void ClearRegionSimilarity() { - regionSimilarityCase_ = RegionSimilarityOneofCase.None; - regionSimilarity_ = null; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as RegionSimilarityCalculator); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(RegionSimilarityCalculator other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(NegSqDistSimilarity, other.NegSqDistSimilarity)) return false; - if (!object.Equals(IouSimilarity, other.IouSimilarity)) return false; - if (!object.Equals(IoaSimilarity, other.IoaSimilarity)) return false; - if (!object.Equals(ThresholdedIouSimilarity, other.ThresholdedIouSimilarity)) return false; - if (RegionSimilarityCase != other.RegionSimilarityCase) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (regionSimilarityCase_ == RegionSimilarityOneofCase.NegSqDistSimilarity) hash ^= NegSqDistSimilarity.GetHashCode(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IouSimilarity) hash ^= IouSimilarity.GetHashCode(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IoaSimilarity) hash ^= IoaSimilarity.GetHashCode(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.ThresholdedIouSimilarity) hash ^= ThresholdedIouSimilarity.GetHashCode(); - hash ^= (int) regionSimilarityCase_; - 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 (regionSimilarityCase_ == RegionSimilarityOneofCase.NegSqDistSimilarity) { - output.WriteRawTag(10); - output.WriteMessage(NegSqDistSimilarity); - } - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IouSimilarity) { - output.WriteRawTag(18); - output.WriteMessage(IouSimilarity); - } - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IoaSimilarity) { - output.WriteRawTag(26); - output.WriteMessage(IoaSimilarity); - } - if (regionSimilarityCase_ == RegionSimilarityOneofCase.ThresholdedIouSimilarity) { - output.WriteRawTag(34); - output.WriteMessage(ThresholdedIouSimilarity); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (regionSimilarityCase_ == RegionSimilarityOneofCase.NegSqDistSimilarity) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(NegSqDistSimilarity); - } - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IouSimilarity) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(IouSimilarity); - } - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IoaSimilarity) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(IoaSimilarity); - } - if (regionSimilarityCase_ == RegionSimilarityOneofCase.ThresholdedIouSimilarity) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ThresholdedIouSimilarity); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(RegionSimilarityCalculator other) { - if (other == null) { - return; - } - switch (other.RegionSimilarityCase) { - case RegionSimilarityOneofCase.NegSqDistSimilarity: - if (NegSqDistSimilarity == null) { - NegSqDistSimilarity = new global::Tensorflow.Models.ObjectDetection.Protos.NegSqDistSimilarity(); - } - NegSqDistSimilarity.MergeFrom(other.NegSqDistSimilarity); - break; - case RegionSimilarityOneofCase.IouSimilarity: - if (IouSimilarity == null) { - IouSimilarity = new global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity(); - } - IouSimilarity.MergeFrom(other.IouSimilarity); - break; - case RegionSimilarityOneofCase.IoaSimilarity: - if (IoaSimilarity == null) { - IoaSimilarity = new global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity(); - } - IoaSimilarity.MergeFrom(other.IoaSimilarity); - break; - case RegionSimilarityOneofCase.ThresholdedIouSimilarity: - if (ThresholdedIouSimilarity == null) { - ThresholdedIouSimilarity = new global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity(); - } - ThresholdedIouSimilarity.MergeFrom(other.ThresholdedIouSimilarity); - 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.NegSqDistSimilarity subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.NegSqDistSimilarity(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.NegSqDistSimilarity) { - subBuilder.MergeFrom(NegSqDistSimilarity); - } - input.ReadMessage(subBuilder); - NegSqDistSimilarity = subBuilder; - break; - } - case 18: { - global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.IouSimilarity(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IouSimilarity) { - subBuilder.MergeFrom(IouSimilarity); - } - input.ReadMessage(subBuilder); - IouSimilarity = subBuilder; - break; - } - case 26: { - global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.IoaSimilarity(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.IoaSimilarity) { - subBuilder.MergeFrom(IoaSimilarity); - } - input.ReadMessage(subBuilder); - IoaSimilarity = subBuilder; - break; - } - case 34: { - global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity subBuilder = new global::Tensorflow.Models.ObjectDetection.Protos.ThresholdedIouSimilarity(); - if (regionSimilarityCase_ == RegionSimilarityOneofCase.ThresholdedIouSimilarity) { - subBuilder.MergeFrom(ThresholdedIouSimilarity); - } - input.ReadMessage(subBuilder); - ThresholdedIouSimilarity = subBuilder; - break; - } - } - } - } - - } - - /// - /// Configuration for negative squared distance similarity calculator. - /// - public sealed partial class NegSqDistSimilarity : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new NegSqDistSimilarity()); - 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.RegionSimilarityCalculatorReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NegSqDistSimilarity() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NegSqDistSimilarity(NegSqDistSimilarity other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public NegSqDistSimilarity Clone() { - return new NegSqDistSimilarity(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as NegSqDistSimilarity); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(NegSqDistSimilarity 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(NegSqDistSimilarity 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 for intersection-over-union (IOU) similarity calculator. - /// - public sealed partial class IouSimilarity : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IouSimilarity()); - 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.RegionSimilarityCalculatorReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IouSimilarity() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IouSimilarity(IouSimilarity other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IouSimilarity Clone() { - return new IouSimilarity(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as IouSimilarity); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(IouSimilarity 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(IouSimilarity 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 for intersection-over-area (IOA) similarity calculator. - /// - public sealed partial class IoaSimilarity : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new IoaSimilarity()); - 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.RegionSimilarityCalculatorReflection.Descriptor.MessageTypes[3]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IoaSimilarity() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IoaSimilarity(IoaSimilarity other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public IoaSimilarity Clone() { - return new IoaSimilarity(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as IoaSimilarity); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(IoaSimilarity 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(IoaSimilarity 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 for thresholded-intersection-over-union similarity calculator. - /// - public sealed partial class ThresholdedIouSimilarity : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ThresholdedIouSimilarity()); - 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.RegionSimilarityCalculatorReflection.Descriptor.MessageTypes[4]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ThresholdedIouSimilarity() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ThresholdedIouSimilarity(ThresholdedIouSimilarity other) : this() { - iouThreshold_ = other.iouThreshold_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public ThresholdedIouSimilarity Clone() { - return new ThresholdedIouSimilarity(this); - } - - /// Field number for the "iou_threshold" field. - public const int IouThresholdFieldNumber = 1; - private float iouThreshold_; - /// - /// IOU threshold used for filtering scores. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float IouThreshold { - get { return iouThreshold_; } - set { - iouThreshold_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as ThresholdedIouSimilarity); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(ThresholdedIouSimilarity other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(IouThreshold, other.IouThreshold)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (IouThreshold != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(IouThreshold); - 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 (IouThreshold != 0F) { - output.WriteRawTag(13); - output.WriteFloat(IouThreshold); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (IouThreshold != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(ThresholdedIouSimilarity other) { - if (other == null) { - return; - } - if (other.IouThreshold != 0F) { - IouThreshold = other.IouThreshold; - } - _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: { - IouThreshold = input.ReadFloat(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/SquareBoxCoder.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/SquareBoxCoder.cs deleted file mode 100644 index a1f3d794..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/SquareBoxCoder.cs +++ /dev/null @@ -1,240 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/square_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/square_box_coder.proto - public static partial class SquareBoxCoderReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/square_box_coder.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static SquareBoxCoderReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "Ci5vYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9zcXVhcmVfYm94X2NvZGVyLnBy", - "b3RvEhdvYmplY3RfZGV0ZWN0aW9uLnByb3RvcyJICg5TcXVhcmVCb3hDb2Rl", - "chIPCgd5X3NjYWxlGAEgASgCEg8KB3hfc2NhbGUYAiABKAISFAoMbGVuZ3Ro", - "X3NjYWxlGAMgASgCYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder), global::Tensorflow.Models.ObjectDetection.Protos.SquareBoxCoder.Parser, new[]{ "YScale", "XScale", "LengthScale" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for SquareBoxCoder. See - /// box_coders/square_box_coder.py for details. - /// - public sealed partial class SquareBoxCoder : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SquareBoxCoder()); - 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.SquareBoxCoderReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SquareBoxCoder() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SquareBoxCoder(SquareBoxCoder other) : this() { - yScale_ = other.yScale_; - xScale_ = other.xScale_; - lengthScale_ = other.lengthScale_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SquareBoxCoder Clone() { - return new SquareBoxCoder(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 "length_scale" field. - public const int LengthScaleFieldNumber = 3; - private float lengthScale_; - /// - /// Scale factor for anchor encoded box length. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float LengthScale { - get { return lengthScale_; } - set { - lengthScale_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SquareBoxCoder); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SquareBoxCoder 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(LengthScale, other.LengthScale)) 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 (LengthScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(LengthScale); - 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 (LengthScale != 0F) { - output.WriteRawTag(29); - output.WriteFloat(LengthScale); - } - 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 (LengthScale != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SquareBoxCoder other) { - if (other == null) { - return; - } - if (other.YScale != 0F) { - YScale = other.YScale; - } - if (other.XScale != 0F) { - XScale = other.XScale; - } - if (other.LengthScale != 0F) { - LengthScale = other.LengthScale; - } - _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: { - LengthScale = input.ReadFloat(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Ssd.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Ssd.cs deleted file mode 100644 index 1a43ba6c..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Ssd.cs +++ /dev/null @@ -1,2028 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/ssd.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/ssd.proto - public static partial class SsdReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/ssd.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static SsdReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiFvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9zc2QucHJvdG8SF29iamVjdF9k", - "ZXRlY3Rpb24ucHJvdG9zGi5vYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9hbmNo", - "b3JfZ2VuZXJhdG9yLnByb3RvGidvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9i", - "b3hfY29kZXIucHJvdG8aK29iamVjdF9kZXRlY3Rpb24vcHJvdG9zL2JveF9w", - "cmVkaWN0b3IucHJvdG8aKW9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL2h5cGVy", - "cGFyYW1zLnByb3RvGitvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9pbWFnZV9y", - "ZXNpemVyLnByb3RvGiRvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9sb3NzZXMu", - "cHJvdG8aJW9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL21hdGNoZXIucHJvdG8a", - "LW9iamVjdF9kZXRlY3Rpb24vcHJvdG9zL3Bvc3RfcHJvY2Vzc2luZy5wcm90", - "bxo6b2JqZWN0X2RldGVjdGlvbi9wcm90b3MvcmVnaW9uX3NpbWlsYXJpdHlf", - "Y2FsY3VsYXRvci5wcm90byLDCgoDU3NkEhMKC251bV9jbGFzc2VzGAEgASgF", - "EjwKDWltYWdlX3Jlc2l6ZXIYAiABKAsyJS5vYmplY3RfZGV0ZWN0aW9uLnBy", - "b3Rvcy5JbWFnZVJlc2l6ZXISRwoRZmVhdHVyZV9leHRyYWN0b3IYAyABKAsy", - "LC5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5Tc2RGZWF0dXJlRXh0cmFjdG9y", - "EjQKCWJveF9jb2RlchgEIAEoCzIhLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9z", - "LkJveENvZGVyEjEKB21hdGNoZXIYBSABKAsyIC5vYmplY3RfZGV0ZWN0aW9u", - "LnByb3Rvcy5NYXRjaGVyElIKFXNpbWlsYXJpdHlfY2FsY3VsYXRvchgGIAEo", - "CzIzLm9iamVjdF9kZXRlY3Rpb24ucHJvdG9zLlJlZ2lvblNpbWlsYXJpdHlD", - "YWxjdWxhdG9yEiIKGmVuY29kZV9iYWNrZ3JvdW5kX2FzX3plcm9zGAwgASgI", - "Eh0KFW5lZ2F0aXZlX2NsYXNzX3dlaWdodBgNIAEoAhI8Cg1ib3hfcHJlZGlj", - "dG9yGAcgASgLMiUub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuQm94UHJlZGlj", - "dG9yEkIKEGFuY2hvcl9nZW5lcmF0b3IYCCABKAsyKC5vYmplY3RfZGV0ZWN0", - "aW9uLnByb3Rvcy5BbmNob3JHZW5lcmF0b3ISQAoPcG9zdF9wcm9jZXNzaW5n", - "GAkgASgLMicub2JqZWN0X2RldGVjdGlvbi5wcm90b3MuUG9zdFByb2Nlc3Np", - "bmcSJQodbm9ybWFsaXplX2xvc3NfYnlfbnVtX21hdGNoZXMYCiABKAgSJgoe", - "bm9ybWFsaXplX2xvY19sb3NzX2J5X2NvZGVzaXplGA4gASgIEisKBGxvc3MY", - "CyABKAsyHS5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5Mb3NzEhgKEGZyZWV6", - "ZV9iYXRjaG5vcm0YECABKAgSIAoYaW5wbGFjZV9iYXRjaG5vcm1fdXBkYXRl", - "GA8gASgIEhwKFGFkZF9iYWNrZ3JvdW5kX2NsYXNzGBUgASgIEiEKGWV4cGxp", - "Y2l0X2JhY2tncm91bmRfY2xhc3MYGCABKAgSIgoadXNlX2NvbmZpZGVuY2Vz", - "X2FzX3RhcmdldHMYFiABKAgSHwoXaW1wbGljaXRfZXhhbXBsZV93ZWlnaHQY", - "FyABKAISPwoQbWFza19oZWFkX2NvbmZpZxgZIAEoCzIlLm9iamVjdF9kZXRl", - "Y3Rpb24ucHJvdG9zLlNzZC5NYXNrSGVhZBrcAgoITWFza0hlYWQSEwoLbWFz", - "a19oZWlnaHQYASABKAUSEgoKbWFza193aWR0aBgCIAEoBRIgChhtYXNrc19h", - "cmVfY2xhc3NfYWdub3N0aWMYAyABKAgSIgoabWFza19wcmVkaWN0aW9uX2Nv", - "bnZfZGVwdGgYBCABKAUSJwofbWFza19wcmVkaWN0aW9uX251bV9jb252X2xh", - "eWVycxgFIAEoBRIkChxjb252b2x2ZV90aGVuX3Vwc2FtcGxlX21hc2tzGAYg", - "ASgIEhgKEG1hc2tfbG9zc193ZWlnaHQYByABKAISHQoVbWFza19sb3NzX3Nh", - "bXBsZV9zaXplGAggASgFEj4KEGNvbnZfaHlwZXJwYXJhbXMYCSABKAsyJC5v", - "YmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5IeXBlcnBhcmFtcxIZChFpbml0aWFs", - "X2Nyb3Bfc2l6ZRgKIAEoBSKaAwoTU3NkRmVhdHVyZUV4dHJhY3RvchIMCgR0", - "eXBlGAEgASgJEhgKEGRlcHRoX211bHRpcGxpZXIYAiABKAISEQoJbWluX2Rl", - "cHRoGAMgASgFEj4KEGNvbnZfaHlwZXJwYXJhbXMYBCABKAsyJC5vYmplY3Rf", - "ZGV0ZWN0aW9uLnByb3Rvcy5IeXBlcnBhcmFtcxIzCitvdmVycmlkZV9iYXNl", - "X2ZlYXR1cmVfZXh0cmFjdG9yX2h5cGVycGFyYW1zGAkgASgIEhcKD3BhZF90", - "b19tdWx0aXBsZRgFIAEoBRIcChR1c2VfZXhwbGljaXRfcGFkZGluZxgHIAEo", - "CBIVCg11c2VfZGVwdGh3aXNlGAggASgIEjwKA2ZwbhgKIAEoCzIvLm9iamVj", - "dF9kZXRlY3Rpb24ucHJvdG9zLkZlYXR1cmVQeXJhbWlkTmV0d29ya3MSLQol", - "cmVwbGFjZV9wcmVwcm9jZXNzb3Jfd2l0aF9wbGFjZWhvbGRlchgLIAEoCBIS", - "CgpudW1fbGF5ZXJzGAwgASgFSgQIBhAHIl4KFkZlYXR1cmVQeXJhbWlkTmV0", - "d29ya3MSEQoJbWluX2xldmVsGAEgASgFEhEKCW1heF9sZXZlbBgCIAEoBRIe", - "ChZhZGRpdGlvbmFsX2xheWVyX2RlcHRoGAMgASgFYgZwcm90bzM=")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.AnchorGeneratorReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.BoxCoderReflection.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.MatcherReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.PostProcessingReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculatorReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Ssd), global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Parser, new[]{ "NumClasses", "ImageResizer", "FeatureExtractor", "BoxCoder", "Matcher", "SimilarityCalculator", "EncodeBackgroundAsZeros", "NegativeClassWeight", "BoxPredictor", "AnchorGenerator", "PostProcessing", "NormalizeLossByNumMatches", "NormalizeLocLossByCodesize", "Loss", "FreezeBatchnorm", "InplaceBatchnormUpdate", "AddBackgroundClass", "ExplicitBackgroundClass", "UseConfidencesAsTargets", "ImplicitExampleWeight", "MaskHeadConfig" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Types.MaskHead), global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Types.MaskHead.Parser, new[]{ "MaskHeight", "MaskWidth", "MasksAreClassAgnostic", "MaskPredictionConvDepth", "MaskPredictionNumConvLayers", "ConvolveThenUpsampleMasks", "MaskLossWeight", "MaskLossSampleSize", "ConvHyperparams", "InitialCropSize" }, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SsdFeatureExtractor), global::Tensorflow.Models.ObjectDetection.Protos.SsdFeatureExtractor.Parser, new[]{ "Type", "DepthMultiplier", "MinDepth", "ConvHyperparams", "OverrideBaseFeatureExtractorHyperparams", "PadToMultiple", "UseExplicitPadding", "UseDepthwise", "Fpn", "ReplacePreprocessorWithPlaceholder", "NumLayers" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.FeaturePyramidNetworks), global::Tensorflow.Models.ObjectDetection.Protos.FeaturePyramidNetworks.Parser, new[]{ "MinLevel", "MaxLevel", "AdditionalLayerDepth" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration for Single Shot Detection (SSD) models. - /// Next id: 26 - /// - public sealed partial class Ssd : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Ssd()); - 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.SsdReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Ssd() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Ssd(Ssd other) : this() { - numClasses_ = other.numClasses_; - imageResizer_ = other.imageResizer_ != null ? other.imageResizer_.Clone() : null; - featureExtractor_ = other.featureExtractor_ != null ? other.featureExtractor_.Clone() : null; - boxCoder_ = other.boxCoder_ != null ? other.boxCoder_.Clone() : null; - matcher_ = other.matcher_ != null ? other.matcher_.Clone() : null; - similarityCalculator_ = other.similarityCalculator_ != null ? other.similarityCalculator_.Clone() : null; - encodeBackgroundAsZeros_ = other.encodeBackgroundAsZeros_; - negativeClassWeight_ = other.negativeClassWeight_; - boxPredictor_ = other.boxPredictor_ != null ? other.boxPredictor_.Clone() : null; - anchorGenerator_ = other.anchorGenerator_ != null ? other.anchorGenerator_.Clone() : null; - postProcessing_ = other.postProcessing_ != null ? other.postProcessing_.Clone() : null; - normalizeLossByNumMatches_ = other.normalizeLossByNumMatches_; - normalizeLocLossByCodesize_ = other.normalizeLocLossByCodesize_; - loss_ = other.loss_ != null ? other.loss_.Clone() : null; - freezeBatchnorm_ = other.freezeBatchnorm_; - inplaceBatchnormUpdate_ = other.inplaceBatchnormUpdate_; - addBackgroundClass_ = other.addBackgroundClass_; - explicitBackgroundClass_ = other.explicitBackgroundClass_; - useConfidencesAsTargets_ = other.useConfidencesAsTargets_; - implicitExampleWeight_ = other.implicitExampleWeight_; - maskHeadConfig_ = other.maskHeadConfig_ != null ? other.maskHeadConfig_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Ssd Clone() { - return new Ssd(this); - } - - /// Field number for the "num_classes" field. - public const int NumClassesFieldNumber = 1; - 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 = 2; - 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 = 3; - private global::Tensorflow.Models.ObjectDetection.Protos.SsdFeatureExtractor featureExtractor_; - /// - /// Feature extractor config. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.SsdFeatureExtractor FeatureExtractor { - get { return featureExtractor_; } - set { - featureExtractor_ = value; - } - } - - /// Field number for the "box_coder" field. - public const int BoxCoderFieldNumber = 4; - private global::Tensorflow.Models.ObjectDetection.Protos.BoxCoder boxCoder_; - /// - /// Box coder to encode the boxes. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.BoxCoder BoxCoder { - get { return boxCoder_; } - set { - boxCoder_ = value; - } - } - - /// Field number for the "matcher" field. - public const int MatcherFieldNumber = 5; - private global::Tensorflow.Models.ObjectDetection.Protos.Matcher matcher_; - /// - /// Matcher to match groundtruth with anchors. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.Matcher Matcher { - get { return matcher_; } - set { - matcher_ = value; - } - } - - /// Field number for the "similarity_calculator" field. - public const int SimilarityCalculatorFieldNumber = 6; - private global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculator similarityCalculator_; - /// - /// Region similarity calculator to compute similarity of boxes. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculator SimilarityCalculator { - get { return similarityCalculator_; } - set { - similarityCalculator_ = value; - } - } - - /// Field number for the "encode_background_as_zeros" field. - public const int EncodeBackgroundAsZerosFieldNumber = 12; - private bool encodeBackgroundAsZeros_; - /// - /// Whether background targets are to be encoded as an all - /// zeros vector or a one-hot vector (where background is the 0th class). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool EncodeBackgroundAsZeros { - get { return encodeBackgroundAsZeros_; } - set { - encodeBackgroundAsZeros_ = value; - } - } - - /// Field number for the "negative_class_weight" field. - public const int NegativeClassWeightFieldNumber = 13; - private float negativeClassWeight_; - /// - /// classification weight to be associated to negative - /// anchors (default: 1.0). The weight must be in [0., 1.]. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float NegativeClassWeight { - get { return negativeClassWeight_; } - set { - negativeClassWeight_ = value; - } - } - - /// Field number for the "box_predictor" field. - public const int BoxPredictorFieldNumber = 7; - private global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor boxPredictor_; - /// - /// Box predictor to attach to the features. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor BoxPredictor { - get { return boxPredictor_; } - set { - boxPredictor_ = value; - } - } - - /// Field number for the "anchor_generator" field. - public const int AnchorGeneratorFieldNumber = 8; - private global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator anchorGenerator_; - /// - /// Anchor generator to compute anchors. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator AnchorGenerator { - get { return anchorGenerator_; } - set { - anchorGenerator_ = value; - } - } - - /// Field number for the "post_processing" field. - public const int PostProcessingFieldNumber = 9; - private global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing postProcessing_; - /// - /// Post processing to apply on the predictions. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing PostProcessing { - get { return postProcessing_; } - set { - postProcessing_ = value; - } - } - - /// Field number for the "normalize_loss_by_num_matches" field. - public const int NormalizeLossByNumMatchesFieldNumber = 10; - private bool normalizeLossByNumMatches_; - /// - /// Whether to normalize the loss by number of groundtruth boxes that match to - /// the anchors. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool NormalizeLossByNumMatches { - get { return normalizeLossByNumMatches_; } - set { - normalizeLossByNumMatches_ = value; - } - } - - /// Field number for the "normalize_loc_loss_by_codesize" field. - public const int NormalizeLocLossByCodesizeFieldNumber = 14; - private bool normalizeLocLossByCodesize_; - /// - /// Whether to normalize the localization loss by the code size of the box - /// encodings. This is applied along with other normalization factors. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool NormalizeLocLossByCodesize { - get { return normalizeLocLossByCodesize_; } - set { - normalizeLocLossByCodesize_ = value; - } - } - - /// Field number for the "loss" field. - public const int LossFieldNumber = 11; - private global::Tensorflow.Models.ObjectDetection.Protos.Loss loss_; - /// - /// Loss configuration for training. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.Loss Loss { - get { return loss_; } - set { - loss_ = value; - } - } - - /// Field number for the "freeze_batchnorm" field. - public const int FreezeBatchnormFieldNumber = 16; - private bool freezeBatchnorm_; - /// - /// Whether to update batch norm parameters during training or not. - /// When training with a relative small batch size (e.g. 1), it is - /// desirable to disable batch norm update and use pretrained batch norm - /// params. - /// - /// Note: Some feature extractors are used with canned arg_scopes - /// (e.g resnet arg scopes). In these cases training behavior of batch norm - /// variables may depend on both values of `batch_norm_trainable` and - /// `is_training`. - /// - /// When canned arg_scopes are used with feature extractors `conv_hyperparams` - /// will apply only to the additional layers that are added and are outside the - /// canned arg_scope. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool FreezeBatchnorm { - get { return freezeBatchnorm_; } - set { - freezeBatchnorm_ = value; - } - } - - /// Field number for the "inplace_batchnorm_update" field. - public const int InplaceBatchnormUpdateFieldNumber = 15; - 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 "add_background_class" field. - public const int AddBackgroundClassFieldNumber = 21; - private bool addBackgroundClass_; - /// - /// Whether to add an implicit background class to one-hot encodings of - /// groundtruth labels. Set to false if training a single - /// class model or using an explicit background class. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AddBackgroundClass { - get { return addBackgroundClass_; } - set { - addBackgroundClass_ = value; - } - } - - /// Field number for the "explicit_background_class" field. - public const int ExplicitBackgroundClassFieldNumber = 24; - private bool explicitBackgroundClass_; - /// - /// Whether to use an explicit background class. Set to true if using - /// groundtruth labels with an explicit background class, as in multiclass - /// scores. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ExplicitBackgroundClass { - get { return explicitBackgroundClass_; } - set { - explicitBackgroundClass_ = value; - } - } - - /// Field number for the "use_confidences_as_targets" field. - public const int UseConfidencesAsTargetsFieldNumber = 22; - private bool useConfidencesAsTargets_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseConfidencesAsTargets { - get { return useConfidencesAsTargets_; } - set { - useConfidencesAsTargets_ = value; - } - } - - /// Field number for the "implicit_example_weight" field. - public const int ImplicitExampleWeightFieldNumber = 23; - private float implicitExampleWeight_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float ImplicitExampleWeight { - get { return implicitExampleWeight_; } - set { - implicitExampleWeight_ = value; - } - } - - /// Field number for the "mask_head_config" field. - public const int MaskHeadConfigFieldNumber = 25; - private global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Types.MaskHead maskHeadConfig_; - /// - /// Configs for mask head. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Types.MaskHead MaskHeadConfig { - get { return maskHeadConfig_; } - set { - maskHeadConfig_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Ssd); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Ssd other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - 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(BoxCoder, other.BoxCoder)) return false; - if (!object.Equals(Matcher, other.Matcher)) return false; - if (!object.Equals(SimilarityCalculator, other.SimilarityCalculator)) return false; - if (EncodeBackgroundAsZeros != other.EncodeBackgroundAsZeros) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(NegativeClassWeight, other.NegativeClassWeight)) return false; - if (!object.Equals(BoxPredictor, other.BoxPredictor)) return false; - if (!object.Equals(AnchorGenerator, other.AnchorGenerator)) return false; - if (!object.Equals(PostProcessing, other.PostProcessing)) return false; - if (NormalizeLossByNumMatches != other.NormalizeLossByNumMatches) return false; - if (NormalizeLocLossByCodesize != other.NormalizeLocLossByCodesize) return false; - if (!object.Equals(Loss, other.Loss)) return false; - if (FreezeBatchnorm != other.FreezeBatchnorm) return false; - if (InplaceBatchnormUpdate != other.InplaceBatchnormUpdate) return false; - if (AddBackgroundClass != other.AddBackgroundClass) return false; - if (ExplicitBackgroundClass != other.ExplicitBackgroundClass) return false; - if (UseConfidencesAsTargets != other.UseConfidencesAsTargets) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(ImplicitExampleWeight, other.ImplicitExampleWeight)) return false; - if (!object.Equals(MaskHeadConfig, other.MaskHeadConfig)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (NumClasses != 0) hash ^= NumClasses.GetHashCode(); - if (imageResizer_ != null) hash ^= ImageResizer.GetHashCode(); - if (featureExtractor_ != null) hash ^= FeatureExtractor.GetHashCode(); - if (boxCoder_ != null) hash ^= BoxCoder.GetHashCode(); - if (matcher_ != null) hash ^= Matcher.GetHashCode(); - if (similarityCalculator_ != null) hash ^= SimilarityCalculator.GetHashCode(); - if (EncodeBackgroundAsZeros != false) hash ^= EncodeBackgroundAsZeros.GetHashCode(); - if (NegativeClassWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(NegativeClassWeight); - if (boxPredictor_ != null) hash ^= BoxPredictor.GetHashCode(); - if (anchorGenerator_ != null) hash ^= AnchorGenerator.GetHashCode(); - if (postProcessing_ != null) hash ^= PostProcessing.GetHashCode(); - if (NormalizeLossByNumMatches != false) hash ^= NormalizeLossByNumMatches.GetHashCode(); - if (NormalizeLocLossByCodesize != false) hash ^= NormalizeLocLossByCodesize.GetHashCode(); - if (loss_ != null) hash ^= Loss.GetHashCode(); - if (FreezeBatchnorm != false) hash ^= FreezeBatchnorm.GetHashCode(); - if (InplaceBatchnormUpdate != false) hash ^= InplaceBatchnormUpdate.GetHashCode(); - if (AddBackgroundClass != false) hash ^= AddBackgroundClass.GetHashCode(); - if (ExplicitBackgroundClass != false) hash ^= ExplicitBackgroundClass.GetHashCode(); - if (UseConfidencesAsTargets != false) hash ^= UseConfidencesAsTargets.GetHashCode(); - if (ImplicitExampleWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(ImplicitExampleWeight); - if (maskHeadConfig_ != null) hash ^= MaskHeadConfig.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 (NumClasses != 0) { - output.WriteRawTag(8); - output.WriteInt32(NumClasses); - } - if (imageResizer_ != null) { - output.WriteRawTag(18); - output.WriteMessage(ImageResizer); - } - if (featureExtractor_ != null) { - output.WriteRawTag(26); - output.WriteMessage(FeatureExtractor); - } - if (boxCoder_ != null) { - output.WriteRawTag(34); - output.WriteMessage(BoxCoder); - } - if (matcher_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Matcher); - } - if (similarityCalculator_ != null) { - output.WriteRawTag(50); - output.WriteMessage(SimilarityCalculator); - } - if (boxPredictor_ != null) { - output.WriteRawTag(58); - output.WriteMessage(BoxPredictor); - } - if (anchorGenerator_ != null) { - output.WriteRawTag(66); - output.WriteMessage(AnchorGenerator); - } - if (postProcessing_ != null) { - output.WriteRawTag(74); - output.WriteMessage(PostProcessing); - } - if (NormalizeLossByNumMatches != false) { - output.WriteRawTag(80); - output.WriteBool(NormalizeLossByNumMatches); - } - if (loss_ != null) { - output.WriteRawTag(90); - output.WriteMessage(Loss); - } - if (EncodeBackgroundAsZeros != false) { - output.WriteRawTag(96); - output.WriteBool(EncodeBackgroundAsZeros); - } - if (NegativeClassWeight != 0F) { - output.WriteRawTag(109); - output.WriteFloat(NegativeClassWeight); - } - if (NormalizeLocLossByCodesize != false) { - output.WriteRawTag(112); - output.WriteBool(NormalizeLocLossByCodesize); - } - if (InplaceBatchnormUpdate != false) { - output.WriteRawTag(120); - output.WriteBool(InplaceBatchnormUpdate); - } - if (FreezeBatchnorm != false) { - output.WriteRawTag(128, 1); - output.WriteBool(FreezeBatchnorm); - } - if (AddBackgroundClass != false) { - output.WriteRawTag(168, 1); - output.WriteBool(AddBackgroundClass); - } - if (UseConfidencesAsTargets != false) { - output.WriteRawTag(176, 1); - output.WriteBool(UseConfidencesAsTargets); - } - if (ImplicitExampleWeight != 0F) { - output.WriteRawTag(189, 1); - output.WriteFloat(ImplicitExampleWeight); - } - if (ExplicitBackgroundClass != false) { - output.WriteRawTag(192, 1); - output.WriteBool(ExplicitBackgroundClass); - } - if (maskHeadConfig_ != null) { - output.WriteRawTag(202, 1); - output.WriteMessage(MaskHeadConfig); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - 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 (boxCoder_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BoxCoder); - } - if (matcher_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Matcher); - } - if (similarityCalculator_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(SimilarityCalculator); - } - if (EncodeBackgroundAsZeros != false) { - size += 1 + 1; - } - if (NegativeClassWeight != 0F) { - size += 1 + 4; - } - if (boxPredictor_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(BoxPredictor); - } - if (anchorGenerator_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(AnchorGenerator); - } - if (postProcessing_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(PostProcessing); - } - if (NormalizeLossByNumMatches != false) { - size += 1 + 1; - } - if (NormalizeLocLossByCodesize != false) { - size += 1 + 1; - } - if (loss_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Loss); - } - if (FreezeBatchnorm != false) { - size += 2 + 1; - } - if (InplaceBatchnormUpdate != false) { - size += 1 + 1; - } - if (AddBackgroundClass != false) { - size += 2 + 1; - } - if (ExplicitBackgroundClass != false) { - size += 2 + 1; - } - if (UseConfidencesAsTargets != false) { - size += 2 + 1; - } - if (ImplicitExampleWeight != 0F) { - size += 2 + 4; - } - if (maskHeadConfig_ != null) { - size += 2 + pb::CodedOutputStream.ComputeMessageSize(MaskHeadConfig); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Ssd other) { - if (other == null) { - return; - } - 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.SsdFeatureExtractor(); - } - FeatureExtractor.MergeFrom(other.FeatureExtractor); - } - if (other.boxCoder_ != null) { - if (boxCoder_ == null) { - boxCoder_ = new global::Tensorflow.Models.ObjectDetection.Protos.BoxCoder(); - } - BoxCoder.MergeFrom(other.BoxCoder); - } - if (other.matcher_ != null) { - if (matcher_ == null) { - matcher_ = new global::Tensorflow.Models.ObjectDetection.Protos.Matcher(); - } - Matcher.MergeFrom(other.Matcher); - } - if (other.similarityCalculator_ != null) { - if (similarityCalculator_ == null) { - similarityCalculator_ = new global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculator(); - } - SimilarityCalculator.MergeFrom(other.SimilarityCalculator); - } - if (other.EncodeBackgroundAsZeros != false) { - EncodeBackgroundAsZeros = other.EncodeBackgroundAsZeros; - } - if (other.NegativeClassWeight != 0F) { - NegativeClassWeight = other.NegativeClassWeight; - } - if (other.boxPredictor_ != null) { - if (boxPredictor_ == null) { - boxPredictor_ = new global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor(); - } - BoxPredictor.MergeFrom(other.BoxPredictor); - } - if (other.anchorGenerator_ != null) { - if (anchorGenerator_ == null) { - anchorGenerator_ = new global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator(); - } - AnchorGenerator.MergeFrom(other.AnchorGenerator); - } - if (other.postProcessing_ != null) { - if (postProcessing_ == null) { - postProcessing_ = new global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing(); - } - PostProcessing.MergeFrom(other.PostProcessing); - } - if (other.NormalizeLossByNumMatches != false) { - NormalizeLossByNumMatches = other.NormalizeLossByNumMatches; - } - if (other.NormalizeLocLossByCodesize != false) { - NormalizeLocLossByCodesize = other.NormalizeLocLossByCodesize; - } - if (other.loss_ != null) { - if (loss_ == null) { - loss_ = new global::Tensorflow.Models.ObjectDetection.Protos.Loss(); - } - Loss.MergeFrom(other.Loss); - } - if (other.FreezeBatchnorm != false) { - FreezeBatchnorm = other.FreezeBatchnorm; - } - if (other.InplaceBatchnormUpdate != false) { - InplaceBatchnormUpdate = other.InplaceBatchnormUpdate; - } - if (other.AddBackgroundClass != false) { - AddBackgroundClass = other.AddBackgroundClass; - } - if (other.ExplicitBackgroundClass != false) { - ExplicitBackgroundClass = other.ExplicitBackgroundClass; - } - if (other.UseConfidencesAsTargets != false) { - UseConfidencesAsTargets = other.UseConfidencesAsTargets; - } - if (other.ImplicitExampleWeight != 0F) { - ImplicitExampleWeight = other.ImplicitExampleWeight; - } - if (other.maskHeadConfig_ != null) { - if (maskHeadConfig_ == null) { - maskHeadConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Types.MaskHead(); - } - MaskHeadConfig.MergeFrom(other.MaskHeadConfig); - } - _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: { - NumClasses = input.ReadInt32(); - break; - } - case 18: { - if (imageResizer_ == null) { - imageResizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.ImageResizer(); - } - input.ReadMessage(imageResizer_); - break; - } - case 26: { - if (featureExtractor_ == null) { - featureExtractor_ = new global::Tensorflow.Models.ObjectDetection.Protos.SsdFeatureExtractor(); - } - input.ReadMessage(featureExtractor_); - break; - } - case 34: { - if (boxCoder_ == null) { - boxCoder_ = new global::Tensorflow.Models.ObjectDetection.Protos.BoxCoder(); - } - input.ReadMessage(boxCoder_); - break; - } - case 42: { - if (matcher_ == null) { - matcher_ = new global::Tensorflow.Models.ObjectDetection.Protos.Matcher(); - } - input.ReadMessage(matcher_); - break; - } - case 50: { - if (similarityCalculator_ == null) { - similarityCalculator_ = new global::Tensorflow.Models.ObjectDetection.Protos.RegionSimilarityCalculator(); - } - input.ReadMessage(similarityCalculator_); - break; - } - case 58: { - if (boxPredictor_ == null) { - boxPredictor_ = new global::Tensorflow.Models.ObjectDetection.Protos.BoxPredictor(); - } - input.ReadMessage(boxPredictor_); - break; - } - case 66: { - if (anchorGenerator_ == null) { - anchorGenerator_ = new global::Tensorflow.Models.ObjectDetection.Protos.AnchorGenerator(); - } - input.ReadMessage(anchorGenerator_); - break; - } - case 74: { - if (postProcessing_ == null) { - postProcessing_ = new global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing(); - } - input.ReadMessage(postProcessing_); - break; - } - case 80: { - NormalizeLossByNumMatches = input.ReadBool(); - break; - } - case 90: { - if (loss_ == null) { - loss_ = new global::Tensorflow.Models.ObjectDetection.Protos.Loss(); - } - input.ReadMessage(loss_); - break; - } - case 96: { - EncodeBackgroundAsZeros = input.ReadBool(); - break; - } - case 109: { - NegativeClassWeight = input.ReadFloat(); - break; - } - case 112: { - NormalizeLocLossByCodesize = input.ReadBool(); - break; - } - case 120: { - InplaceBatchnormUpdate = input.ReadBool(); - break; - } - case 128: { - FreezeBatchnorm = input.ReadBool(); - break; - } - case 168: { - AddBackgroundClass = input.ReadBool(); - break; - } - case 176: { - UseConfidencesAsTargets = input.ReadBool(); - break; - } - case 189: { - ImplicitExampleWeight = input.ReadFloat(); - break; - } - case 192: { - ExplicitBackgroundClass = input.ReadBool(); - break; - } - case 202: { - if (maskHeadConfig_ == null) { - maskHeadConfig_ = new global::Tensorflow.Models.ObjectDetection.Protos.Ssd.Types.MaskHead(); - } - input.ReadMessage(maskHeadConfig_); - break; - } - } - } - } - - #region Nested types - /// Container for nested types declared in the Ssd message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static partial class Types { - /// - /// Configuration proto for MaskHead. - /// Next id: 11 - /// - public sealed partial class MaskHead : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MaskHead()); - 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.Ssd.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MaskHead() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MaskHead(MaskHead other) : this() { - maskHeight_ = other.maskHeight_; - maskWidth_ = other.maskWidth_; - masksAreClassAgnostic_ = other.masksAreClassAgnostic_; - maskPredictionConvDepth_ = other.maskPredictionConvDepth_; - maskPredictionNumConvLayers_ = other.maskPredictionNumConvLayers_; - convolveThenUpsampleMasks_ = other.convolveThenUpsampleMasks_; - maskLossWeight_ = other.maskLossWeight_; - maskLossSampleSize_ = other.maskLossSampleSize_; - convHyperparams_ = other.convHyperparams_ != null ? other.convHyperparams_.Clone() : null; - initialCropSize_ = other.initialCropSize_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public MaskHead Clone() { - return new MaskHead(this); - } - - /// Field number for the "mask_height" field. - public const int MaskHeightFieldNumber = 1; - private int maskHeight_; - /// - /// The height and the width of the predicted mask. Only used when - /// predict_instance_masks is true. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaskHeight { - get { return maskHeight_; } - set { - maskHeight_ = value; - } - } - - /// Field number for the "mask_width" field. - public const int MaskWidthFieldNumber = 2; - private int maskWidth_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaskWidth { - get { return maskWidth_; } - set { - maskWidth_ = value; - } - } - - /// Field number for the "masks_are_class_agnostic" field. - public const int MasksAreClassAgnosticFieldNumber = 3; - private bool masksAreClassAgnostic_; - /// - /// Whether to predict class agnostic masks. Only used when - /// predict_instance_masks is true. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool MasksAreClassAgnostic { - get { return masksAreClassAgnostic_; } - set { - masksAreClassAgnostic_ = value; - } - } - - /// Field number for the "mask_prediction_conv_depth" field. - public const int MaskPredictionConvDepthFieldNumber = 4; - 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 "mask_prediction_num_conv_layers" field. - public const int MaskPredictionNumConvLayersFieldNumber = 5; - 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 "convolve_then_upsample_masks" field. - public const int ConvolveThenUpsampleMasksFieldNumber = 6; - 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; - } - } - - /// Field number for the "mask_loss_weight" field. - public const int MaskLossWeightFieldNumber = 7; - private float maskLossWeight_; - /// - /// Mask loss weight. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaskLossWeight { - get { return maskLossWeight_; } - set { - maskLossWeight_ = value; - } - } - - /// Field number for the "mask_loss_sample_size" field. - public const int MaskLossSampleSizeFieldNumber = 8; - private int maskLossSampleSize_; - /// - /// Number of boxes to be generated at training time for computing mask loss. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaskLossSampleSize { - get { return maskLossSampleSize_; } - set { - maskLossSampleSize_ = value; - } - } - - /// Field number for the "conv_hyperparams" field. - public const int ConvHyperparamsFieldNumber = 9; - 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 "initial_crop_size" field. - public const int InitialCropSizeFieldNumber = 10; - private int initialCropSize_; - /// - /// Output size (width and height are set to be the same) of the initial - /// bilinear interpolation based cropping during ROI pooling. Only used when - /// we have second stage prediction head enabled (e.g. mask head). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int InitialCropSize { - get { return initialCropSize_; } - set { - initialCropSize_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as MaskHead); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(MaskHead other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MaskHeight != other.MaskHeight) return false; - if (MaskWidth != other.MaskWidth) return false; - if (MasksAreClassAgnostic != other.MasksAreClassAgnostic) return false; - if (MaskPredictionConvDepth != other.MaskPredictionConvDepth) return false; - if (MaskPredictionNumConvLayers != other.MaskPredictionNumConvLayers) return false; - if (ConvolveThenUpsampleMasks != other.ConvolveThenUpsampleMasks) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaskLossWeight, other.MaskLossWeight)) return false; - if (MaskLossSampleSize != other.MaskLossSampleSize) return false; - if (!object.Equals(ConvHyperparams, other.ConvHyperparams)) return false; - if (InitialCropSize != other.InitialCropSize) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MaskHeight != 0) hash ^= MaskHeight.GetHashCode(); - if (MaskWidth != 0) hash ^= MaskWidth.GetHashCode(); - if (MasksAreClassAgnostic != false) hash ^= MasksAreClassAgnostic.GetHashCode(); - if (MaskPredictionConvDepth != 0) hash ^= MaskPredictionConvDepth.GetHashCode(); - if (MaskPredictionNumConvLayers != 0) hash ^= MaskPredictionNumConvLayers.GetHashCode(); - if (ConvolveThenUpsampleMasks != false) hash ^= ConvolveThenUpsampleMasks.GetHashCode(); - if (MaskLossWeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaskLossWeight); - if (MaskLossSampleSize != 0) hash ^= MaskLossSampleSize.GetHashCode(); - if (convHyperparams_ != null) hash ^= ConvHyperparams.GetHashCode(); - if (InitialCropSize != 0) hash ^= InitialCropSize.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 (MaskHeight != 0) { - output.WriteRawTag(8); - output.WriteInt32(MaskHeight); - } - if (MaskWidth != 0) { - output.WriteRawTag(16); - output.WriteInt32(MaskWidth); - } - if (MasksAreClassAgnostic != false) { - output.WriteRawTag(24); - output.WriteBool(MasksAreClassAgnostic); - } - if (MaskPredictionConvDepth != 0) { - output.WriteRawTag(32); - output.WriteInt32(MaskPredictionConvDepth); - } - if (MaskPredictionNumConvLayers != 0) { - output.WriteRawTag(40); - output.WriteInt32(MaskPredictionNumConvLayers); - } - if (ConvolveThenUpsampleMasks != false) { - output.WriteRawTag(48); - output.WriteBool(ConvolveThenUpsampleMasks); - } - if (MaskLossWeight != 0F) { - output.WriteRawTag(61); - output.WriteFloat(MaskLossWeight); - } - if (MaskLossSampleSize != 0) { - output.WriteRawTag(64); - output.WriteInt32(MaskLossSampleSize); - } - if (convHyperparams_ != null) { - output.WriteRawTag(74); - output.WriteMessage(ConvHyperparams); - } - if (InitialCropSize != 0) { - output.WriteRawTag(80); - output.WriteInt32(InitialCropSize); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MaskHeight != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskHeight); - } - if (MaskWidth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskWidth); - } - if (MasksAreClassAgnostic != false) { - size += 1 + 1; - } - if (MaskPredictionConvDepth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskPredictionConvDepth); - } - if (MaskPredictionNumConvLayers != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskPredictionNumConvLayers); - } - if (ConvolveThenUpsampleMasks != false) { - size += 1 + 1; - } - if (MaskLossWeight != 0F) { - size += 1 + 4; - } - if (MaskLossSampleSize != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaskLossSampleSize); - } - if (convHyperparams_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvHyperparams); - } - if (InitialCropSize != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(InitialCropSize); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(MaskHead other) { - if (other == null) { - return; - } - if (other.MaskHeight != 0) { - MaskHeight = other.MaskHeight; - } - if (other.MaskWidth != 0) { - MaskWidth = other.MaskWidth; - } - if (other.MasksAreClassAgnostic != false) { - MasksAreClassAgnostic = other.MasksAreClassAgnostic; - } - if (other.MaskPredictionConvDepth != 0) { - MaskPredictionConvDepth = other.MaskPredictionConvDepth; - } - if (other.MaskPredictionNumConvLayers != 0) { - MaskPredictionNumConvLayers = other.MaskPredictionNumConvLayers; - } - if (other.ConvolveThenUpsampleMasks != false) { - ConvolveThenUpsampleMasks = other.ConvolveThenUpsampleMasks; - } - if (other.MaskLossWeight != 0F) { - MaskLossWeight = other.MaskLossWeight; - } - if (other.MaskLossSampleSize != 0) { - MaskLossSampleSize = other.MaskLossSampleSize; - } - if (other.convHyperparams_ != null) { - if (convHyperparams_ == null) { - convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams(); - } - ConvHyperparams.MergeFrom(other.ConvHyperparams); - } - if (other.InitialCropSize != 0) { - InitialCropSize = other.InitialCropSize; - } - _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: { - MaskHeight = input.ReadInt32(); - break; - } - case 16: { - MaskWidth = input.ReadInt32(); - break; - } - case 24: { - MasksAreClassAgnostic = input.ReadBool(); - break; - } - case 32: { - MaskPredictionConvDepth = input.ReadInt32(); - break; - } - case 40: { - MaskPredictionNumConvLayers = input.ReadInt32(); - break; - } - case 48: { - ConvolveThenUpsampleMasks = input.ReadBool(); - break; - } - case 61: { - MaskLossWeight = input.ReadFloat(); - break; - } - case 64: { - MaskLossSampleSize = input.ReadInt32(); - break; - } - case 74: { - if (convHyperparams_ == null) { - convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams(); - } - input.ReadMessage(convHyperparams_); - break; - } - case 80: { - InitialCropSize = input.ReadInt32(); - break; - } - } - } - } - - } - - } - #endregion - - } - - public sealed partial class SsdFeatureExtractor : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SsdFeatureExtractor()); - 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.SsdReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SsdFeatureExtractor() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SsdFeatureExtractor(SsdFeatureExtractor other) : this() { - type_ = other.type_; - depthMultiplier_ = other.depthMultiplier_; - minDepth_ = other.minDepth_; - convHyperparams_ = other.convHyperparams_ != null ? other.convHyperparams_.Clone() : null; - overrideBaseFeatureExtractorHyperparams_ = other.overrideBaseFeatureExtractorHyperparams_; - padToMultiple_ = other.padToMultiple_; - useExplicitPadding_ = other.useExplicitPadding_; - useDepthwise_ = other.useDepthwise_; - fpn_ = other.fpn_ != null ? other.fpn_.Clone() : null; - replacePreprocessorWithPlaceholder_ = other.replacePreprocessorWithPlaceholder_; - numLayers_ = other.numLayers_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SsdFeatureExtractor Clone() { - return new SsdFeatureExtractor(this); - } - - /// Field number for the "type" field. - public const int TypeFieldNumber = 1; - private string type_ = ""; - /// - /// Type of ssd feature extractor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Type { - get { return type_; } - set { - type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "depth_multiplier" field. - public const int DepthMultiplierFieldNumber = 2; - private float depthMultiplier_; - /// - /// The factor to alter the depth of the channels in the feature extractor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float DepthMultiplier { - get { return depthMultiplier_; } - set { - depthMultiplier_ = value; - } - } - - /// Field number for the "min_depth" field. - public const int MinDepthFieldNumber = 3; - private int minDepth_; - /// - /// Minimum number of the channels in the feature extractor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinDepth { - get { return minDepth_; } - set { - minDepth_ = value; - } - } - - /// Field number for the "conv_hyperparams" field. - public const int ConvHyperparamsFieldNumber = 4; - private global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams convHyperparams_; - /// - /// Hyperparameters that affect the layers of feature extractor added on top - /// of the base feature extractor. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams ConvHyperparams { - get { return convHyperparams_; } - set { - convHyperparams_ = value; - } - } - - /// Field number for the "override_base_feature_extractor_hyperparams" field. - public const int OverrideBaseFeatureExtractorHyperparamsFieldNumber = 9; - private bool overrideBaseFeatureExtractorHyperparams_; - /// - /// Normally, SSD feature extractors are constructed by reusing an existing - /// base feature extractor (that has its own hyperparams) and adding new layers - /// on top of it. `conv_hyperparams` above normally applies only to the new - /// layers while base feature extractor uses its own default hyperparams. If - /// this value is set to true, the base feature extractor's hyperparams will be - /// overridden with the `conv_hyperparams`. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool OverrideBaseFeatureExtractorHyperparams { - get { return overrideBaseFeatureExtractorHyperparams_; } - set { - overrideBaseFeatureExtractorHyperparams_ = value; - } - } - - /// Field number for the "pad_to_multiple" field. - public const int PadToMultipleFieldNumber = 5; - private int padToMultiple_; - /// - /// The nearest multiple to zero-pad the input height and width dimensions to. - /// For example, if pad_to_multiple = 2, input dimensions are zero-padded - /// until the resulting dimensions are even. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int PadToMultiple { - get { return padToMultiple_; } - set { - padToMultiple_ = value; - } - } - - /// Field number for the "use_explicit_padding" field. - public const int UseExplicitPaddingFieldNumber = 7; - private bool useExplicitPadding_; - /// - /// Whether to use explicit padding when extracting SSD multiresolution - /// features. This will also apply to the base feature extractor if a MobileNet - /// architecture is used. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseExplicitPadding { - get { return useExplicitPadding_; } - set { - useExplicitPadding_ = value; - } - } - - /// Field number for the "use_depthwise" field. - public const int UseDepthwiseFieldNumber = 8; - private bool useDepthwise_; - /// - /// Whether to use depthwise separable convolutions for to extract additional - /// feature maps added by SSD. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseDepthwise { - get { return useDepthwise_; } - set { - useDepthwise_ = value; - } - } - - /// Field number for the "fpn" field. - public const int FpnFieldNumber = 10; - private global::Tensorflow.Models.ObjectDetection.Protos.FeaturePyramidNetworks fpn_; - /// - /// Feature Pyramid Networks config. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.FeaturePyramidNetworks Fpn { - get { return fpn_; } - set { - fpn_ = value; - } - } - - /// Field number for the "replace_preprocessor_with_placeholder" field. - public const int ReplacePreprocessorWithPlaceholderFieldNumber = 11; - private bool replacePreprocessorWithPlaceholder_; - /// - /// If true, replace preprocess function of feature extractor with a - /// placeholder. This should only be used if all the image preprocessing steps - /// happen outside the graph. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ReplacePreprocessorWithPlaceholder { - get { return replacePreprocessorWithPlaceholder_; } - set { - replacePreprocessorWithPlaceholder_ = value; - } - } - - /// Field number for the "num_layers" field. - public const int NumLayersFieldNumber = 12; - private int numLayers_; - /// - /// The number of SSD layers. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NumLayers { - get { return numLayers_; } - set { - numLayers_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SsdFeatureExtractor); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SsdFeatureExtractor other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Type != other.Type) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(DepthMultiplier, other.DepthMultiplier)) return false; - if (MinDepth != other.MinDepth) return false; - if (!object.Equals(ConvHyperparams, other.ConvHyperparams)) return false; - if (OverrideBaseFeatureExtractorHyperparams != other.OverrideBaseFeatureExtractorHyperparams) return false; - if (PadToMultiple != other.PadToMultiple) return false; - if (UseExplicitPadding != other.UseExplicitPadding) return false; - if (UseDepthwise != other.UseDepthwise) return false; - if (!object.Equals(Fpn, other.Fpn)) return false; - if (ReplacePreprocessorWithPlaceholder != other.ReplacePreprocessorWithPlaceholder) return false; - if (NumLayers != other.NumLayers) 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 (DepthMultiplier != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(DepthMultiplier); - if (MinDepth != 0) hash ^= MinDepth.GetHashCode(); - if (convHyperparams_ != null) hash ^= ConvHyperparams.GetHashCode(); - if (OverrideBaseFeatureExtractorHyperparams != false) hash ^= OverrideBaseFeatureExtractorHyperparams.GetHashCode(); - if (PadToMultiple != 0) hash ^= PadToMultiple.GetHashCode(); - if (UseExplicitPadding != false) hash ^= UseExplicitPadding.GetHashCode(); - if (UseDepthwise != false) hash ^= UseDepthwise.GetHashCode(); - if (fpn_ != null) hash ^= Fpn.GetHashCode(); - if (ReplacePreprocessorWithPlaceholder != false) hash ^= ReplacePreprocessorWithPlaceholder.GetHashCode(); - if (NumLayers != 0) hash ^= NumLayers.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 (DepthMultiplier != 0F) { - output.WriteRawTag(21); - output.WriteFloat(DepthMultiplier); - } - if (MinDepth != 0) { - output.WriteRawTag(24); - output.WriteInt32(MinDepth); - } - if (convHyperparams_ != null) { - output.WriteRawTag(34); - output.WriteMessage(ConvHyperparams); - } - if (PadToMultiple != 0) { - output.WriteRawTag(40); - output.WriteInt32(PadToMultiple); - } - if (UseExplicitPadding != false) { - output.WriteRawTag(56); - output.WriteBool(UseExplicitPadding); - } - if (UseDepthwise != false) { - output.WriteRawTag(64); - output.WriteBool(UseDepthwise); - } - if (OverrideBaseFeatureExtractorHyperparams != false) { - output.WriteRawTag(72); - output.WriteBool(OverrideBaseFeatureExtractorHyperparams); - } - if (fpn_ != null) { - output.WriteRawTag(82); - output.WriteMessage(Fpn); - } - if (ReplacePreprocessorWithPlaceholder != false) { - output.WriteRawTag(88); - output.WriteBool(ReplacePreprocessorWithPlaceholder); - } - if (NumLayers != 0) { - output.WriteRawTag(96); - output.WriteInt32(NumLayers); - } - 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 (DepthMultiplier != 0F) { - size += 1 + 4; - } - if (MinDepth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinDepth); - } - if (convHyperparams_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(ConvHyperparams); - } - if (OverrideBaseFeatureExtractorHyperparams != false) { - size += 1 + 1; - } - if (PadToMultiple != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(PadToMultiple); - } - if (UseExplicitPadding != false) { - size += 1 + 1; - } - if (UseDepthwise != false) { - size += 1 + 1; - } - if (fpn_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Fpn); - } - if (ReplacePreprocessorWithPlaceholder != false) { - size += 1 + 1; - } - if (NumLayers != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLayers); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SsdFeatureExtractor other) { - if (other == null) { - return; - } - if (other.Type.Length != 0) { - Type = other.Type; - } - if (other.DepthMultiplier != 0F) { - DepthMultiplier = other.DepthMultiplier; - } - if (other.MinDepth != 0) { - MinDepth = other.MinDepth; - } - if (other.convHyperparams_ != null) { - if (convHyperparams_ == null) { - convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams(); - } - ConvHyperparams.MergeFrom(other.ConvHyperparams); - } - if (other.OverrideBaseFeatureExtractorHyperparams != false) { - OverrideBaseFeatureExtractorHyperparams = other.OverrideBaseFeatureExtractorHyperparams; - } - if (other.PadToMultiple != 0) { - PadToMultiple = other.PadToMultiple; - } - if (other.UseExplicitPadding != false) { - UseExplicitPadding = other.UseExplicitPadding; - } - if (other.UseDepthwise != false) { - UseDepthwise = other.UseDepthwise; - } - if (other.fpn_ != null) { - if (fpn_ == null) { - fpn_ = new global::Tensorflow.Models.ObjectDetection.Protos.FeaturePyramidNetworks(); - } - Fpn.MergeFrom(other.Fpn); - } - if (other.ReplacePreprocessorWithPlaceholder != false) { - ReplacePreprocessorWithPlaceholder = other.ReplacePreprocessorWithPlaceholder; - } - if (other.NumLayers != 0) { - NumLayers = other.NumLayers; - } - _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 21: { - DepthMultiplier = input.ReadFloat(); - break; - } - case 24: { - MinDepth = input.ReadInt32(); - break; - } - case 34: { - if (convHyperparams_ == null) { - convHyperparams_ = new global::Tensorflow.Models.ObjectDetection.Protos.Hyperparams(); - } - input.ReadMessage(convHyperparams_); - break; - } - case 40: { - PadToMultiple = input.ReadInt32(); - break; - } - case 56: { - UseExplicitPadding = input.ReadBool(); - break; - } - case 64: { - UseDepthwise = input.ReadBool(); - break; - } - case 72: { - OverrideBaseFeatureExtractorHyperparams = input.ReadBool(); - break; - } - case 82: { - if (fpn_ == null) { - fpn_ = new global::Tensorflow.Models.ObjectDetection.Protos.FeaturePyramidNetworks(); - } - input.ReadMessage(fpn_); - break; - } - case 88: { - ReplacePreprocessorWithPlaceholder = input.ReadBool(); - break; - } - case 96: { - NumLayers = input.ReadInt32(); - break; - } - } - } - } - - } - - /// - /// Configuration for Feature Pyramid Networks. - /// - public sealed partial class FeaturePyramidNetworks : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FeaturePyramidNetworks()); - 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.SsdReflection.Descriptor.MessageTypes[2]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FeaturePyramidNetworks() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FeaturePyramidNetworks(FeaturePyramidNetworks other) : this() { - minLevel_ = other.minLevel_; - maxLevel_ = other.maxLevel_; - additionalLayerDepth_ = other.additionalLayerDepth_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public FeaturePyramidNetworks Clone() { - return new FeaturePyramidNetworks(this); - } - - /// Field number for the "min_level" field. - public const int MinLevelFieldNumber = 1; - private int minLevel_; - /// - /// minimum level in feature pyramid - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MinLevel { - get { return minLevel_; } - set { - minLevel_ = value; - } - } - - /// Field number for the "max_level" field. - public const int MaxLevelFieldNumber = 2; - private int maxLevel_; - /// - /// maximum level in feature pyramid - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxLevel { - get { return maxLevel_; } - set { - maxLevel_ = value; - } - } - - /// Field number for the "additional_layer_depth" field. - public const int AdditionalLayerDepthFieldNumber = 3; - private int additionalLayerDepth_; - /// - /// channel depth for additional coarse feature layers. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int AdditionalLayerDepth { - get { return additionalLayerDepth_; } - set { - additionalLayerDepth_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as FeaturePyramidNetworks); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(FeaturePyramidNetworks other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MinLevel != other.MinLevel) return false; - if (MaxLevel != other.MaxLevel) return false; - if (AdditionalLayerDepth != other.AdditionalLayerDepth) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (MinLevel != 0) hash ^= MinLevel.GetHashCode(); - if (MaxLevel != 0) hash ^= MaxLevel.GetHashCode(); - if (AdditionalLayerDepth != 0) hash ^= AdditionalLayerDepth.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 (MinLevel != 0) { - output.WriteRawTag(8); - output.WriteInt32(MinLevel); - } - if (MaxLevel != 0) { - output.WriteRawTag(16); - output.WriteInt32(MaxLevel); - } - if (AdditionalLayerDepth != 0) { - output.WriteRawTag(24); - output.WriteInt32(AdditionalLayerDepth); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (MinLevel != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinLevel); - } - if (MaxLevel != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxLevel); - } - if (AdditionalLayerDepth != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AdditionalLayerDepth); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(FeaturePyramidNetworks other) { - if (other == null) { - return; - } - if (other.MinLevel != 0) { - MinLevel = other.MinLevel; - } - if (other.MaxLevel != 0) { - MaxLevel = other.MaxLevel; - } - if (other.AdditionalLayerDepth != 0) { - AdditionalLayerDepth = other.AdditionalLayerDepth; - } - _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: { - MinLevel = input.ReadInt32(); - break; - } - case 16: { - MaxLevel = input.ReadInt32(); - break; - } - case 24: { - AdditionalLayerDepth = input.ReadInt32(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/SsdAnchorGenerator.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/SsdAnchorGenerator.cs deleted file mode 100644 index e2a4a457..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/SsdAnchorGenerator.cs +++ /dev/null @@ -1,526 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/ssd_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/ssd_anchor_generator.proto - public static partial class SsdAnchorGeneratorReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/ssd_anchor_generator.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static SsdAnchorGeneratorReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjJvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9zc2RfYW5jaG9yX2dlbmVyYXRv", - "ci5wcm90bxIXb2JqZWN0X2RldGVjdGlvbi5wcm90b3Mi1QIKElNzZEFuY2hv", - "ckdlbmVyYXRvchISCgpudW1fbGF5ZXJzGAEgASgFEhEKCW1pbl9zY2FsZRgC", - "IAEoAhIRCgltYXhfc2NhbGUYAyABKAISDgoGc2NhbGVzGAwgAygCEhUKDWFz", - "cGVjdF9yYXRpb3MYBCADKAISJwofaW50ZXJwb2xhdGVkX3NjYWxlX2FzcGVj", - "dF9yYXRpbxgNIAEoAhIkChxyZWR1Y2VfYm94ZXNfaW5fbG93ZXN0X2xheWVy", - "GAUgASgIEhoKEmJhc2VfYW5jaG9yX2hlaWdodBgGIAEoAhIZChFiYXNlX2Fu", - "Y2hvcl93aWR0aBgHIAEoAhIVCg1oZWlnaHRfc3RyaWRlGAggAygFEhQKDHdp", - "ZHRoX3N0cmlkZRgJIAMoBRIVCg1oZWlnaHRfb2Zmc2V0GAogAygFEhQKDHdp", - "ZHRoX29mZnNldBgLIAMoBWIGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator), global::Tensorflow.Models.ObjectDetection.Protos.SsdAnchorGenerator.Parser, new[]{ "NumLayers", "MinScale", "MaxScale", "Scales", "AspectRatios", "InterpolatedScaleAspectRatio", "ReduceBoxesInLowestLayer", "BaseAnchorHeight", "BaseAnchorWidth", "HeightStride", "WidthStride", "HeightOffset", "WidthOffset" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Configuration proto for SSD anchor generator described in - /// https://arxiv.org/abs/1512.02325. See - /// anchor_generators/multiple_grid_anchor_generator.py for details. - /// - public sealed partial class SsdAnchorGenerator : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SsdAnchorGenerator()); - 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.SsdAnchorGeneratorReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SsdAnchorGenerator() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SsdAnchorGenerator(SsdAnchorGenerator other) : this() { - numLayers_ = other.numLayers_; - minScale_ = other.minScale_; - maxScale_ = other.maxScale_; - scales_ = other.scales_.Clone(); - aspectRatios_ = other.aspectRatios_.Clone(); - interpolatedScaleAspectRatio_ = other.interpolatedScaleAspectRatio_; - reduceBoxesInLowestLayer_ = other.reduceBoxesInLowestLayer_; - baseAnchorHeight_ = other.baseAnchorHeight_; - baseAnchorWidth_ = other.baseAnchorWidth_; - heightStride_ = other.heightStride_.Clone(); - widthStride_ = other.widthStride_.Clone(); - heightOffset_ = other.heightOffset_.Clone(); - widthOffset_ = other.widthOffset_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public SsdAnchorGenerator Clone() { - return new SsdAnchorGenerator(this); - } - - /// Field number for the "num_layers" field. - public const int NumLayersFieldNumber = 1; - private int numLayers_; - /// - /// Number of grid layers to create anchors for. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NumLayers { - get { return numLayers_; } - set { - numLayers_ = value; - } - } - - /// Field number for the "min_scale" field. - public const int MinScaleFieldNumber = 2; - private float minScale_; - /// - /// Scale of anchors corresponding to finest resolution. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MinScale { - get { return minScale_; } - set { - minScale_ = value; - } - } - - /// Field number for the "max_scale" field. - public const int MaxScaleFieldNumber = 3; - private float maxScale_; - /// - /// Scale of anchors corresponding to coarsest resolution - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float MaxScale { - get { return maxScale_; } - set { - maxScale_ = value; - } - } - - /// Field number for the "scales" field. - public const int ScalesFieldNumber = 12; - private static readonly pb::FieldCodec _repeated_scales_codec - = pb::FieldCodec.ForFloat(98); - private readonly pbc::RepeatedField scales_ = new pbc::RepeatedField(); - /// - /// Can be used to override min_scale->max_scale, with an explicitly defined - /// set of scales. If empty, then min_scale->max_scale is used. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Scales { - get { return scales_; } - } - - /// Field number for the "aspect_ratios" field. - public const int AspectRatiosFieldNumber = 4; - private static readonly pb::FieldCodec _repeated_aspectRatios_codec - = pb::FieldCodec.ForFloat(34); - private readonly pbc::RepeatedField aspectRatios_ = new pbc::RepeatedField(); - /// - /// Aspect ratios for anchors at each grid point. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField AspectRatios { - get { return aspectRatios_; } - } - - /// Field number for the "interpolated_scale_aspect_ratio" field. - public const int InterpolatedScaleAspectRatioFieldNumber = 13; - private float interpolatedScaleAspectRatio_; - /// - /// When this aspect ratio is greater than 0, then an additional - /// anchor, with an interpolated scale is added with this aspect ratio. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float InterpolatedScaleAspectRatio { - get { return interpolatedScaleAspectRatio_; } - set { - interpolatedScaleAspectRatio_ = value; - } - } - - /// Field number for the "reduce_boxes_in_lowest_layer" field. - public const int ReduceBoxesInLowestLayerFieldNumber = 5; - private bool reduceBoxesInLowestLayer_; - /// - /// Whether to use the following aspect ratio and scale combination for the - /// layer with the finest resolution : (scale=0.1, aspect_ratio=1.0), - /// (scale=min_scale, aspect_ration=2.0), (scale=min_scale, aspect_ratio=0.5). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool ReduceBoxesInLowestLayer { - get { return reduceBoxesInLowestLayer_; } - set { - reduceBoxesInLowestLayer_ = value; - } - } - - /// Field number for the "base_anchor_height" field. - public const int BaseAnchorHeightFieldNumber = 6; - private float baseAnchorHeight_; - /// - /// The base anchor size in height dimension. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float BaseAnchorHeight { - get { return baseAnchorHeight_; } - set { - baseAnchorHeight_ = value; - } - } - - /// Field number for the "base_anchor_width" field. - public const int BaseAnchorWidthFieldNumber = 7; - private float baseAnchorWidth_; - /// - /// The base anchor size in width dimension. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float BaseAnchorWidth { - get { return baseAnchorWidth_; } - set { - baseAnchorWidth_ = value; - } - } - - /// Field number for the "height_stride" field. - public const int HeightStrideFieldNumber = 8; - private static readonly pb::FieldCodec _repeated_heightStride_codec - = pb::FieldCodec.ForInt32(66); - private readonly pbc::RepeatedField heightStride_ = new pbc::RepeatedField(); - /// - /// Anchor stride in height dimension in pixels for each layer. The length of - /// this field is expected to be equal to the value of num_layers. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField HeightStride { - get { return heightStride_; } - } - - /// Field number for the "width_stride" field. - public const int WidthStrideFieldNumber = 9; - private static readonly pb::FieldCodec _repeated_widthStride_codec - = pb::FieldCodec.ForInt32(74); - private readonly pbc::RepeatedField widthStride_ = new pbc::RepeatedField(); - /// - /// Anchor stride in width dimension in pixels for each layer. The length of - /// this field is expected to be equal to the value of num_layers. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField WidthStride { - get { return widthStride_; } - } - - /// Field number for the "height_offset" field. - public const int HeightOffsetFieldNumber = 10; - private static readonly pb::FieldCodec _repeated_heightOffset_codec - = pb::FieldCodec.ForInt32(82); - private readonly pbc::RepeatedField heightOffset_ = new pbc::RepeatedField(); - /// - /// Anchor height offset in pixels for each layer. The length of this field is - /// expected to be equal to the value of num_layers. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField HeightOffset { - get { return heightOffset_; } - } - - /// Field number for the "width_offset" field. - public const int WidthOffsetFieldNumber = 11; - private static readonly pb::FieldCodec _repeated_widthOffset_codec - = pb::FieldCodec.ForInt32(90); - private readonly pbc::RepeatedField widthOffset_ = new pbc::RepeatedField(); - /// - /// Anchor width offset in pixels for each layer. The length of this field is - /// expected to be equal to the value of num_layers. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField WidthOffset { - get { return widthOffset_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as SsdAnchorGenerator); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(SsdAnchorGenerator other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (NumLayers != other.NumLayers) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MinScale, other.MinScale)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(MaxScale, other.MaxScale)) return false; - if(!scales_.Equals(other.scales_)) return false; - if(!aspectRatios_.Equals(other.aspectRatios_)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(InterpolatedScaleAspectRatio, other.InterpolatedScaleAspectRatio)) return false; - if (ReduceBoxesInLowestLayer != other.ReduceBoxesInLowestLayer) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BaseAnchorHeight, other.BaseAnchorHeight)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BaseAnchorWidth, other.BaseAnchorWidth)) return false; - if(!heightStride_.Equals(other.heightStride_)) return false; - if(!widthStride_.Equals(other.widthStride_)) return false; - if(!heightOffset_.Equals(other.heightOffset_)) return false; - if(!widthOffset_.Equals(other.widthOffset_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (NumLayers != 0) hash ^= NumLayers.GetHashCode(); - if (MinScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MinScale); - if (MaxScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(MaxScale); - hash ^= scales_.GetHashCode(); - hash ^= aspectRatios_.GetHashCode(); - if (InterpolatedScaleAspectRatio != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(InterpolatedScaleAspectRatio); - if (ReduceBoxesInLowestLayer != false) hash ^= ReduceBoxesInLowestLayer.GetHashCode(); - if (BaseAnchorHeight != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BaseAnchorHeight); - if (BaseAnchorWidth != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BaseAnchorWidth); - hash ^= heightStride_.GetHashCode(); - hash ^= widthStride_.GetHashCode(); - hash ^= heightOffset_.GetHashCode(); - 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) { - if (NumLayers != 0) { - output.WriteRawTag(8); - output.WriteInt32(NumLayers); - } - if (MinScale != 0F) { - output.WriteRawTag(21); - output.WriteFloat(MinScale); - } - if (MaxScale != 0F) { - output.WriteRawTag(29); - output.WriteFloat(MaxScale); - } - aspectRatios_.WriteTo(output, _repeated_aspectRatios_codec); - if (ReduceBoxesInLowestLayer != false) { - output.WriteRawTag(40); - output.WriteBool(ReduceBoxesInLowestLayer); - } - if (BaseAnchorHeight != 0F) { - output.WriteRawTag(53); - output.WriteFloat(BaseAnchorHeight); - } - if (BaseAnchorWidth != 0F) { - output.WriteRawTag(61); - output.WriteFloat(BaseAnchorWidth); - } - heightStride_.WriteTo(output, _repeated_heightStride_codec); - widthStride_.WriteTo(output, _repeated_widthStride_codec); - heightOffset_.WriteTo(output, _repeated_heightOffset_codec); - widthOffset_.WriteTo(output, _repeated_widthOffset_codec); - scales_.WriteTo(output, _repeated_scales_codec); - if (InterpolatedScaleAspectRatio != 0F) { - output.WriteRawTag(109); - output.WriteFloat(InterpolatedScaleAspectRatio); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (NumLayers != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumLayers); - } - if (MinScale != 0F) { - size += 1 + 4; - } - if (MaxScale != 0F) { - size += 1 + 4; - } - size += scales_.CalculateSize(_repeated_scales_codec); - size += aspectRatios_.CalculateSize(_repeated_aspectRatios_codec); - if (InterpolatedScaleAspectRatio != 0F) { - size += 1 + 4; - } - if (ReduceBoxesInLowestLayer != false) { - size += 1 + 1; - } - if (BaseAnchorHeight != 0F) { - size += 1 + 4; - } - if (BaseAnchorWidth != 0F) { - size += 1 + 4; - } - size += heightStride_.CalculateSize(_repeated_heightStride_codec); - size += widthStride_.CalculateSize(_repeated_widthStride_codec); - size += heightOffset_.CalculateSize(_repeated_heightOffset_codec); - size += widthOffset_.CalculateSize(_repeated_widthOffset_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(SsdAnchorGenerator other) { - if (other == null) { - return; - } - if (other.NumLayers != 0) { - NumLayers = other.NumLayers; - } - if (other.MinScale != 0F) { - MinScale = other.MinScale; - } - if (other.MaxScale != 0F) { - MaxScale = other.MaxScale; - } - scales_.Add(other.scales_); - aspectRatios_.Add(other.aspectRatios_); - if (other.InterpolatedScaleAspectRatio != 0F) { - InterpolatedScaleAspectRatio = other.InterpolatedScaleAspectRatio; - } - if (other.ReduceBoxesInLowestLayer != false) { - ReduceBoxesInLowestLayer = other.ReduceBoxesInLowestLayer; - } - if (other.BaseAnchorHeight != 0F) { - BaseAnchorHeight = other.BaseAnchorHeight; - } - if (other.BaseAnchorWidth != 0F) { - BaseAnchorWidth = other.BaseAnchorWidth; - } - heightStride_.Add(other.heightStride_); - widthStride_.Add(other.widthStride_); - heightOffset_.Add(other.heightOffset_); - widthOffset_.Add(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 8: { - NumLayers = input.ReadInt32(); - break; - } - case 21: { - MinScale = input.ReadFloat(); - break; - } - case 29: { - MaxScale = input.ReadFloat(); - break; - } - case 34: - case 37: { - aspectRatios_.AddEntriesFrom(input, _repeated_aspectRatios_codec); - break; - } - case 40: { - ReduceBoxesInLowestLayer = input.ReadBool(); - break; - } - case 53: { - BaseAnchorHeight = input.ReadFloat(); - break; - } - case 61: { - BaseAnchorWidth = input.ReadFloat(); - break; - } - case 66: - case 64: { - heightStride_.AddEntriesFrom(input, _repeated_heightStride_codec); - break; - } - case 74: - case 72: { - widthStride_.AddEntriesFrom(input, _repeated_widthStride_codec); - break; - } - case 82: - case 80: { - heightOffset_.AddEntriesFrom(input, _repeated_heightOffset_codec); - break; - } - case 90: - case 88: { - widthOffset_.AddEntriesFrom(input, _repeated_widthOffset_codec); - break; - } - case 98: - case 101: { - scales_.AddEntriesFrom(input, _repeated_scales_codec); - break; - } - case 109: { - InterpolatedScaleAspectRatio = input.ReadFloat(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/StringIntLabelMap.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/StringIntLabelMap.cs deleted file mode 100644 index dcb2ae8b..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/StringIntLabelMap.cs +++ /dev/null @@ -1,365 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/string_int_label_map.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/string_int_label_map.proto - public static partial class StringIntLabelMapReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/string_int_label_map.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static StringIntLabelMapReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CjJvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9zdHJpbmdfaW50X2xhYmVsX21h", - "cC5wcm90bxIXb2JqZWN0X2RldGVjdGlvbi5wcm90b3MiRwoVU3RyaW5nSW50", - "TGFiZWxNYXBJdGVtEgwKBG5hbWUYASABKAkSCgoCaWQYAiABKAUSFAoMZGlz", - "cGxheV9uYW1lGAMgASgJIlEKEVN0cmluZ0ludExhYmVsTWFwEjwKBGl0ZW0Y", - "ASADKAsyLi5vYmplY3RfZGV0ZWN0aW9uLnByb3Rvcy5TdHJpbmdJbnRMYWJl", - "bE1hcEl0ZW1iBnByb3RvMw==")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem), global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem.Parser, new[]{ "Name", "Id", "DisplayName" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMap), global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMap.Parser, new[]{ "Item" }, null, null, null) - })); - } - #endregion - - } - #region Messages - public sealed partial class StringIntLabelMapItem : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StringIntLabelMapItem()); - 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.StringIntLabelMapReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringIntLabelMapItem() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringIntLabelMapItem(StringIntLabelMapItem other) : this() { - name_ = other.name_; - id_ = other.id_; - displayName_ = other.displayName_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringIntLabelMapItem Clone() { - return new StringIntLabelMapItem(this); - } - - /// Field number for the "name" field. - public const int NameFieldNumber = 1; - private string name_ = ""; - /// - /// String name. The most common practice is to set this to a MID or synsets - /// id. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string Name { - get { return name_; } - set { - name_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "id" field. - public const int IdFieldNumber = 2; - private int id_; - /// - /// Integer id that maps to the string name above. Label ids should start from - /// 1. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int Id { - get { return id_; } - set { - id_ = value; - } - } - - /// Field number for the "display_name" field. - public const int DisplayNameFieldNumber = 3; - private string displayName_ = ""; - /// - /// Human readable string label. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string DisplayName { - get { return displayName_; } - set { - displayName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as StringIntLabelMapItem); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StringIntLabelMapItem other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Name != other.Name) return false; - if (Id != other.Id) return false; - if (DisplayName != other.DisplayName) 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 (Id != 0) hash ^= Id.GetHashCode(); - if (DisplayName.Length != 0) hash ^= DisplayName.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 (Name.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Name); - } - if (Id != 0) { - output.WriteRawTag(16); - output.WriteInt32(Id); - } - if (DisplayName.Length != 0) { - output.WriteRawTag(26); - output.WriteString(DisplayName); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (Name.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); - } - if (Id != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Id); - } - if (DisplayName.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(DisplayName); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StringIntLabelMapItem other) { - if (other == null) { - return; - } - if (other.Name.Length != 0) { - Name = other.Name; - } - if (other.Id != 0) { - Id = other.Id; - } - if (other.DisplayName.Length != 0) { - DisplayName = other.DisplayName; - } - _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: { - Name = input.ReadString(); - break; - } - case 16: { - Id = input.ReadInt32(); - break; - } - case 26: { - DisplayName = input.ReadString(); - break; - } - } - } - } - - } - - public sealed partial class StringIntLabelMap : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StringIntLabelMap()); - 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.StringIntLabelMapReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringIntLabelMap() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringIntLabelMap(StringIntLabelMap other) : this() { - item_ = other.item_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public StringIntLabelMap Clone() { - return new StringIntLabelMap(this); - } - - /// Field number for the "item" field. - public const int ItemFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_item_codec - = pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem.Parser); - private readonly pbc::RepeatedField item_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField Item { - get { return item_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as StringIntLabelMap); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(StringIntLabelMap other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!item_.Equals(other.item_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - hash ^= item_.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) { - item_.WriteTo(output, _repeated_item_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - size += item_.CalculateSize(_repeated_item_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(StringIntLabelMap other) { - if (other == null) { - return; - } - item_.Add(other.item_); - _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: { - item_.AddEntriesFrom(input, _repeated_item_codec); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Protos/Train.cs b/src/TensorFlowNET.Models/ObjectDetection/Protos/Train.cs deleted file mode 100644 index 44318fb5..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Protos/Train.cs +++ /dev/null @@ -1,1020 +0,0 @@ -// -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: object_detection/protos/train.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/train.proto - public static partial class TrainReflection { - - #region Descriptor - /// File descriptor for object_detection/protos/train.proto - public static pbr::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbr::FileDescriptor descriptor; - - static TrainReflection() { - byte[] descriptorData = global::System.Convert.FromBase64String( - string.Concat( - "CiNvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy90cmFpbi5wcm90bxIXb2JqZWN0", - "X2RldGVjdGlvbi5wcm90b3MaJ29iamVjdF9kZXRlY3Rpb24vcHJvdG9zL29w", - "dGltaXplci5wcm90bxoqb2JqZWN0X2RldGVjdGlvbi9wcm90b3MvcHJlcHJv", - "Y2Vzc29yLnByb3RvIpoHCgtUcmFpbkNvbmZpZxISCgpiYXRjaF9zaXplGAEg", - "ASgNEk0KGWRhdGFfYXVnbWVudGF0aW9uX29wdGlvbnMYAiADKAsyKi5vYmpl", - "Y3RfZGV0ZWN0aW9uLnByb3Rvcy5QcmVwcm9jZXNzaW5nU3RlcBIVCg1zeW5j", - "X3JlcGxpY2FzGAMgASgIEiUKHWtlZXBfY2hlY2twb2ludF9ldmVyeV9uX2hv", - "dXJzGAQgASgCEjUKCW9wdGltaXplchgFIAEoCzIiLm9iamVjdF9kZXRlY3Rp", - "b24ucHJvdG9zLk9wdGltaXplchIhChlncmFkaWVudF9jbGlwcGluZ19ieV9u", - "b3JtGAYgASgCEhwKFGZpbmVfdHVuZV9jaGVja3BvaW50GAcgASgJEiEKGWZp", - "bmVfdHVuZV9jaGVja3BvaW50X3R5cGUYFiABKAkSIQoZZnJvbV9kZXRlY3Rp", - "b25fY2hlY2twb2ludBgIIAEoCBIqCiJsb2FkX2FsbF9kZXRlY3Rpb25fY2hl", - "Y2twb2ludF92YXJzGBMgASgIEhEKCW51bV9zdGVwcxgJIAEoDRIbChNzdGFy", - "dHVwX2RlbGF5X3N0ZXBzGAogASgCEhwKFGJpYXNfZ3JhZF9tdWx0aXBsaWVy", - "GAsgASgCEiIKGnVwZGF0ZV90cmFpbmFibGVfdmFyaWFibGVzGBkgAygJEhgK", - "EGZyZWV6ZV92YXJpYWJsZXMYDCADKAkSHQoVcmVwbGljYXNfdG9fYWdncmVn", - "YXRlGA0gASgFEhwKFGJhdGNoX3F1ZXVlX2NhcGFjaXR5GA4gASgFEh8KF251", - "bV9iYXRjaF9xdWV1ZV90aHJlYWRzGA8gASgFEh8KF3ByZWZldGNoX3F1ZXVl", - "X2NhcGFjaXR5GBAgASgFEiIKGm1lcmdlX211bHRpcGxlX2xhYmVsX2JveGVz", - "GBEgASgIEh0KFXVzZV9tdWx0aWNsYXNzX3Njb3JlcxgYIAEoCBIfChdhZGRf", - "cmVndWxhcml6YXRpb25fbG9zcxgSIAEoCBIbChNtYXhfbnVtYmVyX29mX2Jv", - "eGVzGBQgASgFEiEKGXVucGFkX2dyb3VuZHRydXRoX3RlbnNvcnMYFSABKAgS", - "HgoWcmV0YWluX29yaWdpbmFsX2ltYWdlcxgXIAEoCBIUCgx1c2VfYmZsb2F0", - "MTYYGiABKAgSGwoTc3VtbWFyaXplX2dyYWRpZW50cxgbIAEoCGIGcHJvdG8z")); - descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, - new pbr::FileDescriptor[] { global::Tensorflow.Models.ObjectDetection.Protos.OptimizerReflection.Descriptor, global::Tensorflow.Models.ObjectDetection.Protos.PreprocessorReflection.Descriptor, }, - new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tensorflow.Models.ObjectDetection.Protos.TrainConfig), global::Tensorflow.Models.ObjectDetection.Protos.TrainConfig.Parser, new[]{ "BatchSize", "DataAugmentationOptions", "SyncReplicas", "KeepCheckpointEveryNHours", "Optimizer", "GradientClippingByNorm", "FineTuneCheckpoint", "FineTuneCheckpointType", "FromDetectionCheckpoint", "LoadAllDetectionCheckpointVars", "NumSteps", "StartupDelaySteps", "BiasGradMultiplier", "UpdateTrainableVariables", "FreezeVariables", "ReplicasToAggregate", "BatchQueueCapacity", "NumBatchQueueThreads", "PrefetchQueueCapacity", "MergeMultipleLabelBoxes", "UseMulticlassScores", "AddRegularizationLoss", "MaxNumberOfBoxes", "UnpadGroundtruthTensors", "RetainOriginalImages", "UseBfloat16", "SummarizeGradients" }, null, null, null) - })); - } - #endregion - - } - #region Messages - /// - /// Message for configuring DetectionModel training jobs (train.py). - /// Next id: 28 - /// - public sealed partial class TrainConfig : pb::IMessage { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TrainConfig()); - 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.TrainReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TrainConfig() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TrainConfig(TrainConfig other) : this() { - batchSize_ = other.batchSize_; - dataAugmentationOptions_ = other.dataAugmentationOptions_.Clone(); - syncReplicas_ = other.syncReplicas_; - keepCheckpointEveryNHours_ = other.keepCheckpointEveryNHours_; - optimizer_ = other.optimizer_ != null ? other.optimizer_.Clone() : null; - gradientClippingByNorm_ = other.gradientClippingByNorm_; - fineTuneCheckpoint_ = other.fineTuneCheckpoint_; - fineTuneCheckpointType_ = other.fineTuneCheckpointType_; - fromDetectionCheckpoint_ = other.fromDetectionCheckpoint_; - loadAllDetectionCheckpointVars_ = other.loadAllDetectionCheckpointVars_; - numSteps_ = other.numSteps_; - startupDelaySteps_ = other.startupDelaySteps_; - biasGradMultiplier_ = other.biasGradMultiplier_; - updateTrainableVariables_ = other.updateTrainableVariables_.Clone(); - freezeVariables_ = other.freezeVariables_.Clone(); - replicasToAggregate_ = other.replicasToAggregate_; - batchQueueCapacity_ = other.batchQueueCapacity_; - numBatchQueueThreads_ = other.numBatchQueueThreads_; - prefetchQueueCapacity_ = other.prefetchQueueCapacity_; - mergeMultipleLabelBoxes_ = other.mergeMultipleLabelBoxes_; - useMulticlassScores_ = other.useMulticlassScores_; - addRegularizationLoss_ = other.addRegularizationLoss_; - maxNumberOfBoxes_ = other.maxNumberOfBoxes_; - unpadGroundtruthTensors_ = other.unpadGroundtruthTensors_; - retainOriginalImages_ = other.retainOriginalImages_; - useBfloat16_ = other.useBfloat16_; - summarizeGradients_ = other.summarizeGradients_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public TrainConfig Clone() { - return new TrainConfig(this); - } - - /// Field number for the "batch_size" field. - public const int BatchSizeFieldNumber = 1; - private uint batchSize_; - /// - /// Effective batch size to use for training. - /// For TPU (or sync SGD jobs), the batch size per core (or GPU) is going to be - /// `batch_size` / number of cores (or `batch_size` / number of GPUs). - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint BatchSize { - get { return batchSize_; } - set { - batchSize_ = value; - } - } - - /// Field number for the "data_augmentation_options" field. - public const int DataAugmentationOptionsFieldNumber = 2; - private static readonly pb::FieldCodec _repeated_dataAugmentationOptions_codec - = pb::FieldCodec.ForMessage(18, global::Tensorflow.Models.ObjectDetection.Protos.PreprocessingStep.Parser); - private readonly pbc::RepeatedField dataAugmentationOptions_ = new pbc::RepeatedField(); - /// - /// Data augmentation options. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField DataAugmentationOptions { - get { return dataAugmentationOptions_; } - } - - /// Field number for the "sync_replicas" field. - public const int SyncReplicasFieldNumber = 3; - private bool syncReplicas_; - /// - /// Whether to synchronize replicas during training. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool SyncReplicas { - get { return syncReplicas_; } - set { - syncReplicas_ = value; - } - } - - /// Field number for the "keep_checkpoint_every_n_hours" field. - public const int KeepCheckpointEveryNHoursFieldNumber = 4; - private float keepCheckpointEveryNHours_; - /// - /// How frequently to keep checkpoints. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float KeepCheckpointEveryNHours { - get { return keepCheckpointEveryNHours_; } - set { - keepCheckpointEveryNHours_ = value; - } - } - - /// Field number for the "optimizer" field. - public const int OptimizerFieldNumber = 5; - private global::Tensorflow.Models.ObjectDetection.Protos.Optimizer optimizer_; - /// - /// Optimizer used to train the DetectionModel. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public global::Tensorflow.Models.ObjectDetection.Protos.Optimizer Optimizer { - get { return optimizer_; } - set { - optimizer_ = value; - } - } - - /// Field number for the "gradient_clipping_by_norm" field. - public const int GradientClippingByNormFieldNumber = 6; - private float gradientClippingByNorm_; - /// - /// If greater than 0, clips gradients by this value. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float GradientClippingByNorm { - get { return gradientClippingByNorm_; } - set { - gradientClippingByNorm_ = value; - } - } - - /// Field number for the "fine_tune_checkpoint" field. - public const int FineTuneCheckpointFieldNumber = 7; - private string fineTuneCheckpoint_ = ""; - /// - /// Checkpoint to restore variables from. Typically used to load feature - /// extractor variables trained outside of object detection. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string FineTuneCheckpoint { - get { return fineTuneCheckpoint_; } - set { - fineTuneCheckpoint_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "fine_tune_checkpoint_type" field. - public const int FineTuneCheckpointTypeFieldNumber = 22; - private string fineTuneCheckpointType_ = ""; - /// - /// Type of checkpoint to restore variables from, e.g. 'classification' or - /// 'detection'. Provides extensibility to from_detection_checkpoint. - /// Typically used to load feature extractor variables from trained models. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public string FineTuneCheckpointType { - get { return fineTuneCheckpointType_; } - set { - fineTuneCheckpointType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "from_detection_checkpoint" field. - public const int FromDetectionCheckpointFieldNumber = 8; - private bool fromDetectionCheckpoint_; - /// - /// [Deprecated]: use fine_tune_checkpoint_type instead. - /// Specifies if the finetune checkpoint is from an object detection model. - /// If from an object detection model, the model being trained should have - /// the same parameters with the exception of the num_classes parameter. - /// If false, it assumes the checkpoint was a object classification model. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool FromDetectionCheckpoint { - get { return fromDetectionCheckpoint_; } - set { - fromDetectionCheckpoint_ = value; - } - } - - /// Field number for the "load_all_detection_checkpoint_vars" field. - public const int LoadAllDetectionCheckpointVarsFieldNumber = 19; - private bool loadAllDetectionCheckpointVars_; - /// - /// Whether to load all checkpoint vars that match model variable names and - /// sizes. This option is only available if `from_detection_checkpoint` is - /// True. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool LoadAllDetectionCheckpointVars { - get { return loadAllDetectionCheckpointVars_; } - set { - loadAllDetectionCheckpointVars_ = value; - } - } - - /// Field number for the "num_steps" field. - public const int NumStepsFieldNumber = 9; - private uint numSteps_; - /// - /// Number of steps to train the DetectionModel for. If 0, will train the model - /// indefinitely. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint NumSteps { - get { return numSteps_; } - set { - numSteps_ = value; - } - } - - /// Field number for the "startup_delay_steps" field. - public const int StartupDelayStepsFieldNumber = 10; - private float startupDelaySteps_; - /// - /// Number of training steps between replica startup. - /// This flag must be set to 0 if sync_replicas is set to true. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float StartupDelaySteps { - get { return startupDelaySteps_; } - set { - startupDelaySteps_ = value; - } - } - - /// Field number for the "bias_grad_multiplier" field. - public const int BiasGradMultiplierFieldNumber = 11; - private float biasGradMultiplier_; - /// - /// If greater than 0, multiplies the gradient of bias variables by this - /// amount. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public float BiasGradMultiplier { - get { return biasGradMultiplier_; } - set { - biasGradMultiplier_ = value; - } - } - - /// Field number for the "update_trainable_variables" field. - public const int UpdateTrainableVariablesFieldNumber = 25; - private static readonly pb::FieldCodec _repeated_updateTrainableVariables_codec - = pb::FieldCodec.ForString(202); - private readonly pbc::RepeatedField updateTrainableVariables_ = new pbc::RepeatedField(); - /// - /// Variables that should be updated during training. Note that variables which - /// also match the patterns in freeze_variables will be excluded. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField UpdateTrainableVariables { - get { return updateTrainableVariables_; } - } - - /// Field number for the "freeze_variables" field. - public const int FreezeVariablesFieldNumber = 12; - private static readonly pb::FieldCodec _repeated_freezeVariables_codec - = pb::FieldCodec.ForString(98); - private readonly pbc::RepeatedField freezeVariables_ = new pbc::RepeatedField(); - /// - /// Variables that should not be updated during training. If - /// update_trainable_variables is not empty, only eliminates the included - /// variables according to freeze_variables patterns. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pbc::RepeatedField FreezeVariables { - get { return freezeVariables_; } - } - - /// Field number for the "replicas_to_aggregate" field. - public const int ReplicasToAggregateFieldNumber = 13; - private int replicasToAggregate_; - /// - /// Number of replicas to aggregate before making parameter updates. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int ReplicasToAggregate { - get { return replicasToAggregate_; } - set { - replicasToAggregate_ = value; - } - } - - /// Field number for the "batch_queue_capacity" field. - public const int BatchQueueCapacityFieldNumber = 14; - private int batchQueueCapacity_; - /// - /// Maximum number of elements to store within a queue. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int BatchQueueCapacity { - get { return batchQueueCapacity_; } - set { - batchQueueCapacity_ = value; - } - } - - /// Field number for the "num_batch_queue_threads" field. - public const int NumBatchQueueThreadsFieldNumber = 15; - private int numBatchQueueThreads_; - /// - /// Number of threads to use for batching. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int NumBatchQueueThreads { - get { return numBatchQueueThreads_; } - set { - numBatchQueueThreads_ = value; - } - } - - /// Field number for the "prefetch_queue_capacity" field. - public const int PrefetchQueueCapacityFieldNumber = 16; - private int prefetchQueueCapacity_; - /// - /// Maximum capacity of the queue used to prefetch assembled batches. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int PrefetchQueueCapacity { - get { return prefetchQueueCapacity_; } - set { - prefetchQueueCapacity_ = value; - } - } - - /// Field number for the "merge_multiple_label_boxes" field. - public const int MergeMultipleLabelBoxesFieldNumber = 17; - private bool mergeMultipleLabelBoxes_; - /// - /// If true, boxes with the same coordinates will be merged together. - /// This is useful when each box can have multiple labels. - /// Note that only Sigmoid classification losses should be used. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool MergeMultipleLabelBoxes { - get { return mergeMultipleLabelBoxes_; } - set { - mergeMultipleLabelBoxes_ = value; - } - } - - /// Field number for the "use_multiclass_scores" field. - public const int UseMulticlassScoresFieldNumber = 24; - private bool useMulticlassScores_; - /// - /// If true, will use multiclass scores from object annotations as ground - /// truth. Currently only compatible with annotated image inputs. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseMulticlassScores { - get { return useMulticlassScores_; } - set { - useMulticlassScores_ = value; - } - } - - /// Field number for the "add_regularization_loss" field. - public const int AddRegularizationLossFieldNumber = 18; - private bool addRegularizationLoss_; - /// - /// Whether to add regularization loss to `total_loss`. This is true by - /// default and adds all regularization losses defined in the model to - /// `total_loss`. - /// Setting this option to false is very useful while debugging the model and - /// losses. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool AddRegularizationLoss { - get { return addRegularizationLoss_; } - set { - addRegularizationLoss_ = value; - } - } - - /// Field number for the "max_number_of_boxes" field. - public const int MaxNumberOfBoxesFieldNumber = 20; - private int maxNumberOfBoxes_; - /// - /// Maximum number of boxes used during training. - /// Set this to at least the maximum amount of boxes in the input data. - /// Otherwise, it may cause "Data loss: Attempted to pad to a smaller size - /// than the input element" errors. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int MaxNumberOfBoxes { - get { return maxNumberOfBoxes_; } - set { - maxNumberOfBoxes_ = value; - } - } - - /// Field number for the "unpad_groundtruth_tensors" field. - public const int UnpadGroundtruthTensorsFieldNumber = 21; - private bool unpadGroundtruthTensors_; - /// - /// Whether to remove padding along `num_boxes` dimension of the groundtruth - /// tensors. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UnpadGroundtruthTensors { - get { return unpadGroundtruthTensors_; } - set { - unpadGroundtruthTensors_ = 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. Note that this - /// will lead to a larger memory footprint. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool RetainOriginalImages { - get { return retainOriginalImages_; } - set { - retainOriginalImages_ = value; - } - } - - /// Field number for the "use_bfloat16" field. - public const int UseBfloat16FieldNumber = 26; - private bool useBfloat16_; - /// - /// Whether to use bfloat16 for training. This is currently only supported for - /// TPUs. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool UseBfloat16 { - get { return useBfloat16_; } - set { - useBfloat16_ = value; - } - } - - /// Field number for the "summarize_gradients" field. - public const int SummarizeGradientsFieldNumber = 27; - private bool summarizeGradients_; - /// - /// Whether to summarize gradients. - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool SummarizeGradients { - get { return summarizeGradients_; } - set { - summarizeGradients_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as TrainConfig); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(TrainConfig other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (BatchSize != other.BatchSize) return false; - if(!dataAugmentationOptions_.Equals(other.dataAugmentationOptions_)) return false; - if (SyncReplicas != other.SyncReplicas) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(KeepCheckpointEveryNHours, other.KeepCheckpointEveryNHours)) return false; - if (!object.Equals(Optimizer, other.Optimizer)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(GradientClippingByNorm, other.GradientClippingByNorm)) return false; - if (FineTuneCheckpoint != other.FineTuneCheckpoint) return false; - if (FineTuneCheckpointType != other.FineTuneCheckpointType) return false; - if (FromDetectionCheckpoint != other.FromDetectionCheckpoint) return false; - if (LoadAllDetectionCheckpointVars != other.LoadAllDetectionCheckpointVars) return false; - if (NumSteps != other.NumSteps) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(StartupDelaySteps, other.StartupDelaySteps)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(BiasGradMultiplier, other.BiasGradMultiplier)) return false; - if(!updateTrainableVariables_.Equals(other.updateTrainableVariables_)) return false; - if(!freezeVariables_.Equals(other.freezeVariables_)) return false; - if (ReplicasToAggregate != other.ReplicasToAggregate) return false; - if (BatchQueueCapacity != other.BatchQueueCapacity) return false; - if (NumBatchQueueThreads != other.NumBatchQueueThreads) return false; - if (PrefetchQueueCapacity != other.PrefetchQueueCapacity) return false; - if (MergeMultipleLabelBoxes != other.MergeMultipleLabelBoxes) return false; - if (UseMulticlassScores != other.UseMulticlassScores) return false; - if (AddRegularizationLoss != other.AddRegularizationLoss) return false; - if (MaxNumberOfBoxes != other.MaxNumberOfBoxes) return false; - if (UnpadGroundtruthTensors != other.UnpadGroundtruthTensors) return false; - if (RetainOriginalImages != other.RetainOriginalImages) return false; - if (UseBfloat16 != other.UseBfloat16) return false; - if (SummarizeGradients != other.SummarizeGradients) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (BatchSize != 0) hash ^= BatchSize.GetHashCode(); - hash ^= dataAugmentationOptions_.GetHashCode(); - if (SyncReplicas != false) hash ^= SyncReplicas.GetHashCode(); - if (KeepCheckpointEveryNHours != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(KeepCheckpointEveryNHours); - if (optimizer_ != null) hash ^= Optimizer.GetHashCode(); - if (GradientClippingByNorm != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(GradientClippingByNorm); - if (FineTuneCheckpoint.Length != 0) hash ^= FineTuneCheckpoint.GetHashCode(); - if (FineTuneCheckpointType.Length != 0) hash ^= FineTuneCheckpointType.GetHashCode(); - if (FromDetectionCheckpoint != false) hash ^= FromDetectionCheckpoint.GetHashCode(); - if (LoadAllDetectionCheckpointVars != false) hash ^= LoadAllDetectionCheckpointVars.GetHashCode(); - if (NumSteps != 0) hash ^= NumSteps.GetHashCode(); - if (StartupDelaySteps != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(StartupDelaySteps); - if (BiasGradMultiplier != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(BiasGradMultiplier); - hash ^= updateTrainableVariables_.GetHashCode(); - hash ^= freezeVariables_.GetHashCode(); - if (ReplicasToAggregate != 0) hash ^= ReplicasToAggregate.GetHashCode(); - if (BatchQueueCapacity != 0) hash ^= BatchQueueCapacity.GetHashCode(); - if (NumBatchQueueThreads != 0) hash ^= NumBatchQueueThreads.GetHashCode(); - if (PrefetchQueueCapacity != 0) hash ^= PrefetchQueueCapacity.GetHashCode(); - if (MergeMultipleLabelBoxes != false) hash ^= MergeMultipleLabelBoxes.GetHashCode(); - if (UseMulticlassScores != false) hash ^= UseMulticlassScores.GetHashCode(); - if (AddRegularizationLoss != false) hash ^= AddRegularizationLoss.GetHashCode(); - if (MaxNumberOfBoxes != 0) hash ^= MaxNumberOfBoxes.GetHashCode(); - if (UnpadGroundtruthTensors != false) hash ^= UnpadGroundtruthTensors.GetHashCode(); - if (RetainOriginalImages != false) hash ^= RetainOriginalImages.GetHashCode(); - if (UseBfloat16 != false) hash ^= UseBfloat16.GetHashCode(); - if (SummarizeGradients != false) hash ^= SummarizeGradients.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 (BatchSize != 0) { - output.WriteRawTag(8); - output.WriteUInt32(BatchSize); - } - dataAugmentationOptions_.WriteTo(output, _repeated_dataAugmentationOptions_codec); - if (SyncReplicas != false) { - output.WriteRawTag(24); - output.WriteBool(SyncReplicas); - } - if (KeepCheckpointEveryNHours != 0F) { - output.WriteRawTag(37); - output.WriteFloat(KeepCheckpointEveryNHours); - } - if (optimizer_ != null) { - output.WriteRawTag(42); - output.WriteMessage(Optimizer); - } - if (GradientClippingByNorm != 0F) { - output.WriteRawTag(53); - output.WriteFloat(GradientClippingByNorm); - } - if (FineTuneCheckpoint.Length != 0) { - output.WriteRawTag(58); - output.WriteString(FineTuneCheckpoint); - } - if (FromDetectionCheckpoint != false) { - output.WriteRawTag(64); - output.WriteBool(FromDetectionCheckpoint); - } - if (NumSteps != 0) { - output.WriteRawTag(72); - output.WriteUInt32(NumSteps); - } - if (StartupDelaySteps != 0F) { - output.WriteRawTag(85); - output.WriteFloat(StartupDelaySteps); - } - if (BiasGradMultiplier != 0F) { - output.WriteRawTag(93); - output.WriteFloat(BiasGradMultiplier); - } - freezeVariables_.WriteTo(output, _repeated_freezeVariables_codec); - if (ReplicasToAggregate != 0) { - output.WriteRawTag(104); - output.WriteInt32(ReplicasToAggregate); - } - if (BatchQueueCapacity != 0) { - output.WriteRawTag(112); - output.WriteInt32(BatchQueueCapacity); - } - if (NumBatchQueueThreads != 0) { - output.WriteRawTag(120); - output.WriteInt32(NumBatchQueueThreads); - } - if (PrefetchQueueCapacity != 0) { - output.WriteRawTag(128, 1); - output.WriteInt32(PrefetchQueueCapacity); - } - if (MergeMultipleLabelBoxes != false) { - output.WriteRawTag(136, 1); - output.WriteBool(MergeMultipleLabelBoxes); - } - if (AddRegularizationLoss != false) { - output.WriteRawTag(144, 1); - output.WriteBool(AddRegularizationLoss); - } - if (LoadAllDetectionCheckpointVars != false) { - output.WriteRawTag(152, 1); - output.WriteBool(LoadAllDetectionCheckpointVars); - } - if (MaxNumberOfBoxes != 0) { - output.WriteRawTag(160, 1); - output.WriteInt32(MaxNumberOfBoxes); - } - if (UnpadGroundtruthTensors != false) { - output.WriteRawTag(168, 1); - output.WriteBool(UnpadGroundtruthTensors); - } - if (FineTuneCheckpointType.Length != 0) { - output.WriteRawTag(178, 1); - output.WriteString(FineTuneCheckpointType); - } - if (RetainOriginalImages != false) { - output.WriteRawTag(184, 1); - output.WriteBool(RetainOriginalImages); - } - if (UseMulticlassScores != false) { - output.WriteRawTag(192, 1); - output.WriteBool(UseMulticlassScores); - } - updateTrainableVariables_.WriteTo(output, _repeated_updateTrainableVariables_codec); - if (UseBfloat16 != false) { - output.WriteRawTag(208, 1); - output.WriteBool(UseBfloat16); - } - if (SummarizeGradients != false) { - output.WriteRawTag(216, 1); - output.WriteBool(SummarizeGradients); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (BatchSize != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(BatchSize); - } - size += dataAugmentationOptions_.CalculateSize(_repeated_dataAugmentationOptions_codec); - if (SyncReplicas != false) { - size += 1 + 1; - } - if (KeepCheckpointEveryNHours != 0F) { - size += 1 + 4; - } - if (optimizer_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Optimizer); - } - if (GradientClippingByNorm != 0F) { - size += 1 + 4; - } - if (FineTuneCheckpoint.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(FineTuneCheckpoint); - } - if (FineTuneCheckpointType.Length != 0) { - size += 2 + pb::CodedOutputStream.ComputeStringSize(FineTuneCheckpointType); - } - if (FromDetectionCheckpoint != false) { - size += 1 + 1; - } - if (LoadAllDetectionCheckpointVars != false) { - size += 2 + 1; - } - if (NumSteps != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumSteps); - } - if (StartupDelaySteps != 0F) { - size += 1 + 4; - } - if (BiasGradMultiplier != 0F) { - size += 1 + 4; - } - size += updateTrainableVariables_.CalculateSize(_repeated_updateTrainableVariables_codec); - size += freezeVariables_.CalculateSize(_repeated_freezeVariables_codec); - if (ReplicasToAggregate != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(ReplicasToAggregate); - } - if (BatchQueueCapacity != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(BatchQueueCapacity); - } - if (NumBatchQueueThreads != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumBatchQueueThreads); - } - if (PrefetchQueueCapacity != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(PrefetchQueueCapacity); - } - if (MergeMultipleLabelBoxes != false) { - size += 2 + 1; - } - if (UseMulticlassScores != false) { - size += 2 + 1; - } - if (AddRegularizationLoss != false) { - size += 2 + 1; - } - if (MaxNumberOfBoxes != 0) { - size += 2 + pb::CodedOutputStream.ComputeInt32Size(MaxNumberOfBoxes); - } - if (UnpadGroundtruthTensors != false) { - size += 2 + 1; - } - if (RetainOriginalImages != false) { - size += 2 + 1; - } - if (UseBfloat16 != false) { - size += 2 + 1; - } - if (SummarizeGradients != false) { - size += 2 + 1; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(TrainConfig other) { - if (other == null) { - return; - } - if (other.BatchSize != 0) { - BatchSize = other.BatchSize; - } - dataAugmentationOptions_.Add(other.dataAugmentationOptions_); - if (other.SyncReplicas != false) { - SyncReplicas = other.SyncReplicas; - } - if (other.KeepCheckpointEveryNHours != 0F) { - KeepCheckpointEveryNHours = other.KeepCheckpointEveryNHours; - } - if (other.optimizer_ != null) { - if (optimizer_ == null) { - optimizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.Optimizer(); - } - Optimizer.MergeFrom(other.Optimizer); - } - if (other.GradientClippingByNorm != 0F) { - GradientClippingByNorm = other.GradientClippingByNorm; - } - if (other.FineTuneCheckpoint.Length != 0) { - FineTuneCheckpoint = other.FineTuneCheckpoint; - } - if (other.FineTuneCheckpointType.Length != 0) { - FineTuneCheckpointType = other.FineTuneCheckpointType; - } - if (other.FromDetectionCheckpoint != false) { - FromDetectionCheckpoint = other.FromDetectionCheckpoint; - } - if (other.LoadAllDetectionCheckpointVars != false) { - LoadAllDetectionCheckpointVars = other.LoadAllDetectionCheckpointVars; - } - if (other.NumSteps != 0) { - NumSteps = other.NumSteps; - } - if (other.StartupDelaySteps != 0F) { - StartupDelaySteps = other.StartupDelaySteps; - } - if (other.BiasGradMultiplier != 0F) { - BiasGradMultiplier = other.BiasGradMultiplier; - } - updateTrainableVariables_.Add(other.updateTrainableVariables_); - freezeVariables_.Add(other.freezeVariables_); - if (other.ReplicasToAggregate != 0) { - ReplicasToAggregate = other.ReplicasToAggregate; - } - if (other.BatchQueueCapacity != 0) { - BatchQueueCapacity = other.BatchQueueCapacity; - } - if (other.NumBatchQueueThreads != 0) { - NumBatchQueueThreads = other.NumBatchQueueThreads; - } - if (other.PrefetchQueueCapacity != 0) { - PrefetchQueueCapacity = other.PrefetchQueueCapacity; - } - if (other.MergeMultipleLabelBoxes != false) { - MergeMultipleLabelBoxes = other.MergeMultipleLabelBoxes; - } - if (other.UseMulticlassScores != false) { - UseMulticlassScores = other.UseMulticlassScores; - } - if (other.AddRegularizationLoss != false) { - AddRegularizationLoss = other.AddRegularizationLoss; - } - if (other.MaxNumberOfBoxes != 0) { - MaxNumberOfBoxes = other.MaxNumberOfBoxes; - } - if (other.UnpadGroundtruthTensors != false) { - UnpadGroundtruthTensors = other.UnpadGroundtruthTensors; - } - if (other.RetainOriginalImages != false) { - RetainOriginalImages = other.RetainOriginalImages; - } - if (other.UseBfloat16 != false) { - UseBfloat16 = other.UseBfloat16; - } - if (other.SummarizeGradients != false) { - SummarizeGradients = other.SummarizeGradients; - } - _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: { - BatchSize = input.ReadUInt32(); - break; - } - case 18: { - dataAugmentationOptions_.AddEntriesFrom(input, _repeated_dataAugmentationOptions_codec); - break; - } - case 24: { - SyncReplicas = input.ReadBool(); - break; - } - case 37: { - KeepCheckpointEveryNHours = input.ReadFloat(); - break; - } - case 42: { - if (optimizer_ == null) { - optimizer_ = new global::Tensorflow.Models.ObjectDetection.Protos.Optimizer(); - } - input.ReadMessage(optimizer_); - break; - } - case 53: { - GradientClippingByNorm = input.ReadFloat(); - break; - } - case 58: { - FineTuneCheckpoint = input.ReadString(); - break; - } - case 64: { - FromDetectionCheckpoint = input.ReadBool(); - break; - } - case 72: { - NumSteps = input.ReadUInt32(); - break; - } - case 85: { - StartupDelaySteps = input.ReadFloat(); - break; - } - case 93: { - BiasGradMultiplier = input.ReadFloat(); - break; - } - case 98: { - freezeVariables_.AddEntriesFrom(input, _repeated_freezeVariables_codec); - break; - } - case 104: { - ReplicasToAggregate = input.ReadInt32(); - break; - } - case 112: { - BatchQueueCapacity = input.ReadInt32(); - break; - } - case 120: { - NumBatchQueueThreads = input.ReadInt32(); - break; - } - case 128: { - PrefetchQueueCapacity = input.ReadInt32(); - break; - } - case 136: { - MergeMultipleLabelBoxes = input.ReadBool(); - break; - } - case 144: { - AddRegularizationLoss = input.ReadBool(); - break; - } - case 152: { - LoadAllDetectionCheckpointVars = input.ReadBool(); - break; - } - case 160: { - MaxNumberOfBoxes = input.ReadInt32(); - break; - } - case 168: { - UnpadGroundtruthTensors = input.ReadBool(); - break; - } - case 178: { - FineTuneCheckpointType = input.ReadString(); - break; - } - case 184: { - RetainOriginalImages = input.ReadBool(); - break; - } - case 192: { - UseMulticlassScores = input.ReadBool(); - break; - } - case 202: { - updateTrainableVariables_.AddEntriesFrom(input, _repeated_updateTrainableVariables_codec); - break; - } - case 208: { - UseBfloat16 = input.ReadBool(); - break; - } - case 216: { - SummarizeGradients = input.ReadBool(); - break; - } - } - } - } - - } - - #endregion - -} - -#endregion Designer generated code diff --git a/src/TensorFlowNET.Models/ObjectDetection/Utils/ConfigUtil.cs b/src/TensorFlowNET.Models/ObjectDetection/Utils/ConfigUtil.cs deleted file mode 100644 index 2a6a672e..00000000 --- a/src/TensorFlowNET.Models/ObjectDetection/Utils/ConfigUtil.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Protobuf.Text; -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using Tensorflow.Models.ObjectDetection.Protos; - -namespace Tensorflow.Models.ObjectDetection.Utils -{ - public class ConfigUtil - { - public static TrainEvalPipelineConfig get_configs_from_pipeline_file(string pipeline_config_path) - { - var config = File.ReadAllText(pipeline_config_path); - var pipeline_config = TrainEvalPipelineConfig.Parser.ParseText(config); - - return pipeline_config; - } - - public static ImageResizer get_image_resizer_config(DetectionModel model_config) - { - var meta_architecture = model_config.ModelCase; - - if (meta_architecture == DetectionModel.ModelOneofCase.FasterRcnn) - return model_config.FasterRcnn.ImageResizer; - else if (meta_architecture == DetectionModel.ModelOneofCase.Ssd) - return model_config.Ssd.ImageResizer; - - throw new Exception($"Unknown model type: {meta_architecture}"); - } - - public static (int, int) get_spatial_image_size(ImageResizer image_resizer_config) - { - if (image_resizer_config.ImageResizerOneofCase == ImageResizer.ImageResizerOneofOneofCase.FixedShapeResizer) - return (image_resizer_config.FixedShapeResizer.Height, image_resizer_config.FixedShapeResizer.Width); - else if (image_resizer_config.ImageResizerOneofCase == ImageResizer.ImageResizerOneofOneofCase.KeepAspectRatioResizer) - { - if (image_resizer_config.KeepAspectRatioResizer.PadToMaxDimension) - return (image_resizer_config.KeepAspectRatioResizer.MaxDimension, image_resizer_config.KeepAspectRatioResizer.MaxDimension); - else - return (-1, -1); - } - else if (image_resizer_config.ImageResizerOneofCase == ImageResizer.ImageResizerOneofOneofCase.IdentityResizer - || image_resizer_config.ImageResizerOneofCase == ImageResizer.ImageResizerOneofOneofCase.ConditionalShapeResizer) - { - return (-1, -1); - } - - throw new Exception("Unknown image resizer type."); - } - - public static Dictionary create_configs_from_pipeline_proto(TrainEvalPipelineConfig pipeline_config) - { - var configs = new Dictionary(StringComparer.OrdinalIgnoreCase); - - configs["model"] = pipeline_config.Model; - configs["train_config"] = pipeline_config.TrainConfig; - configs["train_input_config"] = pipeline_config.TrainInputReader; - configs["eval_config"] = pipeline_config.EvalConfig; - configs["eval_input_configs"] = pipeline_config.EvalInputReader; - - //# Keeps eval_input_config only for backwards compatibility. All clients should - //# read eval_input_configs instead. - if (pipeline_config.EvalInputReader != null && pipeline_config.EvalInputReader.Count > 0) - configs["eval_input_config"] = pipeline_config.EvalInputReader[0]; - - if (pipeline_config.GraphRewriter != null) - configs["graph_rewriter_config"] = pipeline_config.GraphRewriter; - - return configs; - } - - public static GraphRewriter get_graph_rewriter_config_from_file(string graph_rewriter_config_file) - { - throw new NotImplementedException(); - } - - public static int get_number_of_classes(DetectionModel model_config) - { - var meta_architecture = model_config.ModelCase; - - if (meta_architecture == DetectionModel.ModelOneofCase.FasterRcnn) - return model_config.FasterRcnn.NumClasses; - - if (meta_architecture == DetectionModel.ModelOneofCase.Ssd) - return model_config.Ssd.NumClasses; - - throw new Exception("Expected the model to be one of 'faster_rcnn' or 'ssd'."); - } - - public static Protos.Optimizer.OptimizerOneofCase get_optimizer_type(TrainConfig train_config) - { - return train_config.Optimizer.OptimizerCase; - } - - public static string get_learning_rate_type(Optimizer optimizer_config) - { - throw new NotImplementedException(); - } - } -} diff --git a/src/TensorFlowNET.Models/Slim/Nets/ResNetV1.cs b/src/TensorFlowNET.Models/Slim/Nets/ResNetV1.cs deleted file mode 100644 index 1d949434..00000000 --- a/src/TensorFlowNET.Models/Slim/Nets/ResNetV1.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Models.Slim.Nets -{ - public class ResNetV1 - { - public static void resnet_v1_101() - { - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Models/TensorFlowNET.Models.csproj b/src/TensorFlowNET.Models/TensorFlowNET.Models.csproj deleted file mode 100644 index aae55be9..00000000 --- a/src/TensorFlowNET.Models/TensorFlowNET.Models.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - netcoreapp2.2 - TensorFlow.Models - Tensorflow.Models - 0.0.1 - Haiping Chen - SciSharp STACK - https://github.com/SciSharp/TensorFlow.NET - https://github.com/SciSharp/TensorFlow.NET - git - TensorFlow - Models and examples built with TensorFlow. - true - Apache2 - - - - - - - - - PreserveNewest - - - - - - - - - - - - diff --git a/src/TensorFlowNET.Text/README.md b/src/TensorFlowNET.Text/README.md deleted file mode 100644 index 2d82ea9d..00000000 --- a/src/TensorFlowNET.Text/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# TensorFlow Text - Text processing in Tensorflow - -TensorFlow Text provides a collection of text related classes and ops ready to use with TensorFlow 2.0. The library can perform the preprocessing regularly required by text-based models, and includes other features useful for sequence modeling not provided by core TensorFlow. - -The benefit of using these ops in your text preprocessing is that they are done in the TensorFlow graph. You do not need to worry about tokenization in training being different than the tokenization at inference, or managing preprocessing scripts. - - - -https://github.com/tensorflow/text \ No newline at end of file diff --git a/src/TensorFlowNET.Text/TensorFlowNET.Text.csproj b/src/TensorFlowNET.Text/TensorFlowNET.Text.csproj deleted file mode 100644 index 89ec8dd4..00000000 --- a/src/TensorFlowNET.Text/TensorFlowNET.Text.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - netcoreapp2.2 - true - SciSharp.TensorFlowText - 0.0.1 - Haiping Chen - SciSharp STACK - TensorFlowText - TensorFlow Text provides a collection of text related classes and ops ready to use with TensorFlow 2.0. The library can perform the preprocessing regularly required by text-based models, and includes other features useful for sequence modeling not provided by core TensorFlow. - Apache 2.0 - http://scisharpstack.org - https://github.com/SciSharp/TensorFlow.NET - TensorFlow, SciSharp - git - https://avatars3.githubusercontent.com/u/44989469?s=200&v=4 - TensorFlow.Text - TensorFlow.Text - - - diff --git a/src/TensorFlowNET.Text/Tokenizer.cs b/src/TensorFlowNET.Text/Tokenizer.cs deleted file mode 100644 index 5621bcf7..00000000 --- a/src/TensorFlowNET.Text/Tokenizer.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace TensorFlowText -{ - public class Tokenizer - { - } -} diff --git a/src/TensorFlowNet.Benchmarks/Benchmark.csproj b/src/TensorFlowNet.Benchmarks/Benchmark.csproj new file mode 100644 index 00000000..0dcc771f --- /dev/null +++ b/src/TensorFlowNet.Benchmarks/Benchmark.csproj @@ -0,0 +1,21 @@ + + + + Exe + netcoreapp2.2 + + + + true + + + + + + + + + + + + diff --git a/src/TensorFlowNet.Benchmarks/Program.cs b/src/TensorFlowNet.Benchmarks/Program.cs new file mode 100644 index 00000000..01af9a48 --- /dev/null +++ b/src/TensorFlowNet.Benchmarks/Program.cs @@ -0,0 +1,29 @@ +using System; +using System.Reflection; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Running; + +namespace TensorFlowBenchmark +{ + class Program + { + static void Main(string[] args) + { + if (args?.Length > 0) + { + for (int i = 0; i < args.Length; i++) + { + string name = $"TensorFlowBenchmark.{args[i]}"; + var type = Type.GetType(name); + BenchmarkRunner.Run(type); + } + } + else + { + BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args, ManualConfig.Create(DefaultConfig.Instance).With(ConfigOptions.DisableOptimizationsValidator)); + } + + Console.ReadLine(); + } + } +} diff --git a/src/TensorFlowNet.Benchmarks/TensorBenchmark.cs b/src/TensorFlowNet.Benchmarks/TensorBenchmark.cs new file mode 100644 index 00000000..f1ce2012 --- /dev/null +++ b/src/TensorFlowNet.Benchmarks/TensorBenchmark.cs @@ -0,0 +1,88 @@ +using System; +using BenchmarkDotNet.Attributes; +using NumSharp; +using Tensorflow; +using static Tensorflow.Binding; + +namespace TensorFlowBenchmark +{ + [SimpleJob(launchCount: 1, warmupCount: 2, targetCount: 10)] + [MinColumn, MaxColumn, MeanColumn, MedianColumn] + public class TensorBenchmark + { + private double[] data; + + [GlobalSetup] + public void Setup() + { + data = new double[100]; + } + + [Benchmark] + public void ScalarTensor() + { + var g = new Graph(); + for (int i = 0; i < 100; i++) + { + using (var tensor = new Tensor(17.0)) + { + + } + } + } + + [Benchmark] + public unsafe void TensorFromFixedPtr() + { + var g = new Graph(); + for (int i = 0; i < 100; i++) + { + fixed (double* ptr = &data[0]) + { + using (var t = new Tensor((IntPtr)ptr, new long[] { data.Length }, tf.float64, 8 * data.Length)) + { + } + } + } + } + + [Benchmark] + public void TensorFromArray() + { + var g=new Graph(); + for (int i = 0; i < 100; i++) + { + using (var tensor = new Tensor(data)) + { + + } + } + } + + + [Benchmark] + public void TensorFromNDArray() + { + var g = new Graph(); + for (int i = 0; i < 1000; i++) + { + using (var tensor = new Tensor(new NDArray(data))) + { + + } + } + } + + //[Benchmark] + //public void Constant() + //{ + // for (int i = 0; i < 100; i++) + // { + // //var tensor = new Tensor(new NDArray(data)); + // var c = tf.constant(42.0); + // } + //} + + } +} + diff --git a/src/TensorFlowNet.Benchmarks/Unmanaged/StructCastBenchmark.cs b/src/TensorFlowNet.Benchmarks/Unmanaged/StructCastBenchmark.cs new file mode 100644 index 00000000..5b3a0cd3 --- /dev/null +++ b/src/TensorFlowNet.Benchmarks/Unmanaged/StructCastBenchmark.cs @@ -0,0 +1,76 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using BenchmarkDotNet.Attributes; +using Google.Protobuf.WellKnownTypes; +using NumSharp; +using Tensorflow; +using static Tensorflow.Binding; + +namespace TensorFlowBenchmark.Unmanaged +{ + public struct UnmanagedStruct + { + public int a; + public long b; + public UnmanagedStruct(int _) + { + a = 2; + b = 3; + } + } + + [SimpleJob(launchCount: 1, warmupCount: 2, targetCount: 10)] + [MinColumn, MaxColumn, MeanColumn, MedianColumn] + public unsafe class StructCastBenchmark + { + private static void EnsureIsUnmanaged(T _) where T : unmanaged + { } + + static StructCastBenchmark() //if UnmanagedStruct is not unmanaged struct then this will fail to compile. + => EnsureIsUnmanaged(new UnmanagedStruct()); + + private IntPtr data; + private void* dataptr; + + [GlobalSetup] + public void Setup() + { + data = Marshal.AllocHGlobal(Marshal.SizeOf()); + dataptr = data.ToPointer(); + } + + [Benchmark, MethodImpl(MethodImplOptions.NoOptimization)] + public void Marshal_PtrToStructure() + { + UnmanagedStruct _; + for (int i = 0; i < 10000; i++) + { + _ = Marshal.PtrToStructure(data); + } + } + + [Benchmark, MethodImpl(MethodImplOptions.NoOptimization)] + public void PointerCast() + { + var dptr = dataptr; + UnmanagedStruct _; + for (int i = 0; i < 10000; i++) + { + _ = *(UnmanagedStruct*) dptr; + } + } + + [Benchmark, MethodImpl(MethodImplOptions.NoOptimization)] + public void Unsafe_Read() + { + var dptr = dataptr; + UnmanagedStruct _; + for (int i = 0; i < 10000; i++) + { + _ = Unsafe.Read(dptr); + } + } + + } +} \ No newline at end of file diff --git a/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs b/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs deleted file mode 100644 index fe8b5f78..00000000 --- a/test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Threading.Tasks; -using Tensorflow.Hub; - -namespace TensorFlowNET.UnitTest.Hub -{ - [TestClass] - public class MnistModelLoaderTest - { - [TestMethod] - public async Task TestLoad() - { - var loader = new MnistModelLoader(); - var result = await loader.LoadAsync(new ModelLoadSetting - { - TrainDir = "mnist", - OneHot = true, - ValidationSize = 5000, - }); - - Assert.IsNotNull(result); - } - } -} diff --git a/test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj b/test/TensorFlowNET.UnitTest/UnitTest.csproj similarity index 78% rename from test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj rename to test/TensorFlowNET.UnitTest/UnitTest.csproj index 6cc1a87d..7e00bc1d 100644 --- a/test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj +++ b/test/TensorFlowNET.UnitTest/UnitTest.csproj @@ -36,11 +36,7 @@ - - - - - + From 59421ed6d0491d5a52c306b805797e818e4628d9 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 13 Nov 2019 09:50:07 -0600 Subject: [PATCH 12/24] upgrade Google.Protobuf to 3.10.1 --- src/TensorFlowNET.Core/Graphs/Graph.cs | 4 ---- src/TensorFlowNET.Core/TensorFlow.Binding.csproj | 5 ++--- test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs | 1 + test/TensorFlowNET.UnitTest/img_test/TestCrop.cs | 2 ++ 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index f8746f7f..7ed19439 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -230,10 +230,6 @@ namespace Tensorflow public void add_to_collection(string name, T value) { - if(name == "update_ops") - { - - } _check_not_finalized(); if (_collections.ContainsKey(name)) (_collections[name] as List).Add(value); diff --git a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj index 42eb9d1c..260e8706 100644 --- a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj +++ b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj @@ -34,7 +34,7 @@ https://tensorflownet.readthedocs.io true - TRACE;DEBUG;SERIALIZABLE + TRACE;DEBUG;SERIALIZABLE_ @@ -56,8 +56,7 @@ https://tensorflownet.readthedocs.io - - + diff --git a/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs b/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs index 0168f22c..d3484d5e 100644 --- a/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs +++ b/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs @@ -14,6 +14,7 @@ namespace TensorFlowNET.UnitTest.Keras [TestClass] public class EmbeddingTest { + [Ignore] [TestMethod] public void Embedding() { diff --git a/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs b/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs index 115c74db..02882065 100644 --- a/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs +++ b/test/TensorFlowNET.UnitTest/img_test/TestCrop.cs @@ -13,6 +13,8 @@ namespace TensorFlowNET.UnitTest.img_test [TestMethod] public void TestCropAndResize() { + var graph = tf.Graph().as_default(); + // 3x3 'Image' with numbered coordinates var input = np.array(0f, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f); var image = tf.reshape(input, new int[] { 1, 3, 3, 1 }); From cad766bcd5edaa61f0ca90ce6802263364da4244 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 13 Nov 2019 11:56:00 -0600 Subject: [PATCH 13/24] remove estimator. --- src/TensorFlowNET.Core/APIs/tf.estimator.cs | 61 -------- .../Estimators/Estimator.cs | 147 ------------------ .../Estimators/EstimatorSpec.cs | 16 -- .../Estimators/EstimatorUtil.cs | 15 -- src/TensorFlowNET.Core/Estimators/EvalSpec.cs | 16 -- .../Estimators/Experimental.cs | 61 -------- src/TensorFlowNET.Core/Estimators/Exporter.cs | 11 -- .../Estimators/FinalExporter.cs | 14 -- .../Estimators/HyperParams.cs | 89 ----------- .../Estimators/IEstimatorInputs.cs | 12 -- src/TensorFlowNET.Core/Estimators/README.md | 7 - .../Estimators/RunConfig.cs | 103 ------------ .../Estimators/TrainSpec.cs | 22 --- src/TensorFlowNET.Core/Estimators/Training.cs | 17 -- .../Estimators/_Evaluator.cs | 14 -- .../_NewCheckpointListenerForEvaluate.cs | 16 -- .../Estimators/_SavedModelExporter.cs | 14 -- .../Estimators/_TrainingExecutor.cs | 48 ------ .../Operations/Operation.cs | 5 - .../TensorFlow.Binding.csproj | 9 +- .../Estimators/RunConfigTest.cs | 64 -------- 21 files changed, 7 insertions(+), 754 deletions(-) delete mode 100644 src/TensorFlowNET.Core/APIs/tf.estimator.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/Estimator.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/EstimatorUtil.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/EvalSpec.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/Experimental.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/Exporter.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/FinalExporter.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/HyperParams.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/README.md delete mode 100644 src/TensorFlowNET.Core/Estimators/RunConfig.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/TrainSpec.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/Training.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/_Evaluator.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs delete mode 100644 src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs delete mode 100644 test/TensorFlowNET.UnitTest/Estimators/RunConfigTest.cs diff --git a/src/TensorFlowNET.Core/APIs/tf.estimator.cs b/src/TensorFlowNET.Core/APIs/tf.estimator.cs deleted file mode 100644 index 15668837..00000000 --- a/src/TensorFlowNET.Core/APIs/tf.estimator.cs +++ /dev/null @@ -1,61 +0,0 @@ -/***************************************************************************** - Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -******************************************************************************/ - -using System; -using static Tensorflow.Binding; -using Tensorflow.Estimators; -using Tensorflow.Data; - -namespace Tensorflow -{ - public partial class tensorflow - { - public Estimator_Internal estimator { get; } = new Estimator_Internal(); - - public class Estimator_Internal - { - public Experimental experimental { get; } = new Experimental(); - public Estimator Estimator(Func model_fn, - string model_dir = null, - RunConfig config = null, - Thyp hyperParams = default) - => new Estimator(model_fn: model_fn, model_dir: model_dir, config: config, hyperParams: hyperParams); - - public RunConfig RunConfig(string model_dir = null, int save_checkpoints_secs = 180) - => new RunConfig(model_dir: model_dir, save_checkpoints_secs: save_checkpoints_secs); - - public void train_and_evaluate(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) - => Training.train_and_evaluate(estimator: estimator, train_spec: train_spec, eval_spec: eval_spec); - - public TrainSpec TrainSpec(Func input_fn, int max_steps) - => new TrainSpec(input_fn: input_fn, max_steps: max_steps); - - /// - /// Create an `Exporter` to use with `tf.estimator.EvalSpec`. - /// - /// - /// - /// - /// - public FinalExporter FinalExporter(string name, Action serving_input_receiver_fn, bool as_text = false) - => new FinalExporter(name: name, serving_input_receiver_fn: serving_input_receiver_fn, - as_text: as_text); - - public EvalSpec EvalSpec(string name, Action input_fn, FinalExporter exporters) - => new EvalSpec(name: name, input_fn: input_fn, exporters: exporters); - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/Estimator.cs b/src/TensorFlowNET.Core/Estimators/Estimator.cs deleted file mode 100644 index 9ee9d122..00000000 --- a/src/TensorFlowNET.Core/Estimators/Estimator.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text; -using Tensorflow.Data; -using Tensorflow.Train; -using static Tensorflow.Binding; - -namespace Tensorflow.Estimators -{ - /// - /// Estimator class to train and evaluate TensorFlow models. - /// - public class Estimator : IObjectLife - { - RunConfig _config; - public RunConfig config => _config; - - ConfigProto _session_config; - public ConfigProto session_config => _session_config; - - Func _model_fn; - - Thyp _hyperParams; - - public Estimator(Func model_fn, - string model_dir, - RunConfig config, - Thyp hyperParams) - { - _config = config; - _config.model_dir = config.model_dir ?? model_dir; - _session_config = config.session_config; - _model_fn = model_fn; - _hyperParams = hyperParams; - } - - public Estimator train(Func input_fn, int max_steps = 1, Action[] hooks = null, - _NewCheckpointListenerForEvaluate[] saving_listeners = null) - { - if(max_steps > 0) - { - var start_step = _load_global_step_from_checkpoint_dir(_config.model_dir); - if (max_steps <= start_step) - { - Console.WriteLine("Skipping training since max_steps has already saved."); - return this; - } - } - - var loss = _train_model(input_fn); - print($"Loss for final step: {loss}."); - return this; - } - - private int _load_global_step_from_checkpoint_dir(string checkpoint_dir) - { - // var cp = tf.train.latest_checkpoint(checkpoint_dir); - // should use NewCheckpointReader (not implemented) - var cp = tf.train.get_checkpoint_state(checkpoint_dir); - - return cp.AllModelCheckpointPaths.Count - 1; - } - - private Tensor _train_model(Func input_fn) - { - return _train_model_default(input_fn); - } - - private Tensor _train_model_default(Func input_fn) - { - using (var g = tf.Graph().as_default()) - { - var global_step_tensor = _create_and_assert_global_step(g); - - // Skip creating a read variable if _create_and_assert_global_step - // returns None (e.g. tf.contrib.estimator.SavedModelEstimator). - if (global_step_tensor != null) - TrainingUtil._get_or_create_global_step_read(g); - - var (features, labels) = _get_features_and_labels_from_input_fn(input_fn, "train"); - } - - throw new NotImplementedException(""); - } - - private (Dictionary, Dictionary) _get_features_and_labels_from_input_fn(Func input_fn, string mode) - { - var result = _call_input_fn(input_fn, mode); - return EstimatorUtil.parse_input_fn_result(result); - } - - /// - /// Calls the input function. - /// - /// - /// - private DatasetV1Adapter _call_input_fn(Func input_fn, string mode) - { - return input_fn(); - } - - private Tensor _create_and_assert_global_step(Graph graph) - { - var step = _create_global_step(graph); - Debug.Assert(step == tf.train.get_global_step(graph)); - Debug.Assert(step.dtype.is_integer()); - return step; - } - - private RefVariable _create_global_step(Graph graph) - { - return tf.train.create_global_step(graph); - } - - public string eval_dir(string name = null) - { - return Path.Combine(config.model_dir, string.IsNullOrEmpty(name) ? "eval" : $"eval_" + name); - } - - public void __init__() - { - throw new NotImplementedException(); - } - - public void __enter__() - { - throw new NotImplementedException(); - } - - public void __del__() - { - throw new NotImplementedException(); - } - - public void __exit__() - { - throw new NotImplementedException(); - } - - public void Dispose() - { - - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs b/src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs deleted file mode 100644 index 7b72f9db..00000000 --- a/src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tensorflow.Estimators -{ - public class EstimatorSpec - { - public EstimatorSpec(Operation train_op) - { - - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/EstimatorUtil.cs b/src/TensorFlowNET.Core/Estimators/EstimatorUtil.cs deleted file mode 100644 index df1fb38b..00000000 --- a/src/TensorFlowNET.Core/Estimators/EstimatorUtil.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Data; - -namespace Tensorflow.Estimators -{ - public class EstimatorUtil - { - public static (Dictionary, Dictionary) parse_input_fn_result(DatasetV1Adapter result) - { - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/EvalSpec.cs b/src/TensorFlowNET.Core/Estimators/EvalSpec.cs deleted file mode 100644 index c5a5820e..00000000 --- a/src/TensorFlowNET.Core/Estimators/EvalSpec.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public class EvalSpec - { - string _name; - - public EvalSpec(string name, Action input_fn, FinalExporter exporters) - { - _name = name; - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/Experimental.cs b/src/TensorFlowNET.Core/Estimators/Experimental.cs deleted file mode 100644 index 9e377ffa..00000000 --- a/src/TensorFlowNET.Core/Estimators/Experimental.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tensorflow.Estimators -{ - public class Experimental - { - /// - /// Creates hook to stop if metric does not increase within given max steps. - /// - /// type of hyper parameters - /// - /// - /// - /// - /// - /// - /// - /// - public object stop_if_no_increase_hook(Estimator estimator, - string metric_name, - int max_steps_without_increase, - string eval_dir = null, - int min_steps = 0, - int run_every_secs = 60, - int run_every_steps = 0) - => _stop_if_no_metric_improvement_hook(estimator: estimator, - metric_name: metric_name, - max_steps_without_increase: max_steps_without_increase, - eval_dir: eval_dir, - min_steps: min_steps, - run_every_secs: run_every_secs, - run_every_steps: run_every_steps); - - private object _stop_if_no_metric_improvement_hook(Estimator estimator, - string metric_name, - int max_steps_without_increase, - string eval_dir = null, - int min_steps = 0, - int run_every_secs = 60, - int run_every_steps = 0) - { - eval_dir = eval_dir ?? estimator.eval_dir(); - // var is_lhs_better = higher_is_better ? operator.gt: operator.lt; - Func stop_if_no_metric_improvement_fn = () => - { - return false; - }; - - return make_early_stopping_hook(); - } - - public object make_early_stopping_hook() - { - throw new NotImplementedException(""); - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/Exporter.cs b/src/TensorFlowNET.Core/Estimators/Exporter.cs deleted file mode 100644 index eca09730..00000000 --- a/src/TensorFlowNET.Core/Estimators/Exporter.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public abstract class Exporter - { - public abstract void export(Estimator estimator, string export_path, string checkpoint_path); - } -} diff --git a/src/TensorFlowNET.Core/Estimators/FinalExporter.cs b/src/TensorFlowNET.Core/Estimators/FinalExporter.cs deleted file mode 100644 index af78c2bf..00000000 --- a/src/TensorFlowNET.Core/Estimators/FinalExporter.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public class FinalExporter - { - public FinalExporter(string name, Action serving_input_receiver_fn, bool as_text = false) - { - - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/HyperParams.cs b/src/TensorFlowNET.Core/Estimators/HyperParams.cs deleted file mode 100644 index 0c177cae..00000000 --- a/src/TensorFlowNET.Core/Estimators/HyperParams.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.IO; - -namespace Tensorflow.Estimators -{ - public class HyperParams - { - /// - /// root dir - /// - public string data_root_dir { get; set; } - - /// - /// results dir - /// - public string result_dir { get; set; } = "results"; - - /// - /// model dir - /// - public string model_dir { get; set; } = "model"; - - public string eval_dir { get; set; } = "eval"; - - public string test_dir { get; set; } = "test"; - - public int dim { get; set; } = 300; - public float dropout { get; set; } = 0.5f; - public int num_oov_buckets { get; set; } = 1; - public int epochs { get; set; } = 25; - public int epoch_no_imprv { get; set; } = 3; - public int batch_size { get; set; } = 20; - public int buffer { get; set; } = 15000; - public int lstm_size { get; set; } = 100; - public string lr_method { get; set; } = "adam"; - public float lr { get; set; } = 0.001f; - public float lr_decay { get; set; } = 0.9f; - - /// - /// lstm on chars - /// - public int hidden_size_char { get; set; } = 100; - - /// - /// lstm on word embeddings - /// - public int hidden_size_lstm { get; set; } = 300; - - /// - /// is clipping - /// - public bool clip { get; set; } = false; - - public string filepath_dev { get; set; } - public string filepath_test { get; set; } - public string filepath_train { get; set; } - - public string filepath_words { get; set; } - public string filepath_chars { get; set; } - public string filepath_tags { get; set; } - public string filepath_glove { get; set; } - - public HyperParams(string dataDir) - { - data_root_dir = dataDir; - - if (string.IsNullOrEmpty(data_root_dir)) - throw new ValueError("Please specifiy the root data directory"); - - if (!Directory.Exists(data_root_dir)) - Directory.CreateDirectory(data_root_dir); - - result_dir = Path.Combine(data_root_dir, result_dir); - if (!Directory.Exists(result_dir)) - Directory.CreateDirectory(result_dir); - - model_dir = Path.Combine(result_dir, model_dir); - if (!Directory.Exists(model_dir)) - Directory.CreateDirectory(model_dir); - - test_dir = Path.Combine(result_dir, test_dir); - if (!Directory.Exists(test_dir)) - Directory.CreateDirectory(test_dir); - - eval_dir = Path.Combine(result_dir, eval_dir); - if (!Directory.Exists(eval_dir)) - Directory.CreateDirectory(eval_dir); - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs b/src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs deleted file mode 100644 index fad00d7c..00000000 --- a/src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tensorflow.Estimators -{ - public interface IEstimatorInputs - { - } -} diff --git a/src/TensorFlowNET.Core/Estimators/README.md b/src/TensorFlowNET.Core/Estimators/README.md deleted file mode 100644 index 2dffdfbb..00000000 --- a/src/TensorFlowNET.Core/Estimators/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# TensorFlow Estimator - -TensorFlow Estimator is a high-level TensorFlow API that greatly simplifies machine learning programming. Estimators encapsulate training, evaluation, prediction, and exporting for your model. - - - -https://github.com/tensorflow/estimator \ No newline at end of file diff --git a/src/TensorFlowNET.Core/Estimators/RunConfig.cs b/src/TensorFlowNET.Core/Estimators/RunConfig.cs deleted file mode 100644 index 8d2e0ad3..00000000 --- a/src/TensorFlowNET.Core/Estimators/RunConfig.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; - -namespace Tensorflow.Estimators -{ - public class RunConfig - { - // A list of the property names in RunConfig that the user is allowed to change. - private static readonly string[] _DEFAULT_REPLACEABLE_LIST = new [] - { - "model_dir", - "tf_random_seed", - "save_summary_steps", - "save_checkpoints_steps", - "save_checkpoints_secs", - "session_config", - "keep_checkpoint_max", - "keep_checkpoint_every_n_hours", - "log_step_count_steps", - "train_distribute", - "device_fn", - "protocol", - "eval_distribute", - "experimental_distribute", - "experimental_max_worker_delay_secs", - "session_creation_timeout_secs" - }; - - - #region const values - - private const string _SAVE_CKPT_ERR = "`save_checkpoints_steps` and `save_checkpoints_secs` cannot be both set."; - private const string _TF_CONFIG_ENV = "TF_CONFIG"; - private const string _TASK_ENV_KEY = "task"; - private const string _TASK_TYPE_KEY = "type"; - private const string _TASK_ID_KEY = "index"; - private const string _CLUSTER_KEY = "cluster"; - private const string _SERVICE_KEY = "service"; - private const string _SESSION_MASTER_KEY = "session_master"; - private const string _EVAL_SESSION_MASTER_KEY = "eval_session_master"; - private const string _MODEL_DIR_KEY = "model_dir"; - private const string _LOCAL_MASTER = ""; - private const string _GRPC_SCHEME = "grpc://"; - - #endregion - - public string model_dir { get; set; } - public ConfigProto session_config { get; set; } - public int? tf_random_seed { get; set; } - public int save_summary_steps { get; set; } = 100; - public int save_checkpoints_steps { get; set; } - public int save_checkpoints_secs { get; set; } = 600; - public int keep_checkpoint_max { get; set; } = 5; - public int keep_checkpoint_every_n_hours { get; set; } = 10000; - public int log_step_count_steps{ get; set; } = 100; - public object train_distribute { get; set; } - public object device_fn { get; set; } - public object protocol { get; set; } - public object eval_distribute { get; set; } - public object experimental_distribute { get; set; } - public object experimental_max_worker_delay_secs { get; set; } - public int session_creation_timeout_secs { get; set; } = 7200; - public object service { get; set; } - - public RunConfig() - { - Initialize(); - } - - public RunConfig(string model_dir, - int save_checkpoints_secs) - { - this.model_dir = model_dir; - this.save_checkpoints_secs = save_checkpoints_secs; - Initialize(); - } - - public RunConfig( - string model_dir = null, - int? tf_random_seed = null, - int save_summary_steps=100, - object save_checkpoints_steps = null, // _USE_DEFAULT - object save_checkpoints_secs = null, // _USE_DEFAULT - object session_config = null, - int keep_checkpoint_max = 5, - int keep_checkpoint_every_n_hours = 10000, - int log_step_count_steps = 100, - object train_distribute = null, - object device_fn = null, - object protocol = null, - object eval_distribute = null, - object experimental_distribute = null, - object experimental_max_worker_delay_secs = null, - int session_creation_timeout_secs = 7200) - { - this.model_dir = model_dir; - Initialize(); - } - - private void Initialize() - { - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/TrainSpec.cs b/src/TensorFlowNET.Core/Estimators/TrainSpec.cs deleted file mode 100644 index c2993684..00000000 --- a/src/TensorFlowNET.Core/Estimators/TrainSpec.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Tensorflow.Data; - -namespace Tensorflow.Estimators -{ - public class TrainSpec - { - int _max_steps; - public int max_steps => _max_steps; - - Func _input_fn; - public Func input_fn => _input_fn; - - public TrainSpec(Func input_fn, int max_steps) - { - _max_steps = max_steps; - _input_fn = input_fn; - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/Training.cs b/src/TensorFlowNET.Core/Estimators/Training.cs deleted file mode 100644 index 8704e2a7..00000000 --- a/src/TensorFlowNET.Core/Estimators/Training.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public class Training - { - public static void train_and_evaluate(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) - { - var executor = new _TrainingExecutor(estimator: estimator, train_spec: train_spec, eval_spec: eval_spec); - var config = estimator.config; - - executor.run(); - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/_Evaluator.cs b/src/TensorFlowNET.Core/Estimators/_Evaluator.cs deleted file mode 100644 index 190bb0e9..00000000 --- a/src/TensorFlowNET.Core/Estimators/_Evaluator.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public class _Evaluator - { - public _Evaluator(Estimator estimator, EvalSpec eval_spec, int max_training_steps) - { - - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs b/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs deleted file mode 100644 index fe391a03..00000000 --- a/src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public class _NewCheckpointListenerForEvaluate - { - _Evaluator _evaluator; - - public _NewCheckpointListenerForEvaluate(_Evaluator evaluator, int eval_throttle_secs) - { - _evaluator = evaluator; - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs b/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs deleted file mode 100644 index cce2e0c0..00000000 --- a/src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - public class _SavedModelExporter : Exporter - { - public override void export(Estimator estimator, string export_path, string checkpoint_path) - { - - } - } -} diff --git a/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs b/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs deleted file mode 100644 index 34b879d7..00000000 --- a/src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tensorflow.Estimators -{ - /// - /// The executor to run `Estimator` training and evaluation. - /// - internal class _TrainingExecutor - { - Estimator _estimator; - EvalSpec _eval_spec; - TrainSpec _train_spec; - - public _TrainingExecutor(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec) - { - _estimator = estimator; - _train_spec = train_spec; - _eval_spec = eval_spec; - } - - public void run() - { - var config = _estimator.config; - Console.WriteLine("Running training and evaluation locally (non-distributed)."); - run_local(); - } - - /// - /// Runs training and evaluation locally (non-distributed). - /// - private void run_local() - { - var train_hooks = new Action[0]; - Console.WriteLine("Start train and evaluate loop. The evaluate will happen " + - "after every checkpoint. Checkpoint frequency is determined " + - $"based on RunConfig arguments: save_checkpoints_steps {_estimator.config.save_checkpoints_steps} or " + - $"save_checkpoints_secs {_estimator.config.save_checkpoints_secs}."); - var evaluator = new _Evaluator(_estimator, _eval_spec, _train_spec.max_steps); - var saving_listeners = new _NewCheckpointListenerForEvaluate[0]; - _estimator.train(input_fn: _train_spec.input_fn, - max_steps: _train_spec.max_steps, - hooks: train_hooks, - saving_listeners: saving_listeners); - } - } -} diff --git a/src/TensorFlowNET.Core/Operations/Operation.cs b/src/TensorFlowNET.Core/Operations/Operation.cs index 0ee72c39..359dc870 100644 --- a/src/TensorFlowNET.Core/Operations/Operation.cs +++ b/src/TensorFlowNET.Core/Operations/Operation.cs @@ -186,11 +186,6 @@ namespace Tensorflow if (op_def == null) op_def = g.GetOpDef(node_def.Op); - if (node_def.Name.Equals("learn_rate/cond/pred_id")) - { - - } - var grouped_inputs = _reconstruct_sequence_inputs(op_def, inputs, node_def.Attr); _handle = ops._create_c_op(g, node_def, grouped_inputs, control_input_ops.ToArray()); _is_stateful = op_def.IsStateful; diff --git a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj index 260e8706..712e4aed 100644 --- a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj +++ b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj @@ -42,8 +42,14 @@ https://tensorflownet.readthedocs.io + + + + + + True @@ -61,8 +67,7 @@ https://tensorflownet.readthedocs.io - + - diff --git a/test/TensorFlowNET.UnitTest/Estimators/RunConfigTest.cs b/test/TensorFlowNET.UnitTest/Estimators/RunConfigTest.cs deleted file mode 100644 index 66cb48e3..00000000 --- a/test/TensorFlowNET.UnitTest/Estimators/RunConfigTest.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using Tensorflow; -using Tensorflow.Eager; -using Tensorflow.Estimators; - -namespace TensorFlowNET.UnitTest.Estimators -{ - /// - /// estimator/tensorflow_estimator/python/estimator/run_config_test.py - /// - [TestClass] - public class RunConfigTest - { - private static readonly string _TEST_DIR = "test_dir"; - private static readonly string _MASTER = "master_"; - private static readonly string _NOT_SUPPORTED_REPLACE_PROPERTY_MSG = "Replacing .*is not supported"; - private static readonly string _SAVE_CKPT_ERR = "`save_checkpoints_steps` and `save_checkpoints_secs` cannot be both set."; - private static readonly string _MODEL_DIR_ERR = "model_dir should be non-empty"; - private static readonly string _MODEL_DIR_TF_CONFIG_ERR = "model_dir in TF_CONFIG should be non-empty"; - private static readonly string _MODEL_DIR_MISMATCH_ERR = "`model_dir` provided in RunConfig construct, if set, must have the same value as the model_dir in TF_CONFIG. "; - private static readonly string _SAVE_SUMMARY_STEPS_ERR = "save_summary_steps should be >= 0"; - private static readonly string _SAVE_CKPT_STEPS_ERR = "save_checkpoints_steps should be >= 0"; - private static readonly string _SAVE_CKPT_SECS_ERR = "save_checkpoints_secs should be >= 0"; - private static readonly string _SESSION_CONFIG_ERR = "session_config must be instance of ConfigProto"; - private static readonly string _KEEP_CKPT_MAX_ERR = "keep_checkpoint_max should be >= 0"; - private static readonly string _KEEP_CKPT_HOURS_ERR = "keep_checkpoint_every_n_hours should be > 0"; - private static readonly string _TF_RANDOM_SEED_ERR = "tf_random_seed must be integer"; - private static readonly string _DEVICE_FN_ERR = "device_fn must be callable with exactly one argument \"op\"."; - private static readonly string _ONE_CHIEF_ERR = "The \"cluster\" in TF_CONFIG must have only one \"chief\" node."; - private static readonly string _ONE_MASTER_ERR = "The \"cluster\" in TF_CONFIG must have only one \"master\" node."; - private static readonly string _MISSING_CHIEF_ERR = "If \"cluster\" is set .* it must have one \"chief\" node"; - private static readonly string _MISSING_TASK_TYPE_ERR = "If \"cluster\" is set .* task type must be set"; - private static readonly string _MISSING_TASK_ID_ERR = "If \"cluster\" is set .* task index must be set"; - private static readonly string _INVALID_TASK_INDEX_ERR = "is not a valid task_id"; - private static readonly string _NEGATIVE_TASK_INDEX_ERR = "Task index must be non-negative number."; - private static readonly string _INVALID_TASK_TYPE_ERR = "is not a valid task_type"; - private static readonly string _INVALID_TASK_TYPE_FOR_LOCAL_ERR = "If \"cluster\" is not set in TF_CONFIG, task type must be WORKER."; - private static readonly string _INVALID_TASK_INDEX_FOR_LOCAL_ERR = "If \"cluster\" is not set in TF_CONFIG, task index must be 0."; - private static readonly string _INVALID_EVALUATOR_IN_CLUSTER_WITH_MASTER_ERR = "If `master` node exists in `cluster`, task_type `evaluator` is not supported."; - private static readonly string _INVALID_CHIEF_IN_CLUSTER_WITH_MASTER_ERR = "If `master` node exists in `cluster`, job `chief` is not supported."; - private static readonly string _INVALID_SERVICE_TYPE_ERR = "If \"service\" is set in TF_CONFIG, it must be a dict. Given"; - private static readonly string _EXPERIMENTAL_MAX_WORKER_DELAY_SECS_ERR = "experimental_max_worker_delay_secs must be an integer if set."; - private static readonly string _SESSION_CREATION_TIMEOUT_SECS_ERR = "session_creation_timeout_secs should be > 0"; - - [TestMethod] - public void test_default_property_values() - { - var config = new RunConfig(); - - Assert.IsNull(config.model_dir); - Assert.IsNull(config.session_config); - Assert.IsNull(config.tf_random_seed); - Assert.AreEqual(100, config.save_summary_steps); - Assert.AreEqual(600, config.save_checkpoints_secs); - Assert.AreEqual(5, config.keep_checkpoint_max); - Assert.AreEqual(10000, config.keep_checkpoint_every_n_hours); - Assert.IsNull(config.service); - Assert.IsNull(config.device_fn); - Assert.IsNull(config.experimental_max_worker_delay_secs); - Assert.AreEqual(7200, config.session_creation_timeout_secs); - } - } -} From b87081cc4ac47dd3ad28f40cd899a228c0fc3552 Mon Sep 17 00:00:00 2001 From: "Mascha, Philipp" Date: Thu, 14 Nov 2019 14:07:59 +0100 Subject: [PATCH 14/24] Made internal collection of graph a list. --- src/TensorFlowNET.Core/APIs/tf.variable.cs | 4 +- .../Framework/meta_graph.cs | 30 ++++----- src/TensorFlowNET.Core/Graphs/Graph.cs | 67 ++++++------------- src/TensorFlowNET.Core/Summaries/Summary.cs | 7 +- .../Variables/variable_scope.py.cs | 43 +++++------- .../Variables/variables.py.cs | 12 +--- src/TensorFlowNET.Core/ops.cs | 2 +- .../Keras/EmbeddingTest.cs | 1 - test/TensorFlowNET.UnitTest/VariableTest.cs | 5 +- 9 files changed, 61 insertions(+), 110 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.variable.cs b/src/TensorFlowNET.Core/APIs/tf.variable.cs index 179cedee..1d07747b 100644 --- a/src/TensorFlowNET.Core/APIs/tf.variable.cs +++ b/src/TensorFlowNET.Core/APIs/tf.variable.cs @@ -23,14 +23,14 @@ namespace Tensorflow { public VariableV1[] global_variables(string scope = null) { - return (ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope) as List) + return (ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope)) .ToArray(); } public Operation global_variables_initializer() { var g = variables.global_variables(); - return variables.variables_initializer(g.ToArray()); + return variables.variables_initializer(g?.ToArray()); } /// diff --git a/src/TensorFlowNET.Core/Framework/meta_graph.cs b/src/TensorFlowNET.Core/Framework/meta_graph.cs index 05092581..21684001 100644 --- a/src/TensorFlowNET.Core/Framework/meta_graph.cs +++ b/src/TensorFlowNET.Core/Framework/meta_graph.cs @@ -264,26 +264,22 @@ namespace Tensorflow if (!meta_graph_def.CollectionDef.ContainsKey(key)) meta_graph_def.CollectionDef[key] = new CollectionDef(); var col_def = meta_graph_def.CollectionDef[key]; - - switch (graph.get_collection(key)) + col_def.NodeList = new Types.NodeList(); + col_def.BytesList = new Types.BytesList(); + foreach (object value in graph.get_collection(key)) { - case List collection_list: - col_def.BytesList = new Types.BytesList(); - foreach (var x in collection_list) - { + switch (value) + { + case RefVariable x: var proto = x.to_proto(export_scope); col_def.BytesList.Value.Add(proto.ToByteString()); - } - - break; - case List collection_list: - col_def.NodeList = new Types.NodeList(); - foreach (var x in collection_list) - if (x is ITensorOrOperation x2) - col_def.NodeList.Value.Add(ops.strip_name_scope(x2.name, export_scope)); - break; - case List collection_list: - break; + break; + case ITensorOrOperation x2: + col_def.NodeList.Value.Add(ops.strip_name_scope(x2.name, export_scope)); + break; + default: + break; + } } } diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index 7ed19439..29514cd0 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -100,10 +100,12 @@ namespace Tensorflow /// private bool _finalized = false; + /// - /// Arbitrary collections of objects. + /// Arbitrary collections of objects inside the graph. + /// TODO: Access might be slow (-> O(n)) depending on size. /// - private Dictionary _collections = new Dictionary(); + private readonly ICollection<(string name, string scope, object item)> _collections = new List<(string name, string scope, object item)>(); public bool building_function; @@ -228,16 +230,14 @@ namespace Tensorflow throw new Exception($"Can not convert a {obj.GetType().Name} into a {types_str}."); } - public void add_to_collection(string name, T value) + public void add_to_collection(string name, object value) { _check_not_finalized(); - if (_collections.ContainsKey(name)) - (_collections[name] as List).Add(value); - else - _collections[name] = new List { value }; + _collections.Add((name, null, value)); } - public void add_to_collections(List names, T value) + + public void add_to_collections(List names, object value) { foreach (string name in names) add_to_collection(name, value); @@ -278,12 +278,6 @@ namespace Tensorflow _create_op_helper(op, true); - /*Console.Write($"create_op: {op_type} '{node_def.Name}'"); - Console.Write($", inputs: {(inputs.Length == 0 ? "empty" : String.Join(", ", inputs.Select(x => x.name)))}"); - Console.Write($", control_inputs: {(control_inputs.Length == 0 ? "empty" : String.Join(", ", control_inputs.Select(x => x.name)))}"); - Console.Write($", outputs: {(op.outputs.Length == 0 ? "empty" : String.Join(", ", op.outputs.Select(x => x.name)))}"); - Console.WriteLine();*/ - return op; } @@ -422,46 +416,29 @@ namespace Tensorflow public string[] get_all_collection_keys() { - return _collections.Keys.Where(x => !x.StartsWith("__")).ToArray(); + return (from c in _collections where !c.name.StartsWith("__") select c.name).ToArray(); } - public object get_collection(string name, string scope = null) + public List get_collection(string name, string scope = null) { - return _collections.ContainsKey(name) ? _collections[name] : null; - } - + return get_collection(name, scope); + } + + private IEnumerable findObjects(string name, string scope) + { + return (from c in _collections where c.name == name && (scope == null || c.scope == scope) select c.item); + } + public List get_collection(string name, string scope = null) { - List t = default; - var collection = _collections.ContainsKey(name) ? _collections[name] : new List(); - switch (collection) - { - case List list: - t = list.Select(x => (T)(object)x).ToList(); - break; - case List list: - t = list.Select(x => (T)(object)x).ToList(); - break; - case List list: - t = list.Select(x => (T)(object)x).ToList(); - break; - case List list: - t = list.Select(x => (T)(object)x).ToList(); - break; - case List list: - t = list.Select(x => (T)(object)x).ToList(); - break; - default: - throw new NotImplementedException($"get_collection<{typeof(T).FullName}>"); - } - return t; + + return (from c in findObjects(name, scope) where c.GetType().IsSubclassOf(typeof(T)) select (T)c).ToList(); + } public List get_collection_ref(string name) { - if (!_collections.ContainsKey(name)) - _collections[name] = new List(); - return _collections[name] as List; + return get_collection(name); } public void prevent_feeding(Tensor tensor) diff --git a/src/TensorFlowNET.Core/Summaries/Summary.cs b/src/TensorFlowNET.Core/Summaries/Summary.cs index 3d157bd9..84889845 100644 --- a/src/TensorFlowNET.Core/Summaries/Summary.cs +++ b/src/TensorFlowNET.Core/Summaries/Summary.cs @@ -39,11 +39,8 @@ namespace Tensorflow.Summaries public Tensor merge_all(string key = "summaries", string scope= null, string name= null) { - var summary_ops = ops.get_collection(key, scope: scope); - if (summary_ops == null) - return null; - else - return merge((summary_ops as List).Select(x => x as Tensor).ToArray(), name: name); + var summary_ops = ops.get_collection(key, scope: scope); + return merge(summary_ops.Select(x => x as Tensor).ToArray(), name: name); } /// diff --git a/src/TensorFlowNET.Core/Variables/variable_scope.py.cs b/src/TensorFlowNET.Core/Variables/variable_scope.py.cs index f4a01054..b43663c0 100644 --- a/src/TensorFlowNET.Core/Variables/variable_scope.py.cs +++ b/src/TensorFlowNET.Core/Variables/variable_scope.py.cs @@ -215,13 +215,13 @@ namespace Tensorflow public static _VariableStore _get_default_variable_store() { - var store = ops.get_collection(_VARSTORE_KEY); - if (store != null) - return (store as List<_VariableStore>)[0]; - - var store1 = new _VariableStore(); - ops.add_to_collection(_VARSTORE_KEY, store1); - return store1; + var store = ops.get_collection<_VariableStore>(_VARSTORE_KEY).FirstOrDefault(); + if (store == null) + { + store = new _VariableStore(); + ops.add_to_collection(_VARSTORE_KEY, store); + } + return store; } public static VariableScope get_variable_scope() @@ -229,32 +229,19 @@ namespace Tensorflow return get_variable_scope_store().current_scope; } + + // TODO: Misses RefVariable as possible value type? public static _VariableScopeStore get_variable_scope_store() { - _VariableScopeStore ret = null; - var scope_store = ops.get_collection(_VARSCOPESTORE_KEY); + var scope_store = ops.get_collection<_VariableScopeStore>(_VARSCOPESTORE_KEY).FirstOrDefault(); + if (scope_store == null) + scope_store = ops.get_collection(_VARSCOPESTORE_KEY).FirstOrDefault(); if (scope_store == null) { - ret = new _VariableScopeStore(); - ops.add_to_collection(_VARSCOPESTORE_KEY, ret); - } - else - { - switch (scope_store) - { - case List values: - ret = values[0]; - break; - case List<_VariableScopeStore> values: - ret = values[0]; - break; - default: - throw new InvalidOperationException("get_variable_scope_store"); - } - + scope_store = new _VariableScopeStore(); + ops.add_to_collection(_VARSCOPESTORE_KEY, scope_store); } - - return ret; + return scope_store; } public static bool _get_trainable_value(VariableSynchronization synchronization, bool? trainable = true) diff --git a/src/TensorFlowNET.Core/Variables/variables.py.cs b/src/TensorFlowNET.Core/Variables/variables.py.cs index 0e056949..818b324e 100644 --- a/src/TensorFlowNET.Core/Variables/variables.py.cs +++ b/src/TensorFlowNET.Core/Variables/variables.py.cs @@ -41,13 +41,8 @@ namespace Tensorflow { var all = new List(); - var collection = ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope); - if(collection != null) - all.AddRange(collection as List); - - collection = ops.get_collection(tf.GraphKeys.SAVEABLE_OBJECTS, scope); - if (collection != null) - all.AddRange(collection as List); + all.AddRange(ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope)); + all.AddRange(ops.get_collection(tf.GraphKeys.SAVEABLE_OBJECTS, scope)); return all.ToArray(); } @@ -65,9 +60,8 @@ namespace Tensorflow /// A list of `Variable` objects. public static List global_variables(string scope = null) { - var result = ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope); + return ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope); - return result == null ? new List() : result as List; } /// diff --git a/src/TensorFlowNET.Core/ops.cs b/src/TensorFlowNET.Core/ops.cs index 02417594..df43dc63 100644 --- a/src/TensorFlowNET.Core/ops.cs +++ b/src/TensorFlowNET.Core/ops.cs @@ -63,7 +63,7 @@ namespace Tensorflow /// list contains the values in the order under which they were /// collected. /// - public static object get_collection(string key, string scope = null) + public static List get_collection(string key, string scope = null) { return get_default_graph().get_collection(key, scope); } diff --git a/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs b/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs index d3484d5e..0168f22c 100644 --- a/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs +++ b/test/TensorFlowNET.UnitTest/Keras/EmbeddingTest.cs @@ -14,7 +14,6 @@ namespace TensorFlowNET.UnitTest.Keras [TestClass] public class EmbeddingTest { - [Ignore] [TestMethod] public void Embedding() { diff --git a/test/TensorFlowNET.UnitTest/VariableTest.cs b/test/TensorFlowNET.UnitTest/VariableTest.cs index e1a91560..5fb65d66 100644 --- a/test/TensorFlowNET.UnitTest/VariableTest.cs +++ b/test/TensorFlowNET.UnitTest/VariableTest.cs @@ -1,4 +1,5 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; +using FluentAssertions; +using Microsoft.VisualStudio.TestTools.UnitTesting; using NumSharp; using Tensorflow; using static Tensorflow.Binding; @@ -41,7 +42,7 @@ namespace TensorFlowNET.UnitTest tf_with(tf.variable_scope("bar"), delegate { var v = tf.get_variable("v", new TensorShape(1)); - Assert.AreEqual(v.name, "foo/bar/v:0"); + v.name.Should().Be("foo/bar/v:0"); }); }); } From acf8fbd10d78232cfb030b38383ebd872cbc0acb Mon Sep 17 00:00:00 2001 From: "Mascha, Philipp" Date: Thu, 14 Nov 2019 14:47:13 +0100 Subject: [PATCH 15/24] Fixed error in type checking for generic get_collection. --- src/TensorFlowNET.Core/Graphs/Graph.cs | 23 +++++++++++-------- .../Variables/variable_scope.py.cs | 2 -- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index 29514cd0..767e23f7 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -424,18 +424,23 @@ namespace Tensorflow return get_collection(name, scope); } - private IEnumerable findObjects(string name, string scope) + + public List get_collection(string name, string scope = null) { - return (from c in _collections where c.name == name && (scope == null || c.scope == scope) select c.item); + + return (from c in _collections + where c.name == name && + (scope == null || c.scope == scope) && + implementationOf(c.item) + select (T)(c.item)).ToList(); + + } + + private static bool implementationOf(object item) + { + return (item.GetType() == typeof(T) || item.GetType().IsSubclassOf(typeof(T))); } - public List get_collection(string name, string scope = null) - { - - return (from c in findObjects(name, scope) where c.GetType().IsSubclassOf(typeof(T)) select (T)c).ToList(); - - } - public List get_collection_ref(string name) { return get_collection(name); diff --git a/src/TensorFlowNET.Core/Variables/variable_scope.py.cs b/src/TensorFlowNET.Core/Variables/variable_scope.py.cs index b43663c0..fedb1a27 100644 --- a/src/TensorFlowNET.Core/Variables/variable_scope.py.cs +++ b/src/TensorFlowNET.Core/Variables/variable_scope.py.cs @@ -229,8 +229,6 @@ namespace Tensorflow return get_variable_scope_store().current_scope; } - - // TODO: Misses RefVariable as possible value type? public static _VariableScopeStore get_variable_scope_store() { var scope_store = ops.get_collection<_VariableScopeStore>(_VARSCOPESTORE_KEY).FirstOrDefault(); From 5f0e775a8ef454fb0e4d897e9142680d177d3fa8 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 14 Nov 2019 09:28:47 -0600 Subject: [PATCH 16/24] rename folder name Train to Training. --- .../TensorFlow.Binding.csproj | 1 - .../{Train => Training}/AdamOptimizer.cs | 0 .../{Train => Training}/AutoTrackable.cs | 0 .../Checkpointable/CheckpointableBase.cs | 0 .../Training/Coordinator.cs | 15 ++++++ .../{Train => Training}/Distribute.cs | 0 .../ExponentialMovingAverage.cs | 0 .../{Train => Training}/GateGradientType.cs | 0 .../GradientDescentOptimizer.cs | 48 ++++++++--------- .../{Train => Training}/Optimizer.cs | 0 .../{Train => Training}/QueueRunner.cs | 0 .../Saving/BaseSaverBuilder.cs | 0 .../Saving/BulkSaverBuilder.cs | 0 .../Saving/ISaverBuilder.cs | 0 .../Saving/ReferenceVariableSaveable.cs | 0 .../Saving/ResourceVariableSaveable.cs | 0 .../{Train => Training}/Saving/SaveSpec.cs | 0 .../Saving/SaveableObject.cs | 0 .../{Train => Training}/Saving/Saver.cs | 0 .../Saving/checkpoint_management.py.cs | 0 .../Saving/saveable_object_util.py.cs | 0 .../{Train => Training}/Saving/saver.py.cs | 0 .../Training/SecondOrStepTimer.cs | 43 +++++++++++++++ .../{Train => Training}/SessionRunArgs.cs | 2 +- .../{Train => Training}/SessionRunContext.cs | 2 +- .../Training/SessionRunHook.cs | 52 +++++++++++++++++++ .../{Train => Training}/SessionRunValues.cs | 2 +- .../{Train => Training}/SlotCreator.cs | 0 .../{Train => Training}/Trackable.cs | 0 .../{Train => Training}/TrainingUtil.cs | 0 .../VariableAggregationType.cs | 0 src/TensorFlowNET.Core/Training/_HookTimer.cs | 38 ++++++++++++++ .../{Train => Training}/_MonitoredSession.cs | 0 .../_OptimizableVariable.cs | 0 .../gen_training_ops.py.cs | 0 .../{Train => Training}/moving_averages.cs | 0 .../{Train => Training}/optimizer.py.cs | 0 37 files changed, 175 insertions(+), 28 deletions(-) rename src/TensorFlowNET.Core/{Train => Training}/AdamOptimizer.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/AutoTrackable.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Checkpointable/CheckpointableBase.cs (100%) create mode 100644 src/TensorFlowNET.Core/Training/Coordinator.cs rename src/TensorFlowNET.Core/{Train => Training}/Distribute.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/ExponentialMovingAverage.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/GateGradientType.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/GradientDescentOptimizer.cs (99%) rename src/TensorFlowNET.Core/{Train => Training}/Optimizer.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/QueueRunner.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/BaseSaverBuilder.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/BulkSaverBuilder.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/ISaverBuilder.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/ReferenceVariableSaveable.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/ResourceVariableSaveable.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/SaveSpec.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/SaveableObject.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/Saver.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/checkpoint_management.py.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/saveable_object_util.py.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Saving/saver.py.cs (100%) create mode 100644 src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs rename src/TensorFlowNET.Core/{Train => Training}/SessionRunArgs.cs (79%) rename src/TensorFlowNET.Core/{Train => Training}/SessionRunContext.cs (95%) create mode 100644 src/TensorFlowNET.Core/Training/SessionRunHook.cs rename src/TensorFlowNET.Core/{Train => Training}/SessionRunValues.cs (80%) rename src/TensorFlowNET.Core/{Train => Training}/SlotCreator.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/Trackable.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/TrainingUtil.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/VariableAggregationType.cs (100%) create mode 100644 src/TensorFlowNET.Core/Training/_HookTimer.cs rename src/TensorFlowNET.Core/{Train => Training}/_MonitoredSession.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/_OptimizableVariable.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/gen_training_ops.py.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/moving_averages.cs (100%) rename src/TensorFlowNET.Core/{Train => Training}/optimizer.py.cs (100%) diff --git a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj index 712e4aed..39279808 100644 --- a/src/TensorFlowNET.Core/TensorFlow.Binding.csproj +++ b/src/TensorFlowNET.Core/TensorFlow.Binding.csproj @@ -67,7 +67,6 @@ https://tensorflownet.readthedocs.io - diff --git a/src/TensorFlowNET.Core/Train/AdamOptimizer.cs b/src/TensorFlowNET.Core/Training/AdamOptimizer.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/AdamOptimizer.cs rename to src/TensorFlowNET.Core/Training/AdamOptimizer.cs diff --git a/src/TensorFlowNET.Core/Train/AutoTrackable.cs b/src/TensorFlowNET.Core/Training/AutoTrackable.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/AutoTrackable.cs rename to src/TensorFlowNET.Core/Training/AutoTrackable.cs diff --git a/src/TensorFlowNET.Core/Train/Checkpointable/CheckpointableBase.cs b/src/TensorFlowNET.Core/Training/Checkpointable/CheckpointableBase.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Checkpointable/CheckpointableBase.cs rename to src/TensorFlowNET.Core/Training/Checkpointable/CheckpointableBase.cs diff --git a/src/TensorFlowNET.Core/Training/Coordinator.cs b/src/TensorFlowNET.Core/Training/Coordinator.cs new file mode 100644 index 00000000..33c787b4 --- /dev/null +++ b/src/TensorFlowNET.Core/Training/Coordinator.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Training +{ + /// + /// A coordinator for threads + /// + public class Coordinator + { + } +} diff --git a/src/TensorFlowNET.Core/Train/Distribute.cs b/src/TensorFlowNET.Core/Training/Distribute.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Distribute.cs rename to src/TensorFlowNET.Core/Training/Distribute.cs diff --git a/src/TensorFlowNET.Core/Train/ExponentialMovingAverage.cs b/src/TensorFlowNET.Core/Training/ExponentialMovingAverage.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/ExponentialMovingAverage.cs rename to src/TensorFlowNET.Core/Training/ExponentialMovingAverage.cs diff --git a/src/TensorFlowNET.Core/Train/GateGradientType.cs b/src/TensorFlowNET.Core/Training/GateGradientType.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/GateGradientType.cs rename to src/TensorFlowNET.Core/Training/GateGradientType.cs diff --git a/src/TensorFlowNET.Core/Train/GradientDescentOptimizer.cs b/src/TensorFlowNET.Core/Training/GradientDescentOptimizer.cs similarity index 99% rename from src/TensorFlowNET.Core/Train/GradientDescentOptimizer.cs rename to src/TensorFlowNET.Core/Training/GradientDescentOptimizer.cs index d4682066..73359c4b 100644 --- a/src/TensorFlowNET.Core/Train/GradientDescentOptimizer.cs +++ b/src/TensorFlowNET.Core/Training/GradientDescentOptimizer.cs @@ -1,26 +1,26 @@ -/***************************************************************************** - Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +/***************************************************************************** + Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. ******************************************************************************/ namespace Tensorflow.Train { - /// - /// Optimizer that implements the gradient descent algorithm. + /// + /// Optimizer that implements the gradient descent algorithm. /// public class GradientDescentOptimizer : Optimizer - { + { /// /// Construct a new gradient descent optimizer. /// @@ -41,9 +41,9 @@ namespace Tensorflow.Train { _lr = learning_rate; _useTensor = false; - } - - public GradientDescentOptimizer(Tensor learning_rate, bool use_locking = false, string name = "GradientDescent") + } + + public GradientDescentOptimizer(Tensor learning_rate, bool use_locking = false, string name = "GradientDescent") : base(learning_rate, use_locking, name) { _lr_t = learning_rate; @@ -52,10 +52,10 @@ namespace Tensorflow.Train public override void _prepare() { - if(!_useTensor) - { - var lr = _call_if_callable(_lr); - _lr_t = ops.convert_to_tensor(lr, name: "learning_rate"); + if(!_useTensor) + { + var lr = _call_if_callable(_lr); + _lr_t = ops.convert_to_tensor(lr, name: "learning_rate"); } } diff --git a/src/TensorFlowNET.Core/Train/Optimizer.cs b/src/TensorFlowNET.Core/Training/Optimizer.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Optimizer.cs rename to src/TensorFlowNET.Core/Training/Optimizer.cs diff --git a/src/TensorFlowNET.Core/Train/QueueRunner.cs b/src/TensorFlowNET.Core/Training/QueueRunner.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/QueueRunner.cs rename to src/TensorFlowNET.Core/Training/QueueRunner.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/BaseSaverBuilder.cs b/src/TensorFlowNET.Core/Training/Saving/BaseSaverBuilder.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/BaseSaverBuilder.cs rename to src/TensorFlowNET.Core/Training/Saving/BaseSaverBuilder.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/BulkSaverBuilder.cs b/src/TensorFlowNET.Core/Training/Saving/BulkSaverBuilder.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/BulkSaverBuilder.cs rename to src/TensorFlowNET.Core/Training/Saving/BulkSaverBuilder.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/ISaverBuilder.cs b/src/TensorFlowNET.Core/Training/Saving/ISaverBuilder.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/ISaverBuilder.cs rename to src/TensorFlowNET.Core/Training/Saving/ISaverBuilder.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/ReferenceVariableSaveable.cs b/src/TensorFlowNET.Core/Training/Saving/ReferenceVariableSaveable.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/ReferenceVariableSaveable.cs rename to src/TensorFlowNET.Core/Training/Saving/ReferenceVariableSaveable.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/ResourceVariableSaveable.cs b/src/TensorFlowNET.Core/Training/Saving/ResourceVariableSaveable.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/ResourceVariableSaveable.cs rename to src/TensorFlowNET.Core/Training/Saving/ResourceVariableSaveable.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/SaveSpec.cs b/src/TensorFlowNET.Core/Training/Saving/SaveSpec.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/SaveSpec.cs rename to src/TensorFlowNET.Core/Training/Saving/SaveSpec.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/SaveableObject.cs b/src/TensorFlowNET.Core/Training/Saving/SaveableObject.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/SaveableObject.cs rename to src/TensorFlowNET.Core/Training/Saving/SaveableObject.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/Saver.cs b/src/TensorFlowNET.Core/Training/Saving/Saver.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/Saver.cs rename to src/TensorFlowNET.Core/Training/Saving/Saver.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/checkpoint_management.py.cs b/src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/checkpoint_management.py.cs rename to src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/saveable_object_util.py.cs b/src/TensorFlowNET.Core/Training/Saving/saveable_object_util.py.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/saveable_object_util.py.cs rename to src/TensorFlowNET.Core/Training/Saving/saveable_object_util.py.cs diff --git a/src/TensorFlowNET.Core/Train/Saving/saver.py.cs b/src/TensorFlowNET.Core/Training/Saving/saver.py.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Saving/saver.py.cs rename to src/TensorFlowNET.Core/Training/Saving/saver.py.cs diff --git a/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs b/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs new file mode 100644 index 00000000..fe13405f --- /dev/null +++ b/src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Training +{ + public class SecondOrStepTimer : _HookTimer + { + int _every_secs = 60; + int _every_steps = 0; + int _last_triggered_step = 0; + int _last_triggered_time = 0; + + public SecondOrStepTimer(int every_secs, int every_steps) + { + _every_secs = every_secs; + _every_steps = every_steps; + } + + public override void reset() + { + _last_triggered_step = 0; + _last_triggered_time = 0; + } + + public override int last_triggered_step() + { + return _last_triggered_step; + } + + public override bool should_trigger_for_step(int step) + { + throw new NotImplementedException(); + } + + public override void update_last_triggered_step(int step) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/TensorFlowNET.Core/Train/SessionRunArgs.cs b/src/TensorFlowNET.Core/Training/SessionRunArgs.cs similarity index 79% rename from src/TensorFlowNET.Core/Train/SessionRunArgs.cs rename to src/TensorFlowNET.Core/Training/SessionRunArgs.cs index 00d473e1..7c089634 100644 --- a/src/TensorFlowNET.Core/Train/SessionRunArgs.cs +++ b/src/TensorFlowNET.Core/Training/SessionRunArgs.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace Tensorflow.Train +namespace Tensorflow.Training { public class SessionRunArgs { diff --git a/src/TensorFlowNET.Core/Train/SessionRunContext.cs b/src/TensorFlowNET.Core/Training/SessionRunContext.cs similarity index 95% rename from src/TensorFlowNET.Core/Train/SessionRunContext.cs rename to src/TensorFlowNET.Core/Training/SessionRunContext.cs index cf8bdc05..6c119593 100644 --- a/src/TensorFlowNET.Core/Train/SessionRunContext.cs +++ b/src/TensorFlowNET.Core/Training/SessionRunContext.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace Tensorflow.Train +namespace Tensorflow.Training { public class SessionRunContext { diff --git a/src/TensorFlowNET.Core/Training/SessionRunHook.cs b/src/TensorFlowNET.Core/Training/SessionRunHook.cs new file mode 100644 index 00000000..ce3a2200 --- /dev/null +++ b/src/TensorFlowNET.Core/Training/SessionRunHook.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Training +{ + /// + /// Hook to extend calls to MonitoredSession.run(). + /// + public abstract class SessionRunHook + { + /// + /// Called once before using the session. + /// + public virtual void begin() + { + } + + /// + /// Called when new TensorFlow session is created. + /// + /// + /// + public virtual void after_create_session(Session session, Coordinator coord) + { + } + + /// + /// Called before each call to run(). + /// + /// + public virtual void before_run(SessionRunContext run_context) + { + } + + /// + /// Called after each call to run(). + /// + public virtual void after_run(SessionRunContext run_context, SessionRunValues run_values) + { + } + + /// + /// Called at the end of session. + /// + public virtual void end(Session session) + { + } + } +} diff --git a/src/TensorFlowNET.Core/Train/SessionRunValues.cs b/src/TensorFlowNET.Core/Training/SessionRunValues.cs similarity index 80% rename from src/TensorFlowNET.Core/Train/SessionRunValues.cs rename to src/TensorFlowNET.Core/Training/SessionRunValues.cs index 655c3310..d93e8347 100644 --- a/src/TensorFlowNET.Core/Train/SessionRunValues.cs +++ b/src/TensorFlowNET.Core/Training/SessionRunValues.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace Tensorflow.Train +namespace Tensorflow.Training { public class SessionRunValues { diff --git a/src/TensorFlowNET.Core/Train/SlotCreator.cs b/src/TensorFlowNET.Core/Training/SlotCreator.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/SlotCreator.cs rename to src/TensorFlowNET.Core/Training/SlotCreator.cs diff --git a/src/TensorFlowNET.Core/Train/Trackable.cs b/src/TensorFlowNET.Core/Training/Trackable.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/Trackable.cs rename to src/TensorFlowNET.Core/Training/Trackable.cs diff --git a/src/TensorFlowNET.Core/Train/TrainingUtil.cs b/src/TensorFlowNET.Core/Training/TrainingUtil.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/TrainingUtil.cs rename to src/TensorFlowNET.Core/Training/TrainingUtil.cs diff --git a/src/TensorFlowNET.Core/Train/VariableAggregationType.cs b/src/TensorFlowNET.Core/Training/VariableAggregationType.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/VariableAggregationType.cs rename to src/TensorFlowNET.Core/Training/VariableAggregationType.cs diff --git a/src/TensorFlowNET.Core/Training/_HookTimer.cs b/src/TensorFlowNET.Core/Training/_HookTimer.cs new file mode 100644 index 00000000..295de165 --- /dev/null +++ b/src/TensorFlowNET.Core/Training/_HookTimer.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Training +{ + /// + /// Base timer for determining when Hooks should trigger. + /// + public abstract class _HookTimer + { + /// + /// Resets the timer. + /// + public abstract void reset(); + + /// + /// Return true if the timer should trigger for the specified step. + /// + /// + /// + public abstract bool should_trigger_for_step(int step); + + /// + /// Update the last triggered time and step number. + /// + /// + public abstract void update_last_triggered_step(int step); + + /// + /// Returns the last triggered time step or None if never triggered. + /// + /// + public abstract int last_triggered_step(); + } +} diff --git a/src/TensorFlowNET.Core/Train/_MonitoredSession.cs b/src/TensorFlowNET.Core/Training/_MonitoredSession.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/_MonitoredSession.cs rename to src/TensorFlowNET.Core/Training/_MonitoredSession.cs diff --git a/src/TensorFlowNET.Core/Train/_OptimizableVariable.cs b/src/TensorFlowNET.Core/Training/_OptimizableVariable.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/_OptimizableVariable.cs rename to src/TensorFlowNET.Core/Training/_OptimizableVariable.cs diff --git a/src/TensorFlowNET.Core/Train/gen_training_ops.py.cs b/src/TensorFlowNET.Core/Training/gen_training_ops.py.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/gen_training_ops.py.cs rename to src/TensorFlowNET.Core/Training/gen_training_ops.py.cs diff --git a/src/TensorFlowNET.Core/Train/moving_averages.cs b/src/TensorFlowNET.Core/Training/moving_averages.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/moving_averages.cs rename to src/TensorFlowNET.Core/Training/moving_averages.cs diff --git a/src/TensorFlowNET.Core/Train/optimizer.py.cs b/src/TensorFlowNET.Core/Training/optimizer.py.cs similarity index 100% rename from src/TensorFlowNET.Core/Train/optimizer.py.cs rename to src/TensorFlowNET.Core/Training/optimizer.py.cs From 8b38d0d372653e7e7c81d10bbe2a96f2fdef7923 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 14 Nov 2019 22:20:13 -0600 Subject: [PATCH 17/24] rename Keras project. --- TensorFlow.NET.sln | 14 -------------- src/{KerasNET.Core => TensorFlowNET.Keras}/Core.cs | 0 .../IInitializer.cs | 0 .../Initializer/BaseInitializer.cs | 0 .../Keras.Core.csproj | 0 .../Layers/Dense.cs | 0 .../Layers/ILayer.cs | 0 .../Model.cs | 0 8 files changed, 14 deletions(-) rename src/{KerasNET.Core => TensorFlowNET.Keras}/Core.cs (100%) rename src/{KerasNET.Core => TensorFlowNET.Keras}/IInitializer.cs (100%) rename src/{KerasNET.Core => TensorFlowNET.Keras}/Initializer/BaseInitializer.cs (100%) rename src/{KerasNET.Core => TensorFlowNET.Keras}/Keras.Core.csproj (100%) rename src/{KerasNET.Core => TensorFlowNET.Keras}/Layers/Dense.cs (100%) rename src/{KerasNET.Core => TensorFlowNET.Keras}/Layers/ILayer.cs (100%) rename src/{KerasNET.Core => TensorFlowNET.Keras}/Model.cs (100%) diff --git a/TensorFlow.NET.sln b/TensorFlow.NET.sln index 47258dc6..2ad1cb5d 100644 --- a/TensorFlow.NET.sln +++ b/TensorFlow.NET.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.29102.190 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlow.Binding", "src\TensorFlowNET.Core\TensorFlow.Binding.csproj", "{FD682AC0-7B2D-45D3-8B0D-C6D678B04144}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Keras.Core", "src\KerasNET.Core\Keras.Core.csproj", "{4A341A02-F595-4A2A-B671-D7591FC65CA7}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmark", "src\TensorFlowNet.Benchmarks\Benchmark.csproj", "{3A6EB896-604F-4E25-B677-B8103BCF3D2E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\TensorFlowNET.UnitTest\UnitTest.csproj", "{23C28035-2FCE-41F3-9A12-E73CE8A5AE32}" @@ -33,18 +31,6 @@ Global {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Release|Any CPU.Build.0 = Release|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Release|x64.ActiveCfg = Release|Any CPU {FD682AC0-7B2D-45D3-8B0D-C6D678B04144}.Release|x64.Build.0 = Release|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Debug|x64.Build.0 = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|Any CPU.ActiveCfg = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|Any CPU.Build.0 = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|x64.ActiveCfg = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Publish|x64.Build.0 = Debug|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|Any CPU.Build.0 = Release|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|x64.ActiveCfg = Release|Any CPU - {4A341A02-F595-4A2A-B671-D7591FC65CA7}.Release|x64.Build.0 = Release|Any CPU {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|Any CPU.Build.0 = Debug|Any CPU {3A6EB896-604F-4E25-B677-B8103BCF3D2E}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/src/KerasNET.Core/Core.cs b/src/TensorFlowNET.Keras/Core.cs similarity index 100% rename from src/KerasNET.Core/Core.cs rename to src/TensorFlowNET.Keras/Core.cs diff --git a/src/KerasNET.Core/IInitializer.cs b/src/TensorFlowNET.Keras/IInitializer.cs similarity index 100% rename from src/KerasNET.Core/IInitializer.cs rename to src/TensorFlowNET.Keras/IInitializer.cs diff --git a/src/KerasNET.Core/Initializer/BaseInitializer.cs b/src/TensorFlowNET.Keras/Initializer/BaseInitializer.cs similarity index 100% rename from src/KerasNET.Core/Initializer/BaseInitializer.cs rename to src/TensorFlowNET.Keras/Initializer/BaseInitializer.cs diff --git a/src/KerasNET.Core/Keras.Core.csproj b/src/TensorFlowNET.Keras/Keras.Core.csproj similarity index 100% rename from src/KerasNET.Core/Keras.Core.csproj rename to src/TensorFlowNET.Keras/Keras.Core.csproj diff --git a/src/KerasNET.Core/Layers/Dense.cs b/src/TensorFlowNET.Keras/Layers/Dense.cs similarity index 100% rename from src/KerasNET.Core/Layers/Dense.cs rename to src/TensorFlowNET.Keras/Layers/Dense.cs diff --git a/src/KerasNET.Core/Layers/ILayer.cs b/src/TensorFlowNET.Keras/Layers/ILayer.cs similarity index 100% rename from src/KerasNET.Core/Layers/ILayer.cs rename to src/TensorFlowNET.Keras/Layers/ILayer.cs diff --git a/src/KerasNET.Core/Model.cs b/src/TensorFlowNET.Keras/Model.cs similarity index 100% rename from src/KerasNET.Core/Model.cs rename to src/TensorFlowNET.Keras/Model.cs From 945ac024155311e5c0db93c52b3f3be3ecb6ab60 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 14 Nov 2019 22:20:50 -0600 Subject: [PATCH 18/24] Rollback Fix collections typing #448 --- src/TensorFlowNET.Core/APIs/tf.variable.cs | 10 +- src/TensorFlowNET.Core/Binding.FuncTools.cs | 18 +++- .../Framework/meta_graph.cs | 54 ++++++----- src/TensorFlowNET.Core/Graphs/Graph.cs | 94 +++++++++++-------- .../Training/TrainingUtil.cs | 2 +- .../Variables/variable_scope.py.cs | 63 ++++++++----- src/TensorFlowNET.Core/ops.cs | 2 +- 7 files changed, 146 insertions(+), 97 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.variable.cs b/src/TensorFlowNET.Core/APIs/tf.variable.cs index 1d07747b..da7fb027 100644 --- a/src/TensorFlowNET.Core/APIs/tf.variable.cs +++ b/src/TensorFlowNET.Core/APIs/tf.variable.cs @@ -23,14 +23,14 @@ namespace Tensorflow { public VariableV1[] global_variables(string scope = null) { - return (ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope)) + return (ops.get_collection(tf.GraphKeys.GLOBAL_VARIABLES, scope) as List) .ToArray(); } public Operation global_variables_initializer() { var g = variables.global_variables(); - return variables.variables_initializer(g?.ToArray()); + return variables.variables_initializer(g.ToArray()); } /// @@ -54,9 +54,9 @@ namespace Tensorflow { var scope = Tensorflow.variable_scope.get_variable_scope(); var store = Tensorflow.variable_scope._get_default_variable_store(); - return scope.get_variable(store, - name, - shape: shape, + return scope.get_variable(store, + name, + shape: shape, dtype: dtype, use_resource: use_resource, validate_shape: validate_shape, diff --git a/src/TensorFlowNET.Core/Binding.FuncTools.cs b/src/TensorFlowNET.Core/Binding.FuncTools.cs index fb038005..71240c67 100644 --- a/src/TensorFlowNET.Core/Binding.FuncTools.cs +++ b/src/TensorFlowNET.Core/Binding.FuncTools.cs @@ -10,11 +10,23 @@ namespace Tensorflow { public static class functools { - public static Func partial(Func func, Tin arg) - => (arg0) => func(arg0); + public static PartialFunc partial(Func func, Tin arg) + => new PartialFunc + { + args = arg, + invoke = func + }; public static Func partial(Func func, (Tin1, Tin2) args) - => (arg1, arg2) => func(arg1, arg2); + => (arg1, arg2) => func(args.Item1, args.Item2); + } + + public class PartialFunc + { + public Tin args { get; set; } + public object[] keywords { get; set; } + + public Func invoke { get; set; } } } } diff --git a/src/TensorFlowNET.Core/Framework/meta_graph.cs b/src/TensorFlowNET.Core/Framework/meta_graph.cs index 21684001..d80e67b4 100644 --- a/src/TensorFlowNET.Core/Framework/meta_graph.cs +++ b/src/TensorFlowNET.Core/Framework/meta_graph.cs @@ -46,9 +46,9 @@ namespace Tensorflow if (!string.IsNullOrEmpty(unbound_inputs_col_name)) { - foreach(var col in meta_graph_def.CollectionDef) + foreach (var col in meta_graph_def.CollectionDef) { - if(col.Key == unbound_inputs_col_name) + if (col.Key == unbound_inputs_col_name) { throw new NotImplementedException("import_scoped_meta_graph_with_return_elements"); } @@ -78,7 +78,7 @@ namespace Tensorflow // Restores all the other collections. var variable_objects = new Dictionary(); - foreach(var col in meta_graph_def.CollectionDef.OrderBy(x => x.Key)) + foreach (var col in meta_graph_def.CollectionDef.OrderBy(x => x.Key)) { // Don't add unbound_inputs to the new graph. if (col.Key == unbound_inputs_col_name) @@ -87,7 +87,7 @@ namespace Tensorflow switch (col.Value.KindCase) { case KindOneofCase.NodeList: - foreach(var value in col.Value.NodeList.Value) + foreach (var value in col.Value.NodeList.Value) { var col_op = graph.as_graph_element(ops.prepend_name_scope(value, scope_to_prepend_to_names)); graph.add_to_collection(col.Key, col_op); @@ -115,7 +115,7 @@ namespace Tensorflow } else { - foreach(var value in col.Value.BytesList.Value) + foreach (var value in col.Value.BytesList.Value) { switch (col.Key) { @@ -139,7 +139,7 @@ namespace Tensorflow } } } - + break; default: throw new NotImplementedException("import_scoped_meta_graph_with_return_elements"); @@ -173,8 +173,8 @@ namespace Tensorflow string unbound_inputs_col_name = "unbound_inputs", bool clear_devices = false, SaverDef saver_def = null, - bool clear_extraneous_savers= false, - bool strip_default_attrs= false, + bool clear_extraneous_savers = false, + bool strip_default_attrs = false, byte[] meta_info_def = null) { var graph = ops.get_default_graph(); @@ -236,12 +236,12 @@ namespace Tensorflow meta_graph_def.GraphDef = graph_def; // Fills in meta_info_def.stripped_op_list using the ops from graph_def. - if (meta_graph_def.MetaInfoDef.StrippedOpList == null || + if (meta_graph_def.MetaInfoDef.StrippedOpList == null || meta_graph_def.MetaInfoDef.StrippedOpList.Op.Count == 0) meta_graph_def.MetaInfoDef.StrippedOpList = stripped_op_list_for_graph(meta_graph_def.GraphDef); var clist = graph.get_all_collection_keys(); - foreach(var ctype in clist) + foreach (var ctype in clist) { if (clear_extraneous_savers) { @@ -256,30 +256,34 @@ namespace Tensorflow return meta_graph_def; } - private static void add_collection_def(MetaGraphDef meta_graph_def, - string key, + private static void add_collection_def(MetaGraphDef meta_graph_def, + string key, Graph graph = null, string export_scope = "") { if (!meta_graph_def.CollectionDef.ContainsKey(key)) meta_graph_def.CollectionDef[key] = new CollectionDef(); var col_def = meta_graph_def.CollectionDef[key]; - col_def.NodeList = new Types.NodeList(); - col_def.BytesList = new Types.BytesList(); - foreach (object value in graph.get_collection(key)) + + switch (graph.get_collection(key)) { - switch (value) - { - case RefVariable x: + case List collection_list: + col_def.BytesList = new Types.BytesList(); + foreach (var x in collection_list) + { var proto = x.to_proto(export_scope); col_def.BytesList.Value.Add(proto.ToByteString()); - break; - case ITensorOrOperation x2: - col_def.NodeList.Value.Add(ops.strip_name_scope(x2.name, export_scope)); - break; - default: - break; - } + } + + break; + case List collection_list: + col_def.NodeList = new Types.NodeList(); + foreach (var x in collection_list) + if (x is ITensorOrOperation x2) + col_def.NodeList.Value.Add(ops.strip_name_scope(x2.name, export_scope)); + break; + case List collection_list: + break; } } diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index 767e23f7..a162f54d 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -77,7 +77,7 @@ namespace Tensorflow /// https://www.tensorflow.org/guide/graphs

https://www.tensorflow.org/api_docs/python/tf/Graph
public partial class Graph : DisposableObject #if !SERIALIZABLE - ,IEnumerable + , IEnumerable #endif { private Dictionary _nodes_by_id; @@ -100,15 +100,13 @@ namespace Tensorflow /// private bool _finalized = false; - /// - /// Arbitrary collections of objects inside the graph. - /// TODO: Access might be slow (-> O(n)) depending on size. + /// Arbitrary collections of objects. /// - private readonly ICollection<(string name, string scope, object item)> _collections = new List<(string name, string scope, object item)>(); + private Dictionary _collections = new Dictionary(); - public bool building_function; - + public bool building_function; + public Graph() { _handle = c_api.TF_NewGraph(); @@ -230,14 +228,16 @@ namespace Tensorflow throw new Exception($"Can not convert a {obj.GetType().Name} into a {types_str}."); } - public void add_to_collection(string name, object value) + public void add_to_collection(string name, T value) { _check_not_finalized(); - _collections.Add((name, null, value)); + if (_collections.ContainsKey(name)) + (_collections[name] as List).Add(value); + else + _collections[name] = new List { value }; } - - public void add_to_collections(List names, object value) + public void add_to_collections(List names, T value) { foreach (string name in names) add_to_collection(name, value); @@ -278,6 +278,12 @@ namespace Tensorflow _create_op_helper(op, true); + /*Console.Write($"create_op: {op_type} '{node_def.Name}'"); + Console.Write($", inputs: {(inputs.Length == 0 ? "empty" : String.Join(", ", inputs.Select(x => x.name)))}"); + Console.Write($", control_inputs: {(control_inputs.Length == 0 ? "empty" : String.Join(", ", control_inputs.Select(x => x.name)))}"); + Console.Write($", outputs: {(op.outputs.Length == 0 ? "empty" : String.Join(", ", op.outputs.Select(x => x.name)))}"); + Console.WriteLine();*/ + return op; } @@ -394,7 +400,7 @@ namespace Tensorflow _names_in_use[name_key] = 1; // Return the new name with the original capitalization of the given name. - name = $"{name}_{i-1}"; + name = $"{name}_{i - 1}"; } return name; } @@ -407,8 +413,8 @@ namespace Tensorflow TF_Output[] return_outputs = new TF_Output[num_return_outputs]; unsafe { - var tf_output_ptr = (TF_Output*) return_output_handle; - for (int i = 0; i < num_return_outputs; i++) + var tf_output_ptr = (TF_Output*)return_output_handle; + for (int i = 0; i < num_return_outputs; i++) return_outputs[i] = *(tf_output_ptr + i); return return_outputs; } @@ -416,34 +422,46 @@ namespace Tensorflow public string[] get_all_collection_keys() { - return (from c in _collections where !c.name.StartsWith("__") select c.name).ToArray(); + return _collections.Keys.Where(x => !x.StartsWith("__")).ToArray(); } - public List get_collection(string name, string scope = null) + public object get_collection(string name, string scope = null) { - return get_collection(name, scope); - } - - + return _collections.ContainsKey(name) ? _collections[name] : null; + } + public List get_collection(string name, string scope = null) - { - - return (from c in _collections - where c.name == name && - (scope == null || c.scope == scope) && - implementationOf(c.item) - select (T)(c.item)).ToList(); - - } - - private static bool implementationOf(object item) - { - return (item.GetType() == typeof(T) || item.GetType().IsSubclassOf(typeof(T))); - } - + { + List t = default; + var collection = _collections.ContainsKey(name) ? _collections[name] : new List(); + switch (collection) + { + case List list: + t = list.Select(x => (T)(object)x).ToList(); + break; + case List list: + t = list.Select(x => (T)(object)x).ToList(); + break; + case List list: + t = list.Select(x => (T)(object)x).ToList(); + break; + case List list: + t = list.Select(x => (T)(object)x).ToList(); + break; + case List list: + t = list.Select(x => (T)(object)x).ToList(); + break; + default: + throw new NotImplementedException($"get_collection<{typeof(T).FullName}>"); + } + return t; + } + public List get_collection_ref(string name) { - return get_collection(name); + if (!_collections.ContainsKey(name)) + _collections[name] = new List(); + return _collections[name] as List; } public void prevent_feeding(Tensor tensor) @@ -497,7 +515,7 @@ namespace Tensorflow string debugString = string.Empty; public override string ToString() { - return $"{graph_key}, ({_handle})"; + return $"{graph_key}, ({_handle})"; /*if (string.IsNullOrEmpty(debugString)) { int len = 0; @@ -514,7 +532,7 @@ namespace Tensorflow IEnumerator IEnumerable.GetEnumerator() => GetEnumerable().GetEnumerator(); - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException(); #endif diff --git a/src/TensorFlowNET.Core/Training/TrainingUtil.cs b/src/TensorFlowNET.Core/Training/TrainingUtil.cs index 63227733..9e784550 100644 --- a/src/TensorFlowNET.Core/Training/TrainingUtil.cs +++ b/src/TensorFlowNET.Core/Training/TrainingUtil.cs @@ -16,7 +16,7 @@ namespace Tensorflow.Train // Create in proper graph and base name_scope. var g = graph.as_default(); g.name_scope(null); - var v = tf.get_variable(tf.GraphKeys.GLOBAL_STEP, new TensorShape(), dtype: dtypes.int64, + var v = tf.get_variable(tf.GraphKeys.GLOBAL_STEP, new int[0], dtype: dtypes.int64, initializer: tf.zeros_initializer, trainable: false, aggregation: VariableAggregation.OnlyFirstReplica, diff --git a/src/TensorFlowNET.Core/Variables/variable_scope.py.cs b/src/TensorFlowNET.Core/Variables/variable_scope.py.cs index fedb1a27..41e8e429 100644 --- a/src/TensorFlowNET.Core/Variables/variable_scope.py.cs +++ b/src/TensorFlowNET.Core/Variables/variable_scope.py.cs @@ -43,7 +43,7 @@ namespace Tensorflow protected Graph _graph; bool _building_function; - public variable_scope(string name, + public variable_scope(string name, string default_name = "", Tensor[] values = null, bool? reuse = null, @@ -113,7 +113,7 @@ namespace Tensorflow { // Reenter the current name scope string name_scope = ops.get_name_scope(); - if(!string.IsNullOrEmpty(name_scope)) + if (!string.IsNullOrEmpty(name_scope)) // Hack to reenter name_scope += "/"; current_name_scope = ops.name_scope(name_scope); @@ -128,8 +128,8 @@ namespace Tensorflow string current_name_scope_name = current_name_scope; _current_name_scope = current_name_scope; string old_name_scope = _scope == null ? current_name_scope_name : _scope.original_name_scope; - - if(_scope == null) + + if (_scope == null) pure_variable_scope = new PureVariableScope(_name, old_name_scope: old_name_scope); else pure_variable_scope = new PureVariableScope(_scope, old_name_scope: old_name_scope); @@ -179,7 +179,7 @@ namespace Tensorflow TF_DataType dtype = TF_DataType.DtInvalid, int[] shape = null, bool validate_shape = false, - bool ? use_resource = null, + bool? use_resource = null, VariableSynchronization synchronization = VariableSynchronization.Auto, VariableAggregation aggregation = VariableAggregation.None) { @@ -189,7 +189,7 @@ namespace Tensorflow use_resource = get_variable_scope().use_resource; } - if(!use_resource.HasValue) + if (!use_resource.HasValue) use_resource = _DEFAULT_USE_RESOURCE; if (use_resource.Value) @@ -204,7 +204,7 @@ namespace Tensorflow } else { - return new RefVariable(initial_value, + return new RefVariable(initial_value, trainable: trainable.Value, validate_shape: validate_shape, collections: collections, @@ -215,13 +215,13 @@ namespace Tensorflow public static _VariableStore _get_default_variable_store() { - var store = ops.get_collection<_VariableStore>(_VARSTORE_KEY).FirstOrDefault(); - if (store == null) - { - store = new _VariableStore(); - ops.add_to_collection(_VARSTORE_KEY, store); - } - return store; + var store = ops.get_collection(_VARSTORE_KEY); + if (store != null) + return (store as List<_VariableStore>)[0]; + + var store1 = new _VariableStore(); + ops.add_to_collection(_VARSTORE_KEY, store1); + return store1; } public static VariableScope get_variable_scope() @@ -231,15 +231,30 @@ namespace Tensorflow public static _VariableScopeStore get_variable_scope_store() { - var scope_store = ops.get_collection<_VariableScopeStore>(_VARSCOPESTORE_KEY).FirstOrDefault(); - if (scope_store == null) - scope_store = ops.get_collection(_VARSCOPESTORE_KEY).FirstOrDefault(); + _VariableScopeStore ret = null; + var scope_store = ops.get_collection(_VARSCOPESTORE_KEY); if (scope_store == null) { - scope_store = new _VariableScopeStore(); - ops.add_to_collection(_VARSCOPESTORE_KEY, scope_store); + ret = new _VariableScopeStore(); + ops.add_to_collection(_VARSCOPESTORE_KEY, ret); + } + else + { + switch (scope_store) + { + case List values: + ret = values[0]; + break; + case List<_VariableScopeStore> values: + ret = values[0]; + break; + default: + throw new InvalidOperationException("get_variable_scope_store"); + } + } - return scope_store; + + return ret; } public static bool _get_trainable_value(VariableSynchronization synchronization, bool? trainable = true) @@ -256,7 +271,7 @@ namespace Tensorflow { trainable = true; } - + return trainable.Value; } @@ -279,7 +294,7 @@ namespace Tensorflow } // TODO for Switch/Case - public static RefVariable get_variable(string embeddingMatrix, IInitializer initializer, bool use_resource, + public static RefVariable get_variable(string embeddingMatrix, IInitializer initializer, bool use_resource, TensorShape shape = null, TF_DataType dtype = TF_DataType.DtInvalid, bool trainable = false, @@ -290,12 +305,12 @@ namespace Tensorflow public void __init__() { - + } public void __del__() { - + } } } diff --git a/src/TensorFlowNET.Core/ops.cs b/src/TensorFlowNET.Core/ops.cs index df43dc63..02417594 100644 --- a/src/TensorFlowNET.Core/ops.cs +++ b/src/TensorFlowNET.Core/ops.cs @@ -63,7 +63,7 @@ namespace Tensorflow /// list contains the values in the order under which they were /// collected. /// - public static List get_collection(string key, string scope = null) + public static object get_collection(string key, string scope = null) { return get_default_graph().get_collection(key, scope); } From 10f39ad2033169afe523b2c851ccf3cf077b0826 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 14 Nov 2019 22:46:49 -0600 Subject: [PATCH 19/24] Rollback #448 --- src/TensorFlowNET.Core/Summaries/Summary.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/TensorFlowNET.Core/Summaries/Summary.cs b/src/TensorFlowNET.Core/Summaries/Summary.cs index 84889845..56772087 100644 --- a/src/TensorFlowNET.Core/Summaries/Summary.cs +++ b/src/TensorFlowNET.Core/Summaries/Summary.cs @@ -37,10 +37,13 @@ namespace Tensorflow.Summaries return val; } - public Tensor merge_all(string key = "summaries", string scope= null, string name= null) + public Tensor merge_all(string key = "summaries", string scope = null, string name = null) { - var summary_ops = ops.get_collection(key, scope: scope); - return merge(summary_ops.Select(x => x as Tensor).ToArray(), name: name); + var summary_ops = ops.get_collection(key, scope: scope); + if (summary_ops == null) + return null; + else + return merge((summary_ops as List).Select(x => x as Tensor).ToArray(), name: name); } /// From 9e453fdbc3fcc7a1e51e0a381965a70cd66e36d3 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Fri, 15 Nov 2019 10:58:32 -0600 Subject: [PATCH 20/24] Add Binder badge for TF.NET --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 87e8042d..f7708caf 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ [![NuGet](https://img.shields.io/nuget/dt/TensorFlow.NET.svg)](https://www.nuget.org/packages/TensorFlow.NET) [![Documentation Status](https://readthedocs.org/projects/tensorflownet/badge/?version=latest)](https://tensorflownet.readthedocs.io/en/latest/?badge=latest) [![Badge](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu/#/en_US) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/javiercp/BinderTF.NET/master?urlpath=lab) TF.NET is a member project of [SciSharp STACK](https://github.com/SciSharp). From 0dd0e4b71e1923912423e825e1583f6b254462fc Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Sat, 16 Nov 2019 13:22:36 -0600 Subject: [PATCH 21/24] add tf.nn.swish activation function. --- src/TensorFlowNET.Core/APIs/tf.nn.cs | 4 ++++ .../Operations/Activation/gen_nn_ops.activations.cs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.nn.cs b/src/TensorFlowNET.Core/APIs/tf.nn.cs index 64d47acd..b2ac4e94 100644 --- a/src/TensorFlowNET.Core/APIs/tf.nn.cs +++ b/src/TensorFlowNET.Core/APIs/tf.nn.cs @@ -111,6 +111,7 @@ namespace Tensorflow name: name); public IActivation relu() => new relu(); + public IActivation swish() => new swish(); public Tensor relu(Tensor features, string name = null) => gen_nn_ops.relu(features, name); @@ -206,6 +207,9 @@ namespace Tensorflow public Tensor softmax_cross_entropy_with_logits_v2(Tensor labels, Tensor logits, int axis = -1, string name = null) => nn_ops.softmax_cross_entropy_with_logits_v2_helper(labels, logits, axis: axis, name: name); + + public Tensor sigmoid(T x, string name = null) + => math_ops.sigmoid(x, name: name); } } } diff --git a/src/TensorFlowNET.Core/Operations/Activation/gen_nn_ops.activations.cs b/src/TensorFlowNET.Core/Operations/Activation/gen_nn_ops.activations.cs index 788adda4..775fa9a8 100644 --- a/src/TensorFlowNET.Core/Operations/Activation/gen_nn_ops.activations.cs +++ b/src/TensorFlowNET.Core/Operations/Activation/gen_nn_ops.activations.cs @@ -102,6 +102,14 @@ namespace Tensorflow.Operations.Activation } } + public class swish : IActivation + { + public Tensor Activate(Tensor x, string name = null) + { + return tf.multiply(x, tf.nn.sigmoid(x)); + } + } + public class linear : IActivation { public Tensor Activate(Tensor x, string name = null) From 18b078d29e80942695bb70f6b3a3dada48e6e2f6 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Sat, 16 Nov 2019 13:23:09 -0600 Subject: [PATCH 22/24] reset_default_graph --- src/TensorFlowNET.Core/APIs/tf.graph.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.graph.cs b/src/TensorFlowNET.Core/APIs/tf.graph.cs index 1648cb70..a28c007a 100644 --- a/src/TensorFlowNET.Core/APIs/tf.graph.cs +++ b/src/TensorFlowNET.Core/APIs/tf.graph.cs @@ -24,6 +24,9 @@ namespace Tensorflow public GraphKeys GraphKeys { get; } = new GraphKeys(); + public void reset_default_graph() + => ops.reset_default_graph(); + public Graph get_default_graph() { return ops.get_default_graph(); From c909310838682ecd35f7504f769ae03fad39a6c1 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Sat, 16 Nov 2019 13:23:44 -0600 Subject: [PATCH 23/24] variance_scaling_initializer --- src/TensorFlowNET.Core/APIs/tf.init.cs | 12 ++++++------ src/TensorFlowNET.Core/APIs/tf.random.cs | 9 ++++++--- src/TensorFlowNET.Core/Binding.Util.cs | 3 +++ src/TensorFlowNET.Core/Data/DatasetV2.cs | 8 +++++++- src/TensorFlowNET.Core/Graphs/Graph.cs | 10 ++++++++++ src/TensorFlowNET.Core/Keras/Initializers.cs | 2 +- .../Operations/Initializers/GlorotUniform.cs | 5 ++++- .../Operations/Initializers/VarianceScaling.cs | 17 +++++++++++------ 8 files changed, 48 insertions(+), 18 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.init.cs b/src/TensorFlowNET.Core/APIs/tf.init.cs index 15bcd766..db2ea1b1 100644 --- a/src/TensorFlowNET.Core/APIs/tf.init.cs +++ b/src/TensorFlowNET.Core/APIs/tf.init.cs @@ -66,20 +66,20 @@ namespace Tensorflow /// /// Initializer capable of adapting its scale to the shape of weights tensors. /// - /// + /// /// /// /// /// /// - public IInitializer variance_scaling_initializer(float scale = 1.0f, - string mode = "fan_in", - string distribution = "truncated_normal", + public IInitializer variance_scaling_initializer(float factor = 1.0f, + string mode = "FAN_IN", + bool uniform = false, int? seed = null, TF_DataType dtype = TF_DataType.TF_FLOAT) => new VarianceScaling( - scale: scale, + factor: factor, mode: mode, - distribution: distribution, + uniform: uniform, seed: seed, dtype: dtype); } diff --git a/src/TensorFlowNET.Core/APIs/tf.random.cs b/src/TensorFlowNET.Core/APIs/tf.random.cs index c331eb7f..c11ca791 100644 --- a/src/TensorFlowNET.Core/APIs/tf.random.cs +++ b/src/TensorFlowNET.Core/APIs/tf.random.cs @@ -28,21 +28,21 @@ namespace Tensorflow /// /// /// - public Tensor random_normal(int[] shape, + public Tensor random_normal(TensorShape shape, float mean = 0.0f, float stddev = 1.0f, TF_DataType dtype = TF_DataType.TF_FLOAT, int? seed = null, string name = null) => random_ops.random_normal(shape, mean, stddev, dtype, seed, name); - public Tensor random_uniform(int[] shape, + public Tensor random_uniform(TensorShape shape, float minval = 0, float maxval = 1, TF_DataType dtype = TF_DataType.TF_FLOAT, int? seed = null, string name = null) => random_ops.random_uniform(shape, minval, maxval, dtype, seed, name); - public Tensor truncated_normal(int[] shape, + public Tensor truncated_normal(TensorShape shape, float mean = 0.0f, float stddev = 1.0f, TF_DataType dtype = TF_DataType.TF_FLOAT, @@ -62,5 +62,8 @@ namespace Tensorflow /// public Tensor random_shuffle(Tensor value, int? seed = null, string name = null) => random_ops.random_shuffle(value, seed: seed, name: name); + + public void set_random_seed(int seed) + => ops.get_default_graph().seed = seed; } } diff --git a/src/TensorFlowNET.Core/Binding.Util.cs b/src/TensorFlowNET.Core/Binding.Util.cs index ab7a1703..9df8d45c 100644 --- a/src/TensorFlowNET.Core/Binding.Util.cs +++ b/src/TensorFlowNET.Core/Binding.Util.cs @@ -273,6 +273,9 @@ namespace Tensorflow return sum; } + public static double sum(IEnumerable enumerable) + => enumerable.Sum(); + public static double sum(Dictionary values) { return sum(values.Keys); diff --git a/src/TensorFlowNET.Core/Data/DatasetV2.cs b/src/TensorFlowNET.Core/Data/DatasetV2.cs index 1b0e7c57..0c6f6291 100644 --- a/src/TensorFlowNET.Core/Data/DatasetV2.cs +++ b/src/TensorFlowNET.Core/Data/DatasetV2.cs @@ -1,4 +1,6 @@ -namespace Tensorflow.Data +using System; + +namespace Tensorflow.Data { /// /// Represents a potentially large set of elements. @@ -11,5 +13,9 @@ /// public class DatasetV2 { + public static DatasetV2 from_generator() + { + throw new NotImplementedException(""); + } } } diff --git a/src/TensorFlowNET.Core/Graphs/Graph.cs b/src/TensorFlowNET.Core/Graphs/Graph.cs index a162f54d..1f62295a 100644 --- a/src/TensorFlowNET.Core/Graphs/Graph.cs +++ b/src/TensorFlowNET.Core/Graphs/Graph.cs @@ -107,6 +107,16 @@ namespace Tensorflow public bool building_function; + int _seed; + public int seed + { + get => _seed; + set + { + _seed = value; + } + } + public Graph() { _handle = c_api.TF_NewGraph(); diff --git a/src/TensorFlowNET.Core/Keras/Initializers.cs b/src/TensorFlowNET.Core/Keras/Initializers.cs index 1a4fe9e4..b432cc97 100644 --- a/src/TensorFlowNET.Core/Keras/Initializers.cs +++ b/src/TensorFlowNET.Core/Keras/Initializers.cs @@ -27,7 +27,7 @@ namespace Tensorflow.Keras /// public IInitializer he_normal(int? seed = null) { - return new VarianceScaling(scale: 2.0f, mode: "fan_in", distribution: "truncated_normal", seed: seed); + return new VarianceScaling(factor: 2.0f, mode: "fan_in", seed: seed); } } } diff --git a/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs b/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs index 1a8b8ba9..f418f8a3 100644 --- a/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs +++ b/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs @@ -22,7 +22,10 @@ namespace Tensorflow.Operations.Initializers string mode = "fan_avg", string distribution = "uniform", int? seed = null, - TF_DataType dtype = TF_DataType.TF_FLOAT) : base(scale, mode, distribution, seed, dtype) + TF_DataType dtype = TF_DataType.TF_FLOAT) : base(factor: scale, + mode: mode, + seed: seed, + dtype: dtype) { } diff --git a/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs b/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs index 636b1451..c0bbcd88 100644 --- a/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs +++ b/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs @@ -31,17 +31,22 @@ namespace Tensorflow.Operations.Initializers protected int? _seed; protected TF_DataType _dtype; - public VarianceScaling(float scale = 1.0f, - string mode = "fan_in", - string distribution = "truncated_normal", + public VarianceScaling(float factor = 2.0f, + string mode = "FAN_IN", + bool uniform = false, int? seed = null, TF_DataType dtype = TF_DataType.TF_FLOAT) { - if (scale < 0) + if (!dtype.is_floating()) + throw new TypeError("Cannot create initializer for non-floating point type."); + if (!new string[] { "FAN_IN", "FAN_OUT", "FAN_AVG" }.Contains(mode)) + throw new TypeError($"Unknown {mode} %s [FAN_IN, FAN_OUT, FAN_AVG]"); + + if (factor < 0) throw new ValueError("`scale` must be positive float."); - _scale = scale; + + _scale = factor; _mode = mode; - _distribution = distribution; _seed = seed; _dtype = dtype; } From 0e2488ca7aad56ef4d36f2f28fe3303bfa47a847 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Sun, 17 Nov 2019 20:08:16 -0600 Subject: [PATCH 24/24] math.reduce_sum, tf.variables_initializer --- src/TensorFlowNET.Core/APIs/tf.array.cs | 26 +- src/TensorFlowNET.Core/APIs/tf.math.cs | 12 +- src/TensorFlowNET.Core/APIs/tf.random.cs | 5 + src/TensorFlowNET.Core/APIs/tf.train.cs | 21 + src/TensorFlowNET.Core/APIs/tf.variable.cs | 9 + src/TensorFlowNET.Core/Binding.Util.cs | 6 +- .../Keras/Optimizers/LearningRateSchedule.cs | 16 + .../Keras/Optimizers/PolynomialDecay.cs | 62 + .../Operations/Initializers/GlorotUniform.cs | 4 +- .../Initializers/VarianceScaling.cs | 32 +- .../{array_ops.py.cs => array_ops.cs} | 1347 ++++++++--------- .../Operations/gen_array_ops.cs | 2 +- .../Operations/gen_math_ops.cs | 2 +- ...gen_random_ops.py.cs => gen_random_ops.cs} | 25 +- src/TensorFlowNET.Core/Operations/math_ops.cs | 21 + .../{random_ops.py.cs => random_ops.cs} | 29 + .../Training/learning_rate_decay.cs | 29 + 17 files changed, 943 insertions(+), 705 deletions(-) create mode 100644 src/TensorFlowNET.Core/Keras/Optimizers/LearningRateSchedule.cs create mode 100644 src/TensorFlowNET.Core/Keras/Optimizers/PolynomialDecay.cs rename src/TensorFlowNET.Core/Operations/{array_ops.py.cs => array_ops.cs} (97%) rename src/TensorFlowNET.Core/Operations/{gen_random_ops.py.cs => gen_random_ops.cs} (85%) rename src/TensorFlowNET.Core/Operations/{random_ops.py.cs => random_ops.cs} (83%) create mode 100644 src/TensorFlowNET.Core/Training/learning_rate_decay.cs diff --git a/src/TensorFlowNET.Core/APIs/tf.array.cs b/src/TensorFlowNET.Core/APIs/tf.array.cs index 34303bf9..ec17cecc 100644 --- a/src/TensorFlowNET.Core/APIs/tf.array.cs +++ b/src/TensorFlowNET.Core/APIs/tf.array.cs @@ -17,7 +17,9 @@ using NumSharp; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; +using static Tensorflow.Binding; namespace Tensorflow { @@ -76,7 +78,14 @@ namespace Tensorflow public Tensor concat(IList values, int axis, string name = "concat") { if (values.Count == 1) - throw new NotImplementedException("tf.concat length is 1"); + { + return tf_with(ops.name_scope(name), scope => + { + var tensor = ops.convert_to_tensor(axis, name: "concat_dim", dtype: dtypes.int32); + Debug.Assert(tensor.TensorShape.ndim == 0); + return identity(values[0], name: scope); + }); + } return gen_array_ops.concat_v2(values.ToArray(), axis, name: name); } @@ -111,7 +120,7 @@ namespace Tensorflow /// /// /// - public static Tensor identity(Tensor input, string name = null) + public Tensor identity(Tensor input, string name = null) => array_ops.identity(input, name: name); /// @@ -150,10 +159,10 @@ namespace Tensorflow /// /// /// - public static Tensor reverse(Tensor tensor, int[] axis, string name = null) + public Tensor reverse(Tensor tensor, int[] axis, string name = null) => gen_array_ops.reverse(tensor, axis, name: name); - public static Tensor reverse(Tensor tensor, Tensor axis, string name = null) + public Tensor reverse(Tensor tensor, Tensor axis, string name = null) => gen_array_ops.reverse(tensor, axis, name: name); /// @@ -277,5 +286,14 @@ namespace Tensorflow /// A `Tensor` with all elements set to zero. public Tensor zeros_like(Tensor tensor, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool optimize = true) => array_ops.zeros_like(tensor, dtype: dtype, name: name, optimize: optimize); + + /// + /// Stops gradient computation. + /// + /// + /// + /// + public Tensor stop_gradient(Tensor x, string name = null) + => gen_array_ops.stop_gradient(x, name: name); } } diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index e3b9e257..6cb43980 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -434,11 +434,14 @@ namespace Tensorflow public Tensor reduce_sum(Tensor input, int? axis = null, int? reduction_indices = null, bool keepdims = false, string name = null) { - if(!axis.HasValue && reduction_indices.HasValue) + if (!axis.HasValue && reduction_indices.HasValue && !keepdims) return math_ops.reduce_sum(input, reduction_indices.Value); - else if (axis.HasValue && !reduction_indices.HasValue) + else if (axis.HasValue && !reduction_indices.HasValue && !keepdims) return math_ops.reduce_sum(input, axis.Value); - return math_ops.reduce_sum(input, keepdims: keepdims, name: name); + else if (axis.HasValue && !reduction_indices.HasValue && keepdims) + return math_ops.reduce_sum(input, keepdims: keepdims, axis: axis.Value, name: name); + else + return math_ops.reduce_sum(input, keepdims: keepdims, name: name); } public Tensor reduce_sum(Tensor input, TensorShape axis, int? reduction_indices = null, @@ -471,6 +474,9 @@ namespace Tensorflow public Tensor reduce_mean(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null, int? reduction_indices = null) => math_ops.reduce_mean(input_tensor, axis: axis, keepdims: keepdims, name: name, reduction_indices: reduction_indices); + public Tensor reduce_mean(Tensor[] input_tensors, int axis, bool keepdims = false, string name = null) + => math_ops.reduce_mean(input_tensors, axis: axis, keepdims: keepdims, name: name); + public Tensor round(Tensor x, string name = null) => gen_math_ops.round(x, name: name); diff --git a/src/TensorFlowNET.Core/APIs/tf.random.cs b/src/TensorFlowNET.Core/APIs/tf.random.cs index c11ca791..56fa840d 100644 --- a/src/TensorFlowNET.Core/APIs/tf.random.cs +++ b/src/TensorFlowNET.Core/APIs/tf.random.cs @@ -65,5 +65,10 @@ namespace Tensorflow public void set_random_seed(int seed) => ops.get_default_graph().seed = seed; + + public Tensor multinomial(Tensor logits, int num_samples, int? seed = null, + string name = null, TF_DataType output_dtype = TF_DataType.DtInvalid) + => random_ops.multinomial(logits, num_samples, seed: seed, + name: name, output_dtype: output_dtype); } } diff --git a/src/TensorFlowNET.Core/APIs/tf.train.cs b/src/TensorFlowNET.Core/APIs/tf.train.cs index 03b0a0e2..862212ef 100644 --- a/src/TensorFlowNET.Core/APIs/tf.train.cs +++ b/src/TensorFlowNET.Core/APIs/tf.train.cs @@ -15,6 +15,7 @@ ******************************************************************************/ using System.Collections.Generic; +using Tensorflow.Keras.Optimizers; using Tensorflow.Train; namespace Tensorflow @@ -73,6 +74,26 @@ namespace Tensorflow public CheckpointState get_checkpoint_state(string checkpoint_dir, string latest_filename = null) => checkpoint_management.get_checkpoint_state(checkpoint_dir, latest_filename: latest_filename); + + public Tensor polynomial_decay(float learning_rate, + RefVariable global_step, + float decay_steps, + float end_learning_rate = 0.0001f, + float power = 1.0f, + bool cycle = false, + string name = null) + { + var decayed = new PolynomialDecay(learning_rate, + decay_steps, + end_learning_rate: end_learning_rate, + power: power, + cycle: cycle, + name: name); + + var decayed_lr = decayed.__call__(global_step); + + return decayed_lr; + } } } } diff --git a/src/TensorFlowNET.Core/APIs/tf.variable.cs b/src/TensorFlowNET.Core/APIs/tf.variable.cs index da7fb027..cbdf68ba 100644 --- a/src/TensorFlowNET.Core/APIs/tf.variable.cs +++ b/src/TensorFlowNET.Core/APIs/tf.variable.cs @@ -27,6 +27,15 @@ namespace Tensorflow .ToArray(); } + /// + /// Returns an Op that initializes a list of variables. + /// + /// List of `Variable` objects to initialize. + /// Optional name for the returned operation. + /// An Op that run the initializers of all the specified variables. + public Operation variables_initializer(VariableV1[] var_list, string name = "init") + => variables.variables_initializer(var_list, name: name); + public Operation global_variables_initializer() { var g = variables.global_variables(); diff --git a/src/TensorFlowNET.Core/Binding.Util.cs b/src/TensorFlowNET.Core/Binding.Util.cs index 9df8d45c..31ea0d84 100644 --- a/src/TensorFlowNET.Core/Binding.Util.cs +++ b/src/TensorFlowNET.Core/Binding.Util.cs @@ -115,6 +115,7 @@ namespace Tensorflow return instance; } + [DebuggerStepThrough] [DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception public static void tf_with(IObjectLife py, Action action) { @@ -273,7 +274,10 @@ namespace Tensorflow return sum; } - public static double sum(IEnumerable enumerable) + public static float sum(IEnumerable enumerable) + => enumerable.Sum(); + + public static int sum(IEnumerable enumerable) => enumerable.Sum(); public static double sum(Dictionary values) diff --git a/src/TensorFlowNET.Core/Keras/Optimizers/LearningRateSchedule.cs b/src/TensorFlowNET.Core/Keras/Optimizers/LearningRateSchedule.cs new file mode 100644 index 00000000..8bcbb58f --- /dev/null +++ b/src/TensorFlowNET.Core/Keras/Optimizers/LearningRateSchedule.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Keras.Optimizers +{ + public class LearningRateSchedule + { + public LearningRateSchedule() + { + + } + } +} diff --git a/src/TensorFlowNET.Core/Keras/Optimizers/PolynomialDecay.cs b/src/TensorFlowNET.Core/Keras/Optimizers/PolynomialDecay.cs new file mode 100644 index 00000000..b44595b5 --- /dev/null +++ b/src/TensorFlowNET.Core/Keras/Optimizers/PolynomialDecay.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static Tensorflow.Binding; + +namespace Tensorflow.Keras.Optimizers +{ + /// + /// A LearningRateSchedule that uses a polynomial decay schedule. + /// + public class PolynomialDecay : LearningRateSchedule + { + float initial_learning_rate; + float decay_steps; + float end_learning_rate; + float power; + bool cycle; + string name; + + public PolynomialDecay(float initial_learning_rate, + float decay_steps, + float end_learning_rate = 0.0001f, + float power = 1.0f, + bool cycle = false, + string name = null) : base() + { + this.initial_learning_rate = initial_learning_rate; + this.decay_steps = decay_steps; + this.end_learning_rate = end_learning_rate; + this.power = power; + this.cycle = cycle; + this.name = name; + } + + public Tensor __call__(RefVariable step) + { + tf_with(ops.name_scope(name ?? "PolynomialDecay"), scope => + { + name = scope; + var initial_learning_rate_tensor = ops.convert_to_tensor(initial_learning_rate, name: "initial_learning_rate"); + var dtype = initial_learning_rate_tensor.dtype; + var end_learning_rate_tensor = math_ops.cast(end_learning_rate, dtype); + var power_tensor = math_ops.cast(power, dtype); + + var global_step_recomp = math_ops.cast(step, dtype); + var decay_steps_recomp = math_ops.cast(decay_steps, dtype); + + if(cycle) + { + throw new NotImplementedException("PolynomialDecay cycle"); + } + else + { + + } + }); + throw new NotImplementedException(""); + } + } +} diff --git a/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs b/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs index f418f8a3..0eead27d 100644 --- a/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs +++ b/src/TensorFlowNET.Core/Operations/Initializers/GlorotUniform.cs @@ -19,8 +19,7 @@ namespace Tensorflow.Operations.Initializers public class GlorotUniform : VarianceScaling { public GlorotUniform(float scale = 1.0f, - string mode = "fan_avg", - string distribution = "uniform", + string mode = "FAN_AVG", int? seed = null, TF_DataType dtype = TF_DataType.TF_FLOAT) : base(factor: scale, mode: mode, @@ -36,7 +35,6 @@ namespace Tensorflow.Operations.Initializers { scale = _scale, mode = _mode, - distribution = _distribution, seed = _seed, dtype = _dtype }; diff --git a/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs b/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs index c0bbcd88..41b6689c 100644 --- a/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs +++ b/src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs @@ -30,6 +30,7 @@ namespace Tensorflow.Operations.Initializers protected string _distribution; protected int? _seed; protected TF_DataType _dtype; + protected bool _uniform; public VarianceScaling(float factor = 2.0f, string mode = "FAN_IN", @@ -49,31 +50,31 @@ namespace Tensorflow.Operations.Initializers _mode = mode; _seed = seed; _dtype = dtype; + _uniform = uniform; } public Tensor call(TensorShape shape, TF_DataType dtype, bool? verify_shape = null) { + float n = 0; var (fan_in, fan_out) = _compute_fans(shape); - if (_mode == "fan_in") - _scale /= Math.Max(1, fan_in); - else if (_mode == "fan_out") - _scale /= Math.Max(1, fan_out); - else - _scale /= Math.Max(1, (fan_in + fan_out) / 2); + if (_mode == "FAN_IN") + n = fan_in; + else if (_mode == "FAN_OUT") + n = fan_out; + else if(_mode == "FAN_AVG") + n = (fan_in + fan_out) / 2.0f; - if (_distribution == "normal" || _distribution == "truncated_normal") - { - float stddev = (float)Math.Sqrt(_scale) / .87962566103423978f; - return random_ops.truncated_normal(shape, mean: 0.0f, stddev: stddev, dtype: dtype, seed: _seed); - } - else if (_distribution == "untruncated_normal") + if(_uniform) { - throw new NotImplementedException("truncated_normal"); + var limit = Convert.ToSingle(Math.Sqrt(3.0f * _scale / n)); + return random_ops.random_uniform(shape, -limit, limit, + dtype, seed: _seed); } else { - var limit = Math.Sqrt(3.0f * _scale); - return random_ops.random_uniform(shape, (float)-limit, (float)limit, dtype, seed: _seed); + var trunc_stddev = Convert.ToSingle(Math.Sqrt(1.3f * _scale / n)); + return random_ops.truncated_normal(shape, 0.0f, trunc_stddev, dtype, + seed: _seed); } } @@ -106,6 +107,7 @@ namespace Tensorflow.Operations.Initializers mode = _mode, distribution = _distribution, seed = _seed, + uniform = _uniform, dtype = _dtype }; } diff --git a/src/TensorFlowNET.Core/Operations/array_ops.py.cs b/src/TensorFlowNET.Core/Operations/array_ops.cs similarity index 97% rename from src/TensorFlowNET.Core/Operations/array_ops.py.cs rename to src/TensorFlowNET.Core/Operations/array_ops.cs index 86ab150f..04964069 100644 --- a/src/TensorFlowNET.Core/Operations/array_ops.py.cs +++ b/src/TensorFlowNET.Core/Operations/array_ops.cs @@ -1,674 +1,673 @@ -/***************************************************************************** - Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -******************************************************************************/ - -using NumSharp; -using System; -using System.Collections.Generic; -using System.Linq; -using Tensorflow.Framework; -using static Tensorflow.Binding; - -namespace Tensorflow -{ - public class array_ops - { - public static Tensor placeholder_with_default(T input, int[] shape, string name = null) - => gen_array_ops.placeholder_with_default(input, shape, name); - - public static Tensor prevent_gradient(Tensor input, string message = "", string name = null) - => gen_array_ops.prevent_gradient(input, message: message, name: name); - - internal static Tensor constant(object value, - TF_DataType dtype = TF_DataType.DtInvalid, - int[] shape = null, - string name = "Const", - bool verify_shape = false) => constant_op._constant_impl(value, - dtype, - shape, - name, - verify_shape: verify_shape, - allow_broadcast: false); - - public static Tensor zeros(TensorShape shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) - { - dtype = dtype.as_base_dtype(); - return tf_with(ops.name_scope(name, "zeros", shape), scope => - { - name = scope; - switch (dtype) - { - case TF_DataType.TF_BOOL: - return _constant_if_small(false, shape, dtype, name); - case TF_DataType.TF_DOUBLE: - return _constant_if_small(0.0D, shape, dtype, name); - case TF_DataType.TF_FLOAT: - return _constant_if_small(0.0F, shape, dtype, name); - case TF_DataType.TF_INT64: - return _constant_if_small(0l, shape, dtype, name); - case TF_DataType.TF_INT32: - return _constant_if_small(0, shape, dtype, name); - case TF_DataType.TF_INT8: - return _constant_if_small(0, shape, dtype, name); - default: - throw new TypeError("can't find type for zeros"); - } - }); - } - - public static Tensor boolean_mask(T1 tensor, T2 mask, string name = "boolean_mask", int axis = 0) - { - return tf_with(ops.name_scope(name, values: new { tensor, mask }), delegate - { - var tensor_tensor = ops.convert_to_tensor(tensor, name: "tensor"); - var mask_tensor = ops.convert_to_tensor(mask, name: "mask"); - - var shape_mask = mask_tensor.TensorShape; - var ndims_mask = shape_mask.ndim; - var shape_tensor = tensor_tensor.TensorShape; - - if (ndims_mask < 1) - throw new ValueError("mask cannot be scalar."); - - var leading_size = gen_math_ops.prod(shape(tensor_tensor)[$"{axis}:{axis + ndims_mask}"], new[] { 0 }); - var shape1 = concat(new[] - { - shape(tensor_tensor)[$":{axis}"], - tf.expand_dims(leading_size, 0), - shape(tensor_tensor)[$"{axis + ndims_mask}:"] - }, 0); - tensor_tensor = reshape(tensor, shape1); - var first_dim = shape_tensor.dims.Skip(axis).Take(ndims_mask).First(); - var s1 = tensor_shape.as_shape(shape_tensor.dims.Take(axis).ToArray()); - var s2 = s1.concatenate(new[] { first_dim }).concatenate(shape_tensor.dims.Skip(axis + ndims_mask).ToArray()); - tensor_tensor.set_shape(s2); - - mask_tensor = reshape(mask_tensor, new[] { -1 }); - return _apply_mask_1d(tensor_tensor, mask_tensor, axis); - }); - } - - private static Tensor _apply_mask_1d(Tensor reshaped_tensor, Tensor mask, int axis = 0) - { - var indices = squeeze(where(mask), axis: new[] { 1 }); - return gather(reshaped_tensor, indices, axis: axis); - } - - public static Tensor zeros(Tensor shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) - { - dtype = dtype.as_base_dtype(); - return tf_with(ops.name_scope(name, "zeros", shape), scope => - { - name = scope; - switch (dtype) - { - case TF_DataType.TF_BOOL: - return gen_array_ops.fill(shape, tf.constant(false, dtype: dtype), name: name); - case TF_DataType.TF_DOUBLE: - return gen_array_ops.fill(shape, tf.constant(0.0D, dtype: dtype), name: name); - case TF_DataType.TF_FLOAT: - return gen_array_ops.fill(shape, tf.constant(0.0F, dtype: dtype), name: name); - case TF_DataType.TF_INT32: - return gen_array_ops.fill(shape, tf.constant(0, dtype: dtype), name: name); - default: - throw new TypeError("can't find type for zeros"); - } - - }); - } - - private static Tensor _constant_if_small(int value, Tensor shape) - { - return shape < 1000; - } - - private static Tensor _constant_if_small(T value, TensorShape shape, TF_DataType dtype, string name) - { - Tensor tShape = null; - if (shape.size < 1000) - { - return constant_op.constant(value, shape: shape, dtype: dtype, name: name); - } - else - { - tShape = constant_op._tensor_shape_tensor_conversion_function(shape); - var c = constant_op.constant(0, dtype: dtype); - return gen_array_ops.fill(tShape, c, name: name); - } - } - - public static Tensor _autopacking_conversion_function(object[] v, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool as_ref = false) - { - var inferred_dtype = _get_dtype_from_nested_lists(v); - if (dtype == TF_DataType.DtInvalid) - dtype = inferred_dtype; - - return _autopacking_helper(v, dtype, name == null ? "packed" : name); - } - - private static TF_DataType _get_dtype_from_nested_lists(object[] list_or_tuple) - { - TF_DataType dtype = TF_DataType.DtInvalid; - - foreach(var obj in list_or_tuple) - { - switch (obj) - { - case Tensor t: - dtype = t.dtype.as_base_dtype(); - break; - } - - if (dtype != TF_DataType.DtInvalid) - break; - } - - return dtype; - } - - public static Tensor _autopacking_helper(object[] list_or_tuple, TF_DataType dtype, string name) - { - var must_pack = false; - var converted_elems = new List(); - return tf_with(ops.name_scope(name), scope => - { - foreach (var (i, elem) in enumerate(list_or_tuple)) - { - converted_elems.Add(elem); - must_pack = true; - } - - if(must_pack) - { - var elems_as_tensors = new List(); - foreach (var (i, elem) in enumerate(converted_elems)) - { - if (elem is Tensor tensor) - elems_as_tensors.Add(tensor); - else - { - var elem_tensor = constant_op.constant(elem, dtype: dtype, name: i.ToString()); - elems_as_tensors.Add(elem_tensor); - } - } - - return gen_array_ops.pack(elems_as_tensors.ToArray(), name: scope); - } - else - { - // return converted_elems.ToArray(); - throw new NotImplementedException("_autopacking_helper.converted_elems"); - } - }); - } - - public static Tensor expand_dims(Tensor input, int axis = -1, string name = null, int dim = -1) - => expand_dims_v2(input, axis, name); - - private static Tensor expand_dims_v2(Tensor input, int axis, string name = null) - => gen_array_ops.expand_dims(input, axis, name); - - /// - /// Returns the rank of a tensor. - /// - /// - /// - /// - public static Tensor rank(Tensor input, string name = null) - => rank_internal(input, name, optimize: true); - - public static Tensor rank_internal(Tensor input, string name = null, bool optimize = true) - { - return tf_with(ops.name_scope(name, "Rank", new List { input }), scope => - { - name = scope; - var input_tensor = ops.convert_to_tensor(input); - var input_shape = tensor_util.to_shape(input_tensor.shape); - if (optimize && input_shape.ndim > 0) - return constant_op.constant(input_shape.ndim, dtype: tf.int32, name: name); - else - return gen_array_ops.rank(input, name); - }); - } - - /// - /// Creates a tensor with all elements set to 1. - /// - /// - /// - /// - /// - /// - public static Tensor ones_like(T tensor, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool optimize = true) - => ones_like_impl(tensor, dtype, name, optimize); - - public static Tensor reshape(T1 tensor, T2 shape, string name = null) - => gen_array_ops.reshape(tensor, shape, null); - - private static Tensor ones_like_impl(T tensor, TF_DataType dtype, string name, bool optimize = true) - { - return tf_with(ops.name_scope(name, "ones_like", new { tensor }), scope => - { - name = scope; - var tensor1 = ops.convert_to_tensor(tensor, name: "tensor"); - var ones_shape = shape_internal(tensor1, optimize: optimize); - if (dtype == TF_DataType.DtInvalid) - dtype = tensor1.dtype; - var ret = ones(ones_shape, dtype: dtype, name: name); - ret.shape = tensor1.shape; - return ret; - }); - } - - public static Tensor ones(Tensor shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) - { - dtype = dtype.as_base_dtype(); - return tf_with(ops.name_scope(name, "ones", new { shape }), scope => - { - name = scope; - var output = gen_array_ops.fill(shape, constant_op.constant(1.0f, dtype: dtype), name: name); - return output; - }); - } - - public static Tensor ones(Tensor[] shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) - { - dtype = dtype.as_base_dtype(); - return tf_with(ops.name_scope(name, "ones", new { shape }), scope => - { - name = scope; - var output = _constant_if_small(1, shape[0]); - var shape1 = ops.convert_to_tensor(shape, dtype: TF_DataType.TF_INT32); - output = gen_array_ops.fill(shape1, constant_op.constant(1, dtype: dtype), name: name); - return output; - }); - } - - public static Tensor ones(int[] dims, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) - { - dtype = dtype.as_base_dtype(); - return tf_with(ops.name_scope(name, "ones", new { dims }), scope => - { - name = scope; - var output = _constant_if_small(1, dims, dtype, name); - return output; - }); - } - - public static Tensor one_hot(Tensor indices, int depth, - Tensor on_value = null, - Tensor off_value = null, - TF_DataType dtype = TF_DataType.DtInvalid, - int axis = -1, - string name = null) - { - return tf_with(ops.name_scope(name, "one_hot", new { indices, depth, dtype }), scope => - { - name = scope; - var on_exists = false; - var off_exists = false; - var on_dtype = TF_DataType.DtInvalid; - var off_dtype = TF_DataType.DtInvalid; - - if (dtype == TF_DataType.DtInvalid) - dtype = TF_DataType.TF_FLOAT; - - if(!on_exists) - { - on_value = ops.convert_to_tensor(1, dtype, name: "on_value"); - on_dtype = dtype; - } - - if (!off_exists) - { - off_value = ops.convert_to_tensor(0, dtype, name = "off_value"); - off_dtype = dtype; - } - - return gen_array_ops.one_hot(indices, depth, - on_value: on_value, - off_value: off_value, - axis: axis, - name: name); - }); - } - - public static (Tensor, Tensor) unique(Tensor x, TF_DataType out_idx = TF_DataType.TF_INT32, string name = null) - => gen_array_ops.unique(x, out_idx: out_idx, name: name); - - public static Tensor stack(Tensor[] values, int axis = 0, string name = "stack") - { - if (axis == 0) - { - return ops.convert_to_tensor(values, name: name); - } - - var value_shape = ops.convert_to_tensor(values[0], name: name).TensorShape; - - return gen_array_ops.pack(values, axis: axis, name: name); - } - - public static Tensor[] unstack(Tensor value, int? num = null, int axis = 0, string name = "unstack") - { - if(num == null) - { - value = ops.convert_to_tensor(value); - var value_shape = value.TensorShape; - num = value_shape.dims[axis]; - } - - return gen_array_ops.unpack(value, num: num.Value, axis: axis, name: name); - } - - public static Tensor where(Tensor condition, object x = null, object y = null, string name = null) - { - if( x == null && y == null) - { - return tf_with(ops.name_scope(name, "Where", new { condition }), scope => - { - name = scope; - condition = ops.convert_to_tensor(condition, preferred_dtype: dtypes.@bool, name: "condition"); - return gen_array_ops.where(condition: condition, name: name); - }); - } - else if(x != null && y != null) - { - return gen_array_ops.select(condition, x, y, name); - } - else - { - throw new ValueError("x and y must both be non-None or both be None."); - } - } - - /// - /// Returns the shape of a tensor. - /// - /// A `Tensor` or `SparseTensor`. - /// A name for the operation (optional). - /// - /// (Optional) The specified output type of the operation - /// (`int32` or `int64`). Defaults to `tf.int32`. - /// - /// A `Tensor` of type `out_type`. - public static Tensor shape(Tensor input, string name = null, TF_DataType out_type = TF_DataType.TF_INT32) - => shape_internal(input, name, optimize: true, out_type: out_type); - - public static Tensor size(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) - => size_internal(input, name, optimize: optimize, out_type: out_type); - - public static Tensor shape_internal(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) - { - return tf_with(ops.name_scope(name, "Shape", new { input }), scope => - { - name = scope; - - if (!tf.context.executing_eagerly()) - { - var input_tensor = ops.convert_to_tensor(input); - var input_shape = tensor_util.to_shape(input_tensor.shape); - if (optimize && input_tensor.NDims > -1 && input_shape.is_fully_defined()) - { - var nd = np.array(input_tensor.shape).astype(out_type.as_numpy_dtype()); - return constant_op.constant(nd, name: name); - } - } - - return gen_array_ops.shape(input, name: name, out_type: out_type); - }); - } - - private static Tensor size_internal(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) - { - return tf_with(ops.name_scope(name, "Size", new { input }), scope => - { - name = scope; - - var input_tensor = ops.convert_to_tensor(input); - var input_shape = tensor_util.to_shape(input_tensor.shape); - if (optimize) - { - if (input_shape.is_fully_defined()) - { - return constant_op.constant(input_shape.size, dtype: out_type, name: name); - } - } - - return gen_array_ops.size(input, name: name, out_type: out_type); - }); - } - - public static Tensor zeros_like(Tensor tensor, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool optimize = true) - { - return tf_with(ops.name_scope(name, "zeros_like", new Tensor[] { tensor }), scope => - { - name = scope; - tensor = ops.convert_to_tensor(tensor, name: "tensor"); - - // is_fully_defined return unexpected value. - if (optimize && tensor_util.to_shape(tensor.shape).is_fully_defined() && dtype != TF_DataType.TF_VARIANT) - { - - } - - if(dtype != TF_DataType.DtInvalid && dtype != tensor.dtype && dtype != TF_DataType.TF_VARIANT) - { - throw new NotImplementedException("zeros_like"); - // return zeros(shape_internal(tensor, optimize: optimize), dtype: dtype, name: name); - } - else - { - return gen_array_ops.zeros_like(tensor, name: name); - } - }); - } - - /// - /// When building ops to compute gradients, this op prevents the contribution of - /// its inputs to be taken into account.Normally, the gradient generator adds ops - /// to a graph to compute the derivatives of a specified 'loss' by recursively - /// finding out inputs that contributed to its computation.If you insert this op - /// in the graph it inputs are masked from the gradient generator. They are not - /// taken into account for computing gradients. - /// - /// - /// - /// - public static Tensor stop_gradient(Tensor input, string name = null) - => gen_array_ops.stop_gradient(input, name); - - /// - /// Extracts a strided slice of a tensor (generalized python array indexing). - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static Tensor strided_slice(Tensor input_, Tensor begin, Tensor end, - Tensor strides = null, - int begin_mask = 0, - int end_mask = 0, - int ellipsis_mask = 0, - int new_axis_mask = 0, - int shrink_axis_mask = 0, - string name = null) - { - var op = gen_array_ops.strided_slice( - input: input_, - begin: begin, - end: end, - strides: strides, - begin_mask: begin_mask, - end_mask: end_mask, - ellipsis_mask: ellipsis_mask, - new_axis_mask: new_axis_mask, - shrink_axis_mask: shrink_axis_mask, - name: name); - - string parent_name = name; - - return op; - } - - /// - /// Removes dimensions of size 1 from the shape of a tensor. - /// Given a tensor `input`, this operation returns a tensor of the same type with - /// all dimensions of size 1 removed.If you don't want to remove all size 1 - /// dimensions, you can remove specific size 1 dimensions by specifying - /// `axis`. - /// - /// A `Tensor`. The `input` to squeeze. - /// An optional list of `ints`. Defaults to `[]`. - /// If specified, only squeezes the dimensions listed.The dimension - /// index starts at 0. It is an error to squeeze a dimension that is not 1. - /// Must be in the range `[-rank(input), rank(input))`. - /// A name for the operation (optional). - /// Deprecated keyword argument that is now axis. - /// A `Tensor`. Has the same type as `input`. - /// Contains the same data as `input`, but has one or more dimensions of - /// size 1 removed. - public static Tensor squeeze(Tensor input, int[] axis = null, string name = null, int[] squeeze_dims = null) - => gen_array_ops.squeeze(input, axis, name); - - public static Tensor identity(Tensor input, string name = null) - => gen_array_ops.identity(input, name); - - public static Tensor invert_permutation(Tensor x, string name = null) - => gen_array_ops.invert_permutation(x, name: name); - - /// - /// Computes the shape of a broadcast given symbolic shapes. - /// When shape_x and shape_y are Tensors representing shapes(i.e.the result of - /// calling tf.shape on another Tensor) this computes a Tensor which is the shape - /// of the result of a broadcasting op applied in tensors of shapes shape_x and - /// shape_y. - /// For example, if shape_x is [1, 2, 3] and shape_y is [5, 1, 3], the result is a - /// Tensor whose value is [5, 2, 3]. - /// This is useful when validating the result of a broadcasting operation when the - /// tensors do not have statically known shapes. - /// - /// A rank 1 integer `Tensor`, representing the shape of x. - /// A rank 1 integer `Tensor`, representing the shape of y. - /// A rank 1 integer `Tensor` representing the broadcasted shape. - public static Tensor broadcast_dynamic_shape(Tensor shape_x, Tensor shape_y) - => gen_array_ops.broadcast_args(shape_x, shape_y); - - public static Tensor broadcast_static_shape(Tensor shape_x, Tensor shape_y) - => Framework.common_shapes.broadcast_shape(shape_x, shape_y); - - /// - /// Concatenates tensors along one dimension. - /// - /// - /// - /// - /// - public static Tensor concat(Tensor[] values, int axis, string name = "concat") - { - if(values.Length == 1) // Degenerate case of one tensor. - { - return tf_with(ops.name_scope(name), scope => { - var t = ops.convert_to_tensor(axis, name: "concat_dim", dtype: TF_DataType.TF_INT32); - return identity(values[0], name: scope); - }); - } - - return gen_array_ops.concat_v2(values, axis, name: name); - } - - public static Tensor concat(object[] values, int axis, string name = "concat") - { - return gen_array_ops.concat_v2(values, axis, name: name); - } - - public static Tensor gather(T1 @params, T2 indices, string name = null, int axis = 0) - { - if (axis != 0) - return gen_array_ops.gather_v2(@params, indices, axis, name: name); - - if (@params is ResourceVariable variable && - indices is Tensor indices_tensor) - return variable.sparse_read(indices_tensor, name); - - return gen_array_ops.gather_v2(@params, indices, axis, name: name); - } - - public static Tensor transpose(T1 a, T2 perm, string name = "transpose", bool conjugate = false) - { - return tf_with(ops.name_scope(name, "transpose", new { a }), scope => - { - return gen_array_ops.transpose(a, perm, name: scope); - }); - } - - public static Tensor slice(Tensor input, Tb begin, Ts size, string name = null) - => gen_array_ops.slice(input, begin, size, name: name); - - public static Tensor stack(object values, int axis = 0, string name = "stack") - { - if (axis == 0) - // If the input is a constant list, it can be converted to a constant op - return ops.convert_to_tensor(values, name: name); - - throw new NotImplementedException("array_ops.stack"); - } - - public static Tensor pad(Tensor tensor, Tensor paddings, string mode = "CONSTANT", string name = null, int constant_values = 0) - { - Tensor result = null; - mode = mode.ToUpper(); - if(mode == "CONSTANT") - { - if (constant_values != 0) - throw new NotImplementedException("gen_array_ops.pad_v2"); - else - result = gen_array_ops.pad(tensor, paddings, name: name); - } - - // Restore shape information where possible. - var paddings_constant = tensor_util.constant_value( - result.op.inputs[1], partial: true); - var input_shape = result.op.inputs[0].TensorShape; - if (input_shape.ndim > -1 && - !result.TensorShape.is_fully_defined() && - !(paddings_constant is null)) - { - var new_shape = new List(); - foreach((NDArray padding, int dim) in zip(paddings_constant.GetNDArrays(), np.array(input_shape.dims).GetNDArrays())) - { - if (padding is null || dim == -1 || padding.GetData().Contains(-1)) - new_shape.Add(-1); - else - new_shape.Add(np.sum(padding) + dim); - } - result.set_shape(new_shape.ToArray()); - } - - return result; - } - - public static Tensor placeholder(TF_DataType dtype) - { - throw new NotImplementedException("array_ops.placeholder"); - } - } -} +/***************************************************************************** + Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +******************************************************************************/ + +using NumSharp; +using System; +using System.Collections.Generic; +using System.Linq; +using Tensorflow.Framework; +using static Tensorflow.Binding; + +namespace Tensorflow +{ + public class array_ops + { + public static Tensor placeholder_with_default(T input, int[] shape, string name = null) + => gen_array_ops.placeholder_with_default(input, shape, name); + + public static Tensor prevent_gradient(Tensor input, string message = "", string name = null) + => gen_array_ops.prevent_gradient(input, message: message, name: name); + + internal static Tensor constant(object value, + TF_DataType dtype = TF_DataType.DtInvalid, + int[] shape = null, + string name = "Const", + bool verify_shape = false) => constant_op._constant_impl(value, + dtype, + shape, + name, + verify_shape: verify_shape, + allow_broadcast: false); + + public static Tensor zeros(TensorShape shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) + { + dtype = dtype.as_base_dtype(); + return tf_with(ops.name_scope(name, "zeros", shape), scope => + { + name = scope; + switch (dtype) + { + case TF_DataType.TF_BOOL: + return _constant_if_small(false, shape, dtype, name); + case TF_DataType.TF_DOUBLE: + return _constant_if_small(0.0D, shape, dtype, name); + case TF_DataType.TF_FLOAT: + return _constant_if_small(0.0F, shape, dtype, name); + case TF_DataType.TF_INT64: + return _constant_if_small(0l, shape, dtype, name); + case TF_DataType.TF_INT32: + return _constant_if_small(0, shape, dtype, name); + case TF_DataType.TF_INT8: + return _constant_if_small(0, shape, dtype, name); + default: + throw new TypeError("can't find type for zeros"); + } + }); + } + + public static Tensor boolean_mask(T1 tensor, T2 mask, string name = "boolean_mask", int axis = 0) + { + return tf_with(ops.name_scope(name, values: new { tensor, mask }), delegate + { + var tensor_tensor = ops.convert_to_tensor(tensor, name: "tensor"); + var mask_tensor = ops.convert_to_tensor(mask, name: "mask"); + + var shape_mask = mask_tensor.TensorShape; + var ndims_mask = shape_mask.ndim; + var shape_tensor = tensor_tensor.TensorShape; + + if (ndims_mask < 1) + throw new ValueError("mask cannot be scalar."); + + var leading_size = gen_math_ops.prod(shape(tensor_tensor)[$"{axis}:{axis + ndims_mask}"], new[] { 0 }); + var shape1 = concat(new[] + { + shape(tensor_tensor)[$":{axis}"], + tf.expand_dims(leading_size, 0), + shape(tensor_tensor)[$"{axis + ndims_mask}:"] + }, 0); + tensor_tensor = reshape(tensor, shape1); + var first_dim = shape_tensor.dims.Skip(axis).Take(ndims_mask).First(); + var s1 = tensor_shape.as_shape(shape_tensor.dims.Take(axis).ToArray()); + var s2 = s1.concatenate(new[] { first_dim }).concatenate(shape_tensor.dims.Skip(axis + ndims_mask).ToArray()); + tensor_tensor.set_shape(s2); + + mask_tensor = reshape(mask_tensor, new[] { -1 }); + return _apply_mask_1d(tensor_tensor, mask_tensor, axis); + }); + } + + private static Tensor _apply_mask_1d(Tensor reshaped_tensor, Tensor mask, int axis = 0) + { + var indices = squeeze(where(mask), axis: new[] { 1 }); + return gather(reshaped_tensor, indices, axis: axis); + } + + public static Tensor zeros(Tensor shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) + { + dtype = dtype.as_base_dtype(); + return tf_with(ops.name_scope(name, "zeros", shape), scope => + { + name = scope; + switch (dtype) + { + case TF_DataType.TF_BOOL: + return gen_array_ops.fill(shape, tf.constant(false, dtype: dtype), name: name); + case TF_DataType.TF_DOUBLE: + return gen_array_ops.fill(shape, tf.constant(0.0D, dtype: dtype), name: name); + case TF_DataType.TF_FLOAT: + return gen_array_ops.fill(shape, tf.constant(0.0F, dtype: dtype), name: name); + case TF_DataType.TF_INT32: + return gen_array_ops.fill(shape, tf.constant(0, dtype: dtype), name: name); + default: + throw new TypeError("can't find type for zeros"); + } + + }); + } + + private static Tensor _constant_if_small(int value, Tensor shape) + { + return shape < 1000; + } + + private static Tensor _constant_if_small(T value, TensorShape shape, TF_DataType dtype, string name) + { + Tensor tShape = null; + if (shape.size < 1000) + { + return constant_op.constant(value, shape: shape, dtype: dtype, name: name); + } + else + { + tShape = constant_op._tensor_shape_tensor_conversion_function(shape); + var c = constant_op.constant(0, dtype: dtype); + return gen_array_ops.fill(tShape, c, name: name); + } + } + + public static Tensor _autopacking_conversion_function(object[] v, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool as_ref = false) + { + var inferred_dtype = _get_dtype_from_nested_lists(v); + if (dtype == TF_DataType.DtInvalid) + dtype = inferred_dtype; + + return _autopacking_helper(v, dtype, name == null ? "packed" : name); + } + + private static TF_DataType _get_dtype_from_nested_lists(object[] list_or_tuple) + { + TF_DataType dtype = TF_DataType.DtInvalid; + + foreach(var obj in list_or_tuple) + { + switch (obj) + { + case Tensor t: + dtype = t.dtype.as_base_dtype(); + break; + } + + if (dtype != TF_DataType.DtInvalid) + break; + } + + return dtype; + } + + public static Tensor _autopacking_helper(object[] list_or_tuple, TF_DataType dtype, string name) + { + var must_pack = false; + var converted_elems = new List(); + return tf_with(ops.name_scope(name), scope => + { + foreach (var (i, elem) in enumerate(list_or_tuple)) + { + converted_elems.Add(elem); + must_pack = true; + } + + if(must_pack) + { + var elems_as_tensors = new List(); + foreach (var (i, elem) in enumerate(converted_elems)) + { + if (elem is Tensor tensor) + elems_as_tensors.Add(tensor); + else + { + var elem_tensor = constant_op.constant(elem, dtype: dtype, name: i.ToString()); + elems_as_tensors.Add(elem_tensor); + } + } + + return gen_array_ops.pack(elems_as_tensors.ToArray(), name: scope); + } + else + { + return tf.constant(np.array(new float[0])); + } + }); + } + + public static Tensor expand_dims(Tensor input, int axis = -1, string name = null, int dim = -1) + => expand_dims_v2(input, axis, name); + + private static Tensor expand_dims_v2(Tensor input, int axis, string name = null) + => gen_array_ops.expand_dims(input, axis, name); + + /// + /// Returns the rank of a tensor. + /// + /// + /// + /// + public static Tensor rank(Tensor input, string name = null) + => rank_internal(input, name, optimize: true); + + public static Tensor rank_internal(Tensor input, string name = null, bool optimize = true) + { + return tf_with(ops.name_scope(name, "Rank", new List { input }), scope => + { + name = scope; + var input_tensor = ops.convert_to_tensor(input); + var input_shape = tensor_util.to_shape(input_tensor.shape); + if (optimize && input_shape.ndim > 0) + return constant_op.constant(input_shape.ndim, dtype: tf.int32, name: name); + else + return gen_array_ops.rank(input, name); + }); + } + + /// + /// Creates a tensor with all elements set to 1. + /// + /// + /// + /// + /// + /// + public static Tensor ones_like(T tensor, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool optimize = true) + => ones_like_impl(tensor, dtype, name, optimize); + + public static Tensor reshape(T1 tensor, T2 shape, string name = null) + => gen_array_ops.reshape(tensor, shape, null); + + private static Tensor ones_like_impl(T tensor, TF_DataType dtype, string name, bool optimize = true) + { + return tf_with(ops.name_scope(name, "ones_like", new { tensor }), scope => + { + name = scope; + var tensor1 = ops.convert_to_tensor(tensor, name: "tensor"); + var ones_shape = shape_internal(tensor1, optimize: optimize); + if (dtype == TF_DataType.DtInvalid) + dtype = tensor1.dtype; + var ret = ones(ones_shape, dtype: dtype, name: name); + ret.shape = tensor1.shape; + return ret; + }); + } + + public static Tensor ones(Tensor shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) + { + dtype = dtype.as_base_dtype(); + return tf_with(ops.name_scope(name, "ones", new { shape }), scope => + { + name = scope; + var output = gen_array_ops.fill(shape, constant_op.constant(1.0f, dtype: dtype), name: name); + return output; + }); + } + + public static Tensor ones(Tensor[] shape, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) + { + dtype = dtype.as_base_dtype(); + return tf_with(ops.name_scope(name, "ones", new { shape }), scope => + { + name = scope; + var output = _constant_if_small(1, shape[0]); + var shape1 = ops.convert_to_tensor(shape, dtype: TF_DataType.TF_INT32); + output = gen_array_ops.fill(shape1, constant_op.constant(1, dtype: dtype), name: name); + return output; + }); + } + + public static Tensor ones(int[] dims, TF_DataType dtype = TF_DataType.TF_FLOAT, string name = null) + { + dtype = dtype.as_base_dtype(); + return tf_with(ops.name_scope(name, "ones", new { dims }), scope => + { + name = scope; + var output = _constant_if_small(1, dims, dtype, name); + return output; + }); + } + + public static Tensor one_hot(Tensor indices, int depth, + Tensor on_value = null, + Tensor off_value = null, + TF_DataType dtype = TF_DataType.DtInvalid, + int axis = -1, + string name = null) + { + return tf_with(ops.name_scope(name, "one_hot", new { indices, depth, dtype }), scope => + { + name = scope; + var on_exists = false; + var off_exists = false; + var on_dtype = TF_DataType.DtInvalid; + var off_dtype = TF_DataType.DtInvalid; + + if (dtype == TF_DataType.DtInvalid) + dtype = TF_DataType.TF_FLOAT; + + if(!on_exists) + { + on_value = ops.convert_to_tensor(1, dtype, name: "on_value"); + on_dtype = dtype; + } + + if (!off_exists) + { + off_value = ops.convert_to_tensor(0, dtype, name = "off_value"); + off_dtype = dtype; + } + + return gen_array_ops.one_hot(indices, depth, + on_value: on_value, + off_value: off_value, + axis: axis, + name: name); + }); + } + + public static (Tensor, Tensor) unique(Tensor x, TF_DataType out_idx = TF_DataType.TF_INT32, string name = null) + => gen_array_ops.unique(x, out_idx: out_idx, name: name); + + public static Tensor stack(Tensor[] values, int axis = 0, string name = "stack") + { + if (axis == 0) + { + return ops.convert_to_tensor(values, name: name); + } + + var value_shape = ops.convert_to_tensor(values[0], name: name).TensorShape; + + return gen_array_ops.pack(values, axis: axis, name: name); + } + + public static Tensor[] unstack(Tensor value, int? num = null, int axis = 0, string name = "unstack") + { + if(num == null) + { + value = ops.convert_to_tensor(value); + var value_shape = value.TensorShape; + num = value_shape.dims[axis]; + } + + return gen_array_ops.unpack(value, num: num.Value, axis: axis, name: name); + } + + public static Tensor where(Tensor condition, object x = null, object y = null, string name = null) + { + if( x == null && y == null) + { + return tf_with(ops.name_scope(name, "Where", new { condition }), scope => + { + name = scope; + condition = ops.convert_to_tensor(condition, preferred_dtype: dtypes.@bool, name: "condition"); + return gen_array_ops.where(condition: condition, name: name); + }); + } + else if(x != null && y != null) + { + return gen_array_ops.select(condition, x, y, name); + } + else + { + throw new ValueError("x and y must both be non-None or both be None."); + } + } + + /// + /// Returns the shape of a tensor. + /// + /// A `Tensor` or `SparseTensor`. + /// A name for the operation (optional). + /// + /// (Optional) The specified output type of the operation + /// (`int32` or `int64`). Defaults to `tf.int32`. + /// + /// A `Tensor` of type `out_type`. + public static Tensor shape(Tensor input, string name = null, TF_DataType out_type = TF_DataType.TF_INT32) + => shape_internal(input, name, optimize: true, out_type: out_type); + + public static Tensor size(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) + => size_internal(input, name, optimize: optimize, out_type: out_type); + + public static Tensor shape_internal(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) + { + return tf_with(ops.name_scope(name, "Shape", new { input }), scope => + { + name = scope; + + if (!tf.context.executing_eagerly()) + { + var input_tensor = ops.convert_to_tensor(input); + var input_shape = tensor_util.to_shape(input_tensor.shape); + if (optimize && input_tensor.NDims > -1 && input_shape.is_fully_defined()) + { + var nd = np.array(input_tensor.shape).astype(out_type.as_numpy_dtype()); + return constant_op.constant(nd, name: name); + } + } + + return gen_array_ops.shape(input, name: name, out_type: out_type); + }); + } + + private static Tensor size_internal(Tensor input, string name = null, bool optimize = true, TF_DataType out_type = TF_DataType.TF_INT32) + { + return tf_with(ops.name_scope(name, "Size", new { input }), scope => + { + name = scope; + + var input_tensor = ops.convert_to_tensor(input); + var input_shape = tensor_util.to_shape(input_tensor.shape); + if (optimize) + { + if (input_shape.is_fully_defined()) + { + return constant_op.constant(input_shape.size, dtype: out_type, name: name); + } + } + + return gen_array_ops.size(input, name: name, out_type: out_type); + }); + } + + public static Tensor zeros_like(Tensor tensor, TF_DataType dtype = TF_DataType.DtInvalid, string name = null, bool optimize = true) + { + return tf_with(ops.name_scope(name, "zeros_like", new Tensor[] { tensor }), scope => + { + name = scope; + tensor = ops.convert_to_tensor(tensor, name: "tensor"); + + // is_fully_defined return unexpected value. + if (optimize && tensor_util.to_shape(tensor.shape).is_fully_defined() && dtype != TF_DataType.TF_VARIANT) + { + + } + + if(dtype != TF_DataType.DtInvalid && dtype != tensor.dtype && dtype != TF_DataType.TF_VARIANT) + { + throw new NotImplementedException("zeros_like"); + // return zeros(shape_internal(tensor, optimize: optimize), dtype: dtype, name: name); + } + else + { + return gen_array_ops.zeros_like(tensor, name: name); + } + }); + } + + /// + /// When building ops to compute gradients, this op prevents the contribution of + /// its inputs to be taken into account.Normally, the gradient generator adds ops + /// to a graph to compute the derivatives of a specified 'loss' by recursively + /// finding out inputs that contributed to its computation.If you insert this op + /// in the graph it inputs are masked from the gradient generator. They are not + /// taken into account for computing gradients. + /// + /// + /// + /// + public static Tensor stop_gradient(Tensor input, string name = null) + => gen_array_ops.stop_gradient(input, name); + + /// + /// Extracts a strided slice of a tensor (generalized python array indexing). + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Tensor strided_slice(Tensor input_, Tensor begin, Tensor end, + Tensor strides = null, + int begin_mask = 0, + int end_mask = 0, + int ellipsis_mask = 0, + int new_axis_mask = 0, + int shrink_axis_mask = 0, + string name = null) + { + var op = gen_array_ops.strided_slice( + input: input_, + begin: begin, + end: end, + strides: strides, + begin_mask: begin_mask, + end_mask: end_mask, + ellipsis_mask: ellipsis_mask, + new_axis_mask: new_axis_mask, + shrink_axis_mask: shrink_axis_mask, + name: name); + + string parent_name = name; + + return op; + } + + /// + /// Removes dimensions of size 1 from the shape of a tensor. + /// Given a tensor `input`, this operation returns a tensor of the same type with + /// all dimensions of size 1 removed.If you don't want to remove all size 1 + /// dimensions, you can remove specific size 1 dimensions by specifying + /// `axis`. + /// + /// A `Tensor`. The `input` to squeeze. + /// An optional list of `ints`. Defaults to `[]`. + /// If specified, only squeezes the dimensions listed.The dimension + /// index starts at 0. It is an error to squeeze a dimension that is not 1. + /// Must be in the range `[-rank(input), rank(input))`. + /// A name for the operation (optional). + /// Deprecated keyword argument that is now axis. + /// A `Tensor`. Has the same type as `input`. + /// Contains the same data as `input`, but has one or more dimensions of + /// size 1 removed. + public static Tensor squeeze(Tensor input, int[] axis = null, string name = null, int[] squeeze_dims = null) + => gen_array_ops.squeeze(input, axis, name); + + public static Tensor identity(Tensor input, string name = null) + => gen_array_ops.identity(input, name); + + public static Tensor invert_permutation(Tensor x, string name = null) + => gen_array_ops.invert_permutation(x, name: name); + + /// + /// Computes the shape of a broadcast given symbolic shapes. + /// When shape_x and shape_y are Tensors representing shapes(i.e.the result of + /// calling tf.shape on another Tensor) this computes a Tensor which is the shape + /// of the result of a broadcasting op applied in tensors of shapes shape_x and + /// shape_y. + /// For example, if shape_x is [1, 2, 3] and shape_y is [5, 1, 3], the result is a + /// Tensor whose value is [5, 2, 3]. + /// This is useful when validating the result of a broadcasting operation when the + /// tensors do not have statically known shapes. + /// + /// A rank 1 integer `Tensor`, representing the shape of x. + /// A rank 1 integer `Tensor`, representing the shape of y. + /// A rank 1 integer `Tensor` representing the broadcasted shape. + public static Tensor broadcast_dynamic_shape(Tensor shape_x, Tensor shape_y) + => gen_array_ops.broadcast_args(shape_x, shape_y); + + public static Tensor broadcast_static_shape(Tensor shape_x, Tensor shape_y) + => Framework.common_shapes.broadcast_shape(shape_x, shape_y); + + /// + /// Concatenates tensors along one dimension. + /// + /// + /// + /// + /// + public static Tensor concat(Tensor[] values, int axis, string name = "concat") + { + if(values.Length == 1) // Degenerate case of one tensor. + { + return tf_with(ops.name_scope(name), scope => { + var t = ops.convert_to_tensor(axis, name: "concat_dim", dtype: TF_DataType.TF_INT32); + return identity(values[0], name: scope); + }); + } + + return gen_array_ops.concat_v2(values, axis, name: name); + } + + public static Tensor concat(object[] values, int axis, string name = "concat") + { + return gen_array_ops.concat_v2(values, axis, name: name); + } + + public static Tensor gather(T1 @params, T2 indices, string name = null, int axis = 0) + { + if (axis != 0) + return gen_array_ops.gather_v2(@params, indices, axis, name: name); + + if (@params is ResourceVariable variable && + indices is Tensor indices_tensor) + return variable.sparse_read(indices_tensor, name); + + return gen_array_ops.gather_v2(@params, indices, axis, name: name); + } + + public static Tensor transpose(T1 a, T2 perm, string name = "transpose", bool conjugate = false) + { + return tf_with(ops.name_scope(name, "transpose", new { a }), scope => + { + return gen_array_ops.transpose(a, perm, name: scope); + }); + } + + public static Tensor slice(Tensor input, Tb begin, Ts size, string name = null) + => gen_array_ops.slice(input, begin, size, name: name); + + public static Tensor stack(object values, int axis = 0, string name = "stack") + { + if (axis == 0) + // If the input is a constant list, it can be converted to a constant op + return ops.convert_to_tensor(values, name: name); + + throw new NotImplementedException("array_ops.stack"); + } + + public static Tensor pad(Tensor tensor, Tensor paddings, string mode = "CONSTANT", string name = null, int constant_values = 0) + { + Tensor result = null; + mode = mode.ToUpper(); + if(mode == "CONSTANT") + { + if (constant_values != 0) + throw new NotImplementedException("gen_array_ops.pad_v2"); + else + result = gen_array_ops.pad(tensor, paddings, name: name); + } + + // Restore shape information where possible. + var paddings_constant = tensor_util.constant_value( + result.op.inputs[1], partial: true); + var input_shape = result.op.inputs[0].TensorShape; + if (input_shape.ndim > -1 && + !result.TensorShape.is_fully_defined() && + !(paddings_constant is null)) + { + var new_shape = new List(); + foreach((NDArray padding, int dim) in zip(paddings_constant.GetNDArrays(), np.array(input_shape.dims).GetNDArrays())) + { + if (padding is null || dim == -1 || padding.GetData().Contains(-1)) + new_shape.Add(-1); + else + new_shape.Add(np.sum(padding) + dim); + } + result.set_shape(new_shape.ToArray()); + } + + return result; + } + + public static Tensor placeholder(TF_DataType dtype) + { + throw new NotImplementedException("array_ops.placeholder"); + } + } +} diff --git a/src/TensorFlowNET.Core/Operations/gen_array_ops.cs b/src/TensorFlowNET.Core/Operations/gen_array_ops.cs index cea3e440..29910d04 100644 --- a/src/TensorFlowNET.Core/Operations/gen_array_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_array_ops.cs @@ -383,7 +383,7 @@ namespace Tensorflow { var _op = _op_def_lib._apply_op_helper("StopGradient", name, args: new { input = x, name }); - return _op.outputs[0]; + return _op.output; } public static Tensor strided_slice(Tensor input, Tensor begin, Tensor end, Tensor strides, diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index e4a8d175..62b0f1b4 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -115,7 +115,7 @@ namespace Tensorflow { var _op = _op_def_lib._apply_op_helper("Mean", name, args: new { input, reduction_indices = axis, keep_dims = keep_dims }); - return _op.outputs[0]; + return _op.output; } public static Tensor prod(T1 input, T2 axis, bool keep_dims = false, string name = null) diff --git a/src/TensorFlowNET.Core/Operations/gen_random_ops.py.cs b/src/TensorFlowNET.Core/Operations/gen_random_ops.cs similarity index 85% rename from src/TensorFlowNET.Core/Operations/gen_random_ops.py.cs rename to src/TensorFlowNET.Core/Operations/gen_random_ops.cs index 011b673f..1bba3a93 100644 --- a/src/TensorFlowNET.Core/Operations/gen_random_ops.py.cs +++ b/src/TensorFlowNET.Core/Operations/gen_random_ops.cs @@ -98,7 +98,8 @@ namespace Tensorflow /// /// /// - public static Tensor random_shuffle(Tensor value, int seed = 0, int seed2 = 0, string name = null) + public static Tensor random_shuffle(Tensor value, int seed = 0, int seed2 = 0, + string name = null) { var _op = _op_def_lib._apply_op_helper("RandomShuffle", name: name, @@ -116,7 +117,8 @@ namespace Tensorflow /// /// /// - public static Tensor truncated_normal(Tensor shape, TF_DataType dtype, int? seed = 0, int? seed2 = 0, string name = null) + public static Tensor truncated_normal(Tensor shape, TF_DataType dtype, int? seed = 0, + int? seed2 = 0, string name = null) { if (!seed.HasValue) seed = 0; @@ -127,7 +129,24 @@ namespace Tensorflow name: name, args: new { shape, dtype, seed, seed2 }); - return _op.outputs[0]; + return _op.output; + } + + public static Tensor multinomial(Tensor logits, int num_samples, int? seed = 0, + int? seed2 = 0, TF_DataType output_dtype = TF_DataType.TF_INT64, string name = null) + { + if (!seed.HasValue) + seed = 0; + if (!seed2.HasValue) + seed2 = 0; + if (output_dtype == TF_DataType.DtInvalid) + output_dtype = TF_DataType.TF_INT64; + + var _op = _op_def_lib._apply_op_helper("Multinomial", + name: name, + args: new { logits, num_samples, seed, seed2, output_dtype }); + + return _op.output; } } } diff --git a/src/TensorFlowNET.Core/Operations/math_ops.cs b/src/TensorFlowNET.Core/Operations/math_ops.cs index fd73dd0f..848a89cd 100644 --- a/src/TensorFlowNET.Core/Operations/math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/math_ops.cs @@ -81,6 +81,21 @@ namespace Tensorflow }); } + public static Tensor cast(float x, TF_DataType dtype = TF_DataType.DtInvalid, string name = null) + { + var base_type = dtype.as_base_dtype(); + + return tf_with(ops.name_scope(name, "Cast", new { x }), scope => + { + name = scope; + var x_tensor = ops.convert_to_tensor(x, name: "x"); + if (x_tensor.dtype.as_base_dtype() != base_type) + x_tensor = gen_math_ops.cast(x_tensor, base_type, name: name); + + return x_tensor; + }); + } + public static Tensor cumsum(Tensor x, T axis = default, bool exclusive = false, bool reverse = false, string name = null) { return tf_with(ops.name_scope(name, "Cumsum", new {x}), scope => @@ -204,6 +219,12 @@ namespace Tensorflow } } + public static Tensor reduce_mean(Tensor[] input_tensors, int axis, bool keepdims = false, string name = null) + { + var m = gen_math_ops.mean(input_tensors, axis, keepdims, name); + return _may_reduce_to_scalar(keepdims, axis, m); + } + /// /// Computes the product of elements across dimensions of a tensor. /// diff --git a/src/TensorFlowNET.Core/Operations/random_ops.py.cs b/src/TensorFlowNET.Core/Operations/random_ops.cs similarity index 83% rename from src/TensorFlowNET.Core/Operations/random_ops.py.cs rename to src/TensorFlowNET.Core/Operations/random_ops.cs index be4aef55..bd718768 100644 --- a/src/TensorFlowNET.Core/Operations/random_ops.py.cs +++ b/src/TensorFlowNET.Core/Operations/random_ops.cs @@ -142,6 +142,35 @@ namespace Tensorflow { return ops.convert_to_tensor(shape, name: "shape"); } + + public static Tensor multinomial(Tensor logits, int num_samples, int? seed = null, + string name = null, TF_DataType output_dtype = TF_DataType.DtInvalid) + { + return tf_with(ops.name_scope(name, "multinomial", new { logits }), delegate + { + return multinomial_categorical_impl(logits, num_samples, output_dtype, seed); + }); + } + + /// + /// Implementation for random.categorical (v1) and random.categorical (v2). + /// + /// + /// + /// + /// + /// + private static Tensor multinomial_categorical_impl(Tensor logits, int num_samples, TF_DataType dtype = TF_DataType.DtInvalid, + int? seed = null) + { + logits = ops.convert_to_tensor(logits, name: "logits"); + var (seed1, seed2) = random_seed.get_seed(seed); + return gen_random_ops.multinomial(logits, + num_samples, + seed: seed1, + seed2: seed2, + output_dtype: dtype); + } } } diff --git a/src/TensorFlowNET.Core/Training/learning_rate_decay.cs b/src/TensorFlowNET.Core/Training/learning_rate_decay.cs new file mode 100644 index 00000000..0315789c --- /dev/null +++ b/src/TensorFlowNET.Core/Training/learning_rate_decay.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tensorflow.Training +{ + public class learning_rate_decay + { + /// + /// Applies a polynomial decay to the learning rate. + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static Tensor polynomial_decay(float learning_rate, RefVariable global_step, float decay_steps, + float end_learning_rate = 0.0001f, float power = 1.0f, bool cycle = false, + string name = null) + { + throw new NotImplementedException(""); + } + } +}