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

MultiscaleAnchorGenerator.cs 12 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. // <auto-generated>
  2. // Generated by the protocol buffer compiler. DO NOT EDIT!
  3. // source: object_detection/protos/multiscale_anchor_generator.proto
  4. // </auto-generated>
  5. #pragma warning disable 1591, 0612, 3021
  6. #region Designer generated code
  7. using pb = global::Google.Protobuf;
  8. using pbc = global::Google.Protobuf.Collections;
  9. using pbr = global::Google.Protobuf.Reflection;
  10. using scg = global::System.Collections.Generic;
  11. namespace Tensorflow.Models.ObjectDetection.Protos {
  12. /// <summary>Holder for reflection information generated from object_detection/protos/multiscale_anchor_generator.proto</summary>
  13. public static partial class MultiscaleAnchorGeneratorReflection {
  14. #region Descriptor
  15. /// <summary>File descriptor for object_detection/protos/multiscale_anchor_generator.proto</summary>
  16. public static pbr::FileDescriptor Descriptor {
  17. get { return descriptor; }
  18. }
  19. private static pbr::FileDescriptor descriptor;
  20. static MultiscaleAnchorGeneratorReflection() {
  21. byte[] descriptorData = global::System.Convert.FromBase64String(
  22. string.Concat(
  23. "CjlvYmplY3RfZGV0ZWN0aW9uL3Byb3Rvcy9tdWx0aXNjYWxlX2FuY2hvcl9n",
  24. "ZW5lcmF0b3IucHJvdG8SF29iamVjdF9kZXRlY3Rpb24ucHJvdG9zIqgBChlN",
  25. "dWx0aXNjYWxlQW5jaG9yR2VuZXJhdG9yEhEKCW1pbl9sZXZlbBgBIAEoBRIR",
  26. "CgltYXhfbGV2ZWwYAiABKAUSFAoMYW5jaG9yX3NjYWxlGAMgASgCEhUKDWFz",
  27. "cGVjdF9yYXRpb3MYBCADKAISGQoRc2NhbGVzX3Blcl9vY3RhdmUYBSABKAUS",
  28. "HQoVbm9ybWFsaXplX2Nvb3JkaW5hdGVzGAYgASgIYgZwcm90bzM="));
  29. descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
  30. new pbr::FileDescriptor[] { },
  31. new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
  32. 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)
  33. }));
  34. }
  35. #endregion
  36. }
  37. #region Messages
  38. /// <summary>
  39. /// Configuration proto for RetinaNet anchor generator described in
  40. /// https://arxiv.org/abs/1708.02002. See
  41. /// anchor_generators/multiscale_grid_anchor_generator.py for details.
  42. /// </summary>
  43. public sealed partial class MultiscaleAnchorGenerator : pb::IMessage<MultiscaleAnchorGenerator> {
  44. private static readonly pb::MessageParser<MultiscaleAnchorGenerator> _parser = new pb::MessageParser<MultiscaleAnchorGenerator>(() => new MultiscaleAnchorGenerator());
  45. private pb::UnknownFieldSet _unknownFields;
  46. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  47. public static pb::MessageParser<MultiscaleAnchorGenerator> Parser { get { return _parser; } }
  48. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  49. public static pbr::MessageDescriptor Descriptor {
  50. get { return global::Tensorflow.Models.ObjectDetection.Protos.MultiscaleAnchorGeneratorReflection.Descriptor.MessageTypes[0]; }
  51. }
  52. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  53. pbr::MessageDescriptor pb::IMessage.Descriptor {
  54. get { return Descriptor; }
  55. }
  56. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  57. public MultiscaleAnchorGenerator() {
  58. OnConstruction();
  59. }
  60. partial void OnConstruction();
  61. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  62. public MultiscaleAnchorGenerator(MultiscaleAnchorGenerator other) : this() {
  63. minLevel_ = other.minLevel_;
  64. maxLevel_ = other.maxLevel_;
  65. anchorScale_ = other.anchorScale_;
  66. aspectRatios_ = other.aspectRatios_.Clone();
  67. scalesPerOctave_ = other.scalesPerOctave_;
  68. normalizeCoordinates_ = other.normalizeCoordinates_;
  69. _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
  70. }
  71. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  72. public MultiscaleAnchorGenerator Clone() {
  73. return new MultiscaleAnchorGenerator(this);
  74. }
  75. /// <summary>Field number for the "min_level" field.</summary>
  76. public const int MinLevelFieldNumber = 1;
  77. private int minLevel_;
  78. /// <summary>
  79. /// minimum level in feature pyramid
  80. /// </summary>
  81. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  82. public int MinLevel {
  83. get { return minLevel_; }
  84. set {
  85. minLevel_ = value;
  86. }
  87. }
  88. /// <summary>Field number for the "max_level" field.</summary>
  89. public const int MaxLevelFieldNumber = 2;
  90. private int maxLevel_;
  91. /// <summary>
  92. /// maximum level in feature pyramid
  93. /// </summary>
  94. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  95. public int MaxLevel {
  96. get { return maxLevel_; }
  97. set {
  98. maxLevel_ = value;
  99. }
  100. }
  101. /// <summary>Field number for the "anchor_scale" field.</summary>
  102. public const int AnchorScaleFieldNumber = 3;
  103. private float anchorScale_;
  104. /// <summary>
  105. /// Scale of anchor to feature stride
  106. /// </summary>
  107. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  108. public float AnchorScale {
  109. get { return anchorScale_; }
  110. set {
  111. anchorScale_ = value;
  112. }
  113. }
  114. /// <summary>Field number for the "aspect_ratios" field.</summary>
  115. public const int AspectRatiosFieldNumber = 4;
  116. private static readonly pb::FieldCodec<float> _repeated_aspectRatios_codec
  117. = pb::FieldCodec.ForFloat(34);
  118. private readonly pbc::RepeatedField<float> aspectRatios_ = new pbc::RepeatedField<float>();
  119. /// <summary>
  120. /// Aspect ratios for anchors at each grid point.
  121. /// </summary>
  122. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  123. public pbc::RepeatedField<float> AspectRatios {
  124. get { return aspectRatios_; }
  125. }
  126. /// <summary>Field number for the "scales_per_octave" field.</summary>
  127. public const int ScalesPerOctaveFieldNumber = 5;
  128. private int scalesPerOctave_;
  129. /// <summary>
  130. /// Number of intermediate scale each scale octave
  131. /// </summary>
  132. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  133. public int ScalesPerOctave {
  134. get { return scalesPerOctave_; }
  135. set {
  136. scalesPerOctave_ = value;
  137. }
  138. }
  139. /// <summary>Field number for the "normalize_coordinates" field.</summary>
  140. public const int NormalizeCoordinatesFieldNumber = 6;
  141. private bool normalizeCoordinates_;
  142. /// <summary>
  143. /// Whether to produce anchors in normalized coordinates.
  144. /// </summary>
  145. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  146. public bool NormalizeCoordinates {
  147. get { return normalizeCoordinates_; }
  148. set {
  149. normalizeCoordinates_ = value;
  150. }
  151. }
  152. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  153. public override bool Equals(object other) {
  154. return Equals(other as MultiscaleAnchorGenerator);
  155. }
  156. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  157. public bool Equals(MultiscaleAnchorGenerator other) {
  158. if (ReferenceEquals(other, null)) {
  159. return false;
  160. }
  161. if (ReferenceEquals(other, this)) {
  162. return true;
  163. }
  164. if (MinLevel != other.MinLevel) return false;
  165. if (MaxLevel != other.MaxLevel) return false;
  166. if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(AnchorScale, other.AnchorScale)) return false;
  167. if(!aspectRatios_.Equals(other.aspectRatios_)) return false;
  168. if (ScalesPerOctave != other.ScalesPerOctave) return false;
  169. if (NormalizeCoordinates != other.NormalizeCoordinates) return false;
  170. return Equals(_unknownFields, other._unknownFields);
  171. }
  172. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  173. public override int GetHashCode() {
  174. int hash = 1;
  175. if (MinLevel != 0) hash ^= MinLevel.GetHashCode();
  176. if (MaxLevel != 0) hash ^= MaxLevel.GetHashCode();
  177. if (AnchorScale != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(AnchorScale);
  178. hash ^= aspectRatios_.GetHashCode();
  179. if (ScalesPerOctave != 0) hash ^= ScalesPerOctave.GetHashCode();
  180. if (NormalizeCoordinates != false) hash ^= NormalizeCoordinates.GetHashCode();
  181. if (_unknownFields != null) {
  182. hash ^= _unknownFields.GetHashCode();
  183. }
  184. return hash;
  185. }
  186. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  187. public override string ToString() {
  188. return pb::JsonFormatter.ToDiagnosticString(this);
  189. }
  190. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  191. public void WriteTo(pb::CodedOutputStream output) {
  192. if (MinLevel != 0) {
  193. output.WriteRawTag(8);
  194. output.WriteInt32(MinLevel);
  195. }
  196. if (MaxLevel != 0) {
  197. output.WriteRawTag(16);
  198. output.WriteInt32(MaxLevel);
  199. }
  200. if (AnchorScale != 0F) {
  201. output.WriteRawTag(29);
  202. output.WriteFloat(AnchorScale);
  203. }
  204. aspectRatios_.WriteTo(output, _repeated_aspectRatios_codec);
  205. if (ScalesPerOctave != 0) {
  206. output.WriteRawTag(40);
  207. output.WriteInt32(ScalesPerOctave);
  208. }
  209. if (NormalizeCoordinates != false) {
  210. output.WriteRawTag(48);
  211. output.WriteBool(NormalizeCoordinates);
  212. }
  213. if (_unknownFields != null) {
  214. _unknownFields.WriteTo(output);
  215. }
  216. }
  217. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  218. public int CalculateSize() {
  219. int size = 0;
  220. if (MinLevel != 0) {
  221. size += 1 + pb::CodedOutputStream.ComputeInt32Size(MinLevel);
  222. }
  223. if (MaxLevel != 0) {
  224. size += 1 + pb::CodedOutputStream.ComputeInt32Size(MaxLevel);
  225. }
  226. if (AnchorScale != 0F) {
  227. size += 1 + 4;
  228. }
  229. size += aspectRatios_.CalculateSize(_repeated_aspectRatios_codec);
  230. if (ScalesPerOctave != 0) {
  231. size += 1 + pb::CodedOutputStream.ComputeInt32Size(ScalesPerOctave);
  232. }
  233. if (NormalizeCoordinates != false) {
  234. size += 1 + 1;
  235. }
  236. if (_unknownFields != null) {
  237. size += _unknownFields.CalculateSize();
  238. }
  239. return size;
  240. }
  241. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  242. public void MergeFrom(MultiscaleAnchorGenerator other) {
  243. if (other == null) {
  244. return;
  245. }
  246. if (other.MinLevel != 0) {
  247. MinLevel = other.MinLevel;
  248. }
  249. if (other.MaxLevel != 0) {
  250. MaxLevel = other.MaxLevel;
  251. }
  252. if (other.AnchorScale != 0F) {
  253. AnchorScale = other.AnchorScale;
  254. }
  255. aspectRatios_.Add(other.aspectRatios_);
  256. if (other.ScalesPerOctave != 0) {
  257. ScalesPerOctave = other.ScalesPerOctave;
  258. }
  259. if (other.NormalizeCoordinates != false) {
  260. NormalizeCoordinates = other.NormalizeCoordinates;
  261. }
  262. _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
  263. }
  264. [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
  265. public void MergeFrom(pb::CodedInputStream input) {
  266. uint tag;
  267. while ((tag = input.ReadTag()) != 0) {
  268. switch(tag) {
  269. default:
  270. _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
  271. break;
  272. case 8: {
  273. MinLevel = input.ReadInt32();
  274. break;
  275. }
  276. case 16: {
  277. MaxLevel = input.ReadInt32();
  278. break;
  279. }
  280. case 29: {
  281. AnchorScale = input.ReadFloat();
  282. break;
  283. }
  284. case 34:
  285. case 37: {
  286. aspectRatios_.AddEntriesFrom(input, _repeated_aspectRatios_codec);
  287. break;
  288. }
  289. case 40: {
  290. ScalesPerOctave = input.ReadInt32();
  291. break;
  292. }
  293. case 48: {
  294. NormalizeCoordinates = input.ReadBool();
  295. break;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. #endregion
  302. }
  303. #endregion Designer generated code