Browse Source

remove Models and Hub projects.

tags/v0.13
Oceania2018 6 years ago
parent
commit
98ead99733
93 changed files with 420 additions and 36839 deletions
  1. +40
    -68
      TensorFlow.NET.sln
  2. +1
    -1
      src/KerasNET.Core/Keras.Core.csproj
  3. +9
    -5
      src/TensorFlowNET.Core/APIs/tf.estimator.cs
  4. +20
    -0
      src/TensorFlowNET.Core/Binding.FuncTools.cs
  5. +0
    -10
      src/TensorFlowNET.Core/Binding.Util.cs
  6. +19
    -10
      src/TensorFlowNET.Core/Estimators/Estimator.cs
  7. +16
    -0
      src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs
  8. +61
    -0
      src/TensorFlowNET.Core/Estimators/Experimental.cs
  9. +2
    -2
      src/TensorFlowNET.Core/Estimators/Exporter.cs
  10. +12
    -0
      src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs
  11. +4
    -2
      src/TensorFlowNET.Core/Estimators/RunConfig.cs
  12. +2
    -2
      src/TensorFlowNET.Core/Estimators/Training.cs
  13. +2
    -2
      src/TensorFlowNET.Core/Estimators/_Evaluator.cs
  14. +3
    -3
      src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs
  15. +2
    -2
      src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs
  16. +5
    -5
      src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs
  17. +7
    -5
      src/TensorFlowNET.Core/TensorFlow.Binding.csproj
  18. +0
    -24
      src/TensorFlowNET.Datasets/DatasetBuilder.cs
  19. +0
    -10
      src/TensorFlowNET.Datasets/DownloadConfig.cs
  20. +0
    -21
      src/TensorFlowNET.Datasets/TensorFlowNET.Datasets.csproj
  21. +0
    -13
      src/TensorFlowNET.Hub/DataSetBase.cs
  22. +0
    -46
      src/TensorFlowNET.Hub/Datasets.cs
  23. +0
    -13
      src/TensorFlowNET.Hub/IDataSet.cs
  24. +0
    -14
      src/TensorFlowNET.Hub/IModelLoader.cs
  25. +0
    -86
      src/TensorFlowNET.Hub/MnistDataSet.cs
  26. +0
    -184
      src/TensorFlowNET.Hub/MnistModelLoader.cs
  27. +0
    -20
      src/TensorFlowNET.Hub/ModelLoadSetting.cs
  28. +0
    -5
      src/TensorFlowNET.Hub/README.md
  29. +0
    -23
      src/TensorFlowNET.Hub/TensorFlowNET.Hub.csproj
  30. +0
    -137
      src/TensorFlowNET.Hub/Utils.cs
  31. +0
    -15
      src/TensorFlowNET.Models/ObjectDetection/AnchorGenerators/GridAnchorGenerator.cs
  32. +0
    -27
      src/TensorFlowNET.Models/ObjectDetection/Builders/AnchorGeneratorBuilder.cs
  33. +0
    -15
      src/TensorFlowNET.Models/ObjectDetection/Builders/BoxPredictorBuilder.cs
  34. +0
    -30
      src/TensorFlowNET.Models/ObjectDetection/Builders/DatasetBuilder.cs
  35. +0
    -65
      src/TensorFlowNET.Models/ObjectDetection/Builders/ImageResizerBuilder.cs
  36. +0
    -89
      src/TensorFlowNET.Models/ObjectDetection/Builders/ModelBuilder.cs
  37. +0
    -10
      src/TensorFlowNET.Models/ObjectDetection/Core/AnchorGenerator.cs
  38. +0
    -10
      src/TensorFlowNET.Models/ObjectDetection/Core/DetectionModel.cs
  39. +0
    -69
      src/TensorFlowNET.Models/ObjectDetection/Core/Preprocessor.cs
  40. +0
    -18
      src/TensorFlowNET.Models/ObjectDetection/Core/ResizeToRangeArgs.cs
  41. +0
    -19
      src/TensorFlowNET.Models/ObjectDetection/Entities/TrainAndEvalDict.cs
  42. +0
    -60
      src/TensorFlowNET.Models/ObjectDetection/Inputs.cs
  43. +0
    -31
      src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNFeatureExtractor.cs
  44. +0
    -20
      src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNInitArgs.cs
  45. +0
    -42
      src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNMetaArch.cs
  46. +0
    -77
      src/TensorFlowNET.Models/ObjectDetection/ModelLib.cs
  47. +0
    -32
      src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnet101FeatureExtractor.cs
  48. +0
    -28
      src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnetV1FeatureExtractor.cs
  49. +0
    -133
      src/TensorFlowNET.Models/ObjectDetection/Models/faster_rcnn_resnet101_voc07.config
  50. +0
    -10
      src/TensorFlowNET.Models/ObjectDetection/Predictors/ConvolutionalBoxPredictor.cs
  51. +0
    -343
      src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs
  52. +0
    -343
      src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs
  53. +0
    -181
      src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs
  54. +0
    -341
      src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs
  55. +0
    -2587
      src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs
  56. +0
    -1413
      src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs
  57. +0
    -901
      src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs
  58. +0
    -1592
      src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs
  59. +0
    -272
      src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs
  60. +0
    -476
      src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs
  61. +0
    -417
      src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs
  62. +0
    -386
      src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs
  63. +0
    -2106
      src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs
  64. +0
    -1255
      src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs
  65. +0
    -1225
      src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs
  66. +0
    -300
      src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs
  67. +0
    -3009
      src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs
  68. +0
    -257
      src/TensorFlowNET.Models/ObjectDetection/Protos/Matcher.cs
  69. +0
    -180
      src/TensorFlowNET.Models/ObjectDetection/Protos/MeanStddevBoxCoder.cs
  70. +0
    -255
      src/TensorFlowNET.Models/ObjectDetection/Protos/Model.cs
  71. +0
    -332
      src/TensorFlowNET.Models/ObjectDetection/Protos/MultiscaleAnchorGenerator.cs
  72. +0
    -2231
      src/TensorFlowNET.Models/ObjectDetection/Protos/Optimizer.cs
  73. +0
    -352
      src/TensorFlowNET.Models/ObjectDetection/Protos/Pipeline.cs
  74. +0
    -685
      src/TensorFlowNET.Models/ObjectDetection/Protos/PostProcessing.cs
  75. +0
    -8697
      src/TensorFlowNET.Models/ObjectDetection/Protos/Preprocessor.cs
  76. +0
    -791
      src/TensorFlowNET.Models/ObjectDetection/Protos/RegionSimilarityCalculator.cs
  77. +0
    -240
      src/TensorFlowNET.Models/ObjectDetection/Protos/SquareBoxCoder.cs
  78. +0
    -2028
      src/TensorFlowNET.Models/ObjectDetection/Protos/Ssd.cs
  79. +0
    -526
      src/TensorFlowNET.Models/ObjectDetection/Protos/SsdAnchorGenerator.cs
  80. +0
    -365
      src/TensorFlowNET.Models/ObjectDetection/Protos/StringIntLabelMap.cs
  81. +0
    -1020
      src/TensorFlowNET.Models/ObjectDetection/Protos/Train.cs
  82. +0
    -101
      src/TensorFlowNET.Models/ObjectDetection/Utils/ConfigUtil.cs
  83. +0
    -14
      src/TensorFlowNET.Models/Slim/Nets/ResNetV1.cs
  84. +0
    -37
      src/TensorFlowNET.Models/TensorFlowNET.Models.csproj
  85. +0
    -9
      src/TensorFlowNET.Text/README.md
  86. +0
    -22
      src/TensorFlowNET.Text/TensorFlowNET.Text.csproj
  87. +0
    -8
      src/TensorFlowNET.Text/Tokenizer.cs
  88. +21
    -0
      src/TensorFlowNet.Benchmarks/Benchmark.csproj
  89. +29
    -0
      src/TensorFlowNet.Benchmarks/Program.cs
  90. +88
    -0
      src/TensorFlowNet.Benchmarks/TensorBenchmark.cs
  91. +76
    -0
      src/TensorFlowNet.Benchmarks/Unmanaged/StructCastBenchmark.cs
  92. +0
    -24
      test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs
  93. +1
    -5
      test/TensorFlowNET.UnitTest/UnitTest.csproj

+ 40
- 68
TensorFlow.NET.sln View File

@@ -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


+ 1
- 1
src/KerasNET.Core/Keras.Core.csproj View File

@@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\TensorFlowNET.Core\TensorFlowNET.Core.csproj" />
<ProjectReference Include="..\TensorFlowNET.Core\TensorFlow.Binding.csproj" />
</ItemGroup>

</Project>

+ 9
- 5
src/TensorFlowNET.Core/APIs/tf.estimator.cs View File

@@ -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<Thyp> Estimator<Thyp>(Func<IEstimatorInputs, EstimatorSpec> model_fn,
string model_dir = null,
RunConfig config = null,
Thyp hyperParams = default)
=> new Estimator<Thyp>(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<Thyp>(Estimator<Thyp> 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<DatasetV1Adapter> input_fn, int max_steps)


+ 20
- 0
src/TensorFlowNET.Core/Binding.FuncTools.cs View File

@@ -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<Tin, Tout> partial<Tin, Tout>(Func<Tin, Tout> func, Tin arg)
=> (arg0) => func(arg0);

public static Func<Tin1, Tin2, Tout> partial<Tin1, Tin2, Tout>(Func<Tin1, Tin2, Tout> func, (Tin1, Tin2) args)
=> (arg1, arg2) => func(arg1, arg2);
}
}
}

+ 0
- 10
src/TensorFlowNET.Core/Binding.Util.cs View File

@@ -339,15 +339,5 @@ namespace Tensorflow
return true;
return false;
}

public static Func<Tin1, Tout> partial<Tin1, Tout>(Func<Tin1, Tout> func, Tin1 args)
{
Func<Tin1, Tout> newfunc = (args1) =>
{
return func(args1);
};

return newfunc;
}
}
}

+ 19
- 10
src/TensorFlowNET.Core/Estimators/Estimator.cs View File

@@ -12,7 +12,7 @@ namespace Tensorflow.Estimators
/// <summary>
/// Estimator class to train and evaluate TensorFlow models.
/// </summary>
public class Estimator : IObjectLife
public class Estimator<Thyp> : 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<IEstimatorInputs, EstimatorSpec> _model_fn;

Action _model_fn;
Thyp _hyperParams;

public Estimator(Action model_fn, RunConfig config)
public Estimator(Func<IEstimatorInputs, EstimatorSpec> 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<DatasetV1Adapter> input_fn, int max_steps = 1, Action[] hooks = null,
_NewCheckpointListenerForEvaluate[] saving_listeners = null)
public Estimator<Thyp> train(Func<DatasetV1Adapter> input_fn, int max_steps = 1, Action[] hooks = null,
_NewCheckpointListenerForEvaluate<Thyp>[] 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();
}
}
}

+ 16
- 0
src/TensorFlowNET.Core/Estimators/EstimatorSpec.cs View File

@@ -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)
{

}
}
}

+ 61
- 0
src/TensorFlowNET.Core/Estimators/Experimental.cs View File

@@ -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
{
/// <summary>
/// Creates hook to stop if metric does not increase within given max steps.
/// </summary>
/// <typeparam name="Thyp">type of hyper parameters</typeparam>
/// <param name="estimator"></param>
/// <param name="metric_name"></param>
/// <param name="max_steps_without_increase"></param>
/// <param name="eval_dir"></param>
/// <param name="min_steps"></param>
/// <param name="run_every_secs"></param>
/// <param name="run_every_steps"></param>
/// <returns></returns>
public object stop_if_no_increase_hook<Thyp>(Estimator<Thyp> 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<Thyp>(Estimator<Thyp> 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<bool> stop_if_no_metric_improvement_fn = () =>
{
return false;
};

return make_early_stopping_hook();
}

public object make_early_stopping_hook()
{
throw new NotImplementedException("");
}
}
}

+ 2
- 2
src/TensorFlowNET.Core/Estimators/Exporter.cs View File

@@ -4,8 +4,8 @@ using System.Text;

namespace Tensorflow.Estimators
{
public abstract class Exporter
public abstract class Exporter<Thyp>
{
public abstract void export(Estimator estimator, string export_path, string checkpoint_path);
public abstract void export(Estimator<Thyp> estimator, string export_path, string checkpoint_path);
}
}

+ 12
- 0
src/TensorFlowNET.Core/Estimators/IEstimatorInputs.cs View File

@@ -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
{
}
}

+ 4
- 2
src/TensorFlowNET.Core/Estimators/RunConfig.cs View File

@@ -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();
}



+ 2
- 2
src/TensorFlowNET.Core/Estimators/Training.cs View File

@@ -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<Thyp>(Estimator<Thyp> 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<Thyp>(estimator: estimator, train_spec: train_spec, eval_spec: eval_spec);
var config = estimator.config;

executor.run();


+ 2
- 2
src/TensorFlowNET.Core/Estimators/_Evaluator.cs View File

@@ -4,9 +4,9 @@ using System.Text;

namespace Tensorflow.Estimators
{
public class _Evaluator
public class _Evaluator<Thyp>
{
public _Evaluator(Estimator estimator, EvalSpec eval_spec, int max_training_steps)
public _Evaluator(Estimator<Thyp> estimator, EvalSpec eval_spec, int max_training_steps)
{

}


+ 3
- 3
src/TensorFlowNET.Core/Estimators/_NewCheckpointListenerForEvaluate.cs View File

@@ -4,11 +4,11 @@ using System.Text;

namespace Tensorflow.Estimators
{
public class _NewCheckpointListenerForEvaluate
public class _NewCheckpointListenerForEvaluate<Thyp>
{
_Evaluator _evaluator;
_Evaluator<Thyp> _evaluator;

public _NewCheckpointListenerForEvaluate(_Evaluator evaluator, int eval_throttle_secs)
public _NewCheckpointListenerForEvaluate(_Evaluator<Thyp> evaluator, int eval_throttle_secs)
{
_evaluator = evaluator;
}


+ 2
- 2
src/TensorFlowNET.Core/Estimators/_SavedModelExporter.cs View File

@@ -4,9 +4,9 @@ using System.Text;

namespace Tensorflow.Estimators
{
public class _SavedModelExporter : Exporter
public class _SavedModelExporter<Thyp> : Exporter<Thyp>
{
public override void export(Estimator estimator, string export_path, string checkpoint_path)
public override void export(Estimator<Thyp> estimator, string export_path, string checkpoint_path)
{
}


+ 5
- 5
src/TensorFlowNET.Core/Estimators/_TrainingExecutor.cs View File

@@ -7,13 +7,13 @@ namespace Tensorflow.Estimators
/// <summary>
/// The executor to run `Estimator` training and evaluation.
/// </summary>
internal class _TrainingExecutor
internal class _TrainingExecutor<Thyp>
{
Estimator _estimator;
Estimator<Thyp> _estimator;
EvalSpec _eval_spec;
TrainSpec _train_spec;

public _TrainingExecutor(Estimator estimator, TrainSpec train_spec, EvalSpec eval_spec)
public _TrainingExecutor(Estimator<Thyp> 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<Thyp>(_estimator, _eval_spec, _train_spec.max_steps);
var saving_listeners = new _NewCheckpointListenerForEvaluate<Thyp>[0];
_estimator.train(input_fn: _train_spec.input_fn,
max_steps: _train_spec.max_steps,
hooks: train_hooks,


src/TensorFlowNET.Core/TensorFlowNET.Core.csproj → src/TensorFlowNET.Core/TensorFlow.Binding.csproj View File

@@ -5,7 +5,7 @@
<AssemblyName>TensorFlow.NET</AssemblyName>
<RootNamespace>Tensorflow</RootNamespace>
<TargetTensorFlow>1.14.1</TargetTensorFlow>
<Version>0.12.0</Version>
<Version>0.12.1</Version>
<Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors>
<Company>SciSharp STACK</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -18,13 +18,14 @@
<Description>Google's TensorFlow full binding in .NET Standard.
Building, training and infering deep learning models.
https://tensorflownet.readthedocs.io</Description>
<AssemblyVersion>0.12.0.0</AssemblyVersion>
<AssemblyVersion>0.12.1.0</AssemblyVersion>
<PackageReleaseNotes>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.</PackageReleaseNotes>
3: Add tf.nn.rnn_cell.BasicRNNCell and tf.nn.dynamic_rnn.
4: Add EstimatorSpec.</PackageReleaseNotes>
<LangVersion>7.3</LangVersion>
<FileVersion>0.12.0.0</FileVersion>
<FileVersion>0.12.1.0</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<SignAssembly>true</SignAssembly>
@@ -33,7 +34,7 @@ https://tensorflownet.readthedocs.io</Description>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>TRACE;DEBUG;SERIALIZABLE_</DefineConstants>
<DefineConstants>TRACE;DEBUG;SERIALIZABLE</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
@@ -56,6 +57,7 @@ https://tensorflownet.readthedocs.io</Description>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="NumSharp" Version="0.20.4" />
</ItemGroup>


+ 0
- 24
src/TensorFlowNET.Datasets/DatasetBuilder.cs View File

@@ -1,24 +0,0 @@
using System;

namespace TensorFlowDatasets
{
/// <summary>
/// Abstract base class for all datasets.
/// </summary>
public class DatasetBuilder
{
/// <summary>
/// Downloads and prepares dataset for reading.
/// </summary>
/// <param name="download_dir">
/// directory where downloaded files are stored.
/// </param>
/// <param name="download_config">
/// further configuration for downloading and preparing dataset.
/// </param>
public void download_and_prepare(string download_dir = null, DownloadConfig download_config = null)
{

}
}
}

+ 0
- 10
src/TensorFlowNET.Datasets/DownloadConfig.cs View File

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TensorFlowDatasets
{
public class DownloadConfig
{
}
}

+ 0
- 21
src/TensorFlowNET.Datasets/TensorFlowNET.Datasets.csproj View File

@@ -1,21 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<PackageId>SciSharp.TensorFlowDatasets</PackageId>
<Version>0.0.1</Version>
<Authors>SciSharp Team</Authors>
<Product>TensorFlow Datasets</Product>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://avatars3.githubusercontent.com/u/44989469?s=200&amp;v=4</PackageIconUrl>
<PackageProjectUrl>http://scisharpstack.org</PackageProjectUrl>
<Description>TensorFlow Datasets provides many public datasets as tf.data.Datasets.</Description>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>SciSharp, Dataset, TensorFlow</PackageTags>
<Copyright>Apache 2.0</Copyright>
<RootNamespace>TensorFlow.Datasets</RootNamespace>
<AssemblyName>TensorFlow.Datasets</AssemblyName>
</PropertyGroup>

</Project>

+ 0
- 13
src/TensorFlowNET.Hub/DataSetBase.cs View File

@@ -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; }
}
}

+ 0
- 46
src/TensorFlowNET.Hub/Datasets.cs View File

@@ -1,46 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using NumSharp;

namespace Tensorflow.Hub
{
public class Datasets<TDataSet> 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]);
}

/// <summary>
/// selects a few number of images determined by the batch_size variable (if you don't know why, read about Stochastic Gradient Method)
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
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);
}
}
}

+ 0
- 13
src/TensorFlowNET.Hub/IDataSet.cs View File

@@ -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; }
}
}

+ 0
- 14
src/TensorFlowNET.Hub/IModelLoader.cs View File

@@ -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<TDataSet>
where TDataSet : IDataSet
{
Task<Datasets<TDataSet>> LoadAsync(ModelLoadSetting setting);
}
}

+ 0
- 86
src/TensorFlowNET.Hub/MnistDataSet.cs View File

@@ -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<float>(), images_new_part.Data<float>() }, axis: 0),
np.concatenate(new float[][] { labels_rest_part.Data<float>(), labels_new_part.Data<float>() }, 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)]);
}
}
}
}

+ 0
- 184
src/TensorFlowNET.Hub/MnistModelLoader.cs View File

@@ -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<MnistDataSet>
{
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<Datasets<MnistDataSet>> 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<Datasets<MnistDataSet>> 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<MnistDataSet>(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<byte>();
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<uint>()[0];
}
}
}

+ 0
- 20
src/TensorFlowNET.Hub/ModelLoadSetting.cs View File

@@ -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; }
}
}

+ 0
- 5
src/TensorFlowNET.Hub/README.md View File

@@ -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

+ 0
- 23
src/TensorFlowNET.Hub/TensorFlowNET.Hub.csproj View File

@@ -1,23 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Tensorflow.Hub</RootNamespace>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.0.3</Version>
<Authors>Kerry Jiang</Authors>
<Company>SciSharp STACK</Company>
<Copyright>Apache 2.0</Copyright>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>http://scisharpstack.org</PackageProjectUrl>
<PackageTags>TensorFlow, SciSharp, MachineLearning</PackageTags>
<Description>TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models.</Description>
<PackageId>SciSharp.TensorFlowHub</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageIconUrl>https://avatars3.githubusercontent.com/u/44989469?s=200&amp;v=4</PackageIconUrl>
<AssemblyName>TensorFlow.Hub</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NumSharp" Version="0.20.4" />
</ItemGroup>
</Project>

+ 0
- 137
src/TensorFlowNET.Hub/Utils.cs View File

@@ -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<TDataSet>(this IModelLoader<TDataSet> 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<TDataSet>(this IModelLoader<TDataSet> 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<TDataSet>(this IModelLoader<TDataSet> 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();
}
}
}

+ 0
- 15
src/TensorFlowNET.Models/ObjectDetection/AnchorGenerators/GridAnchorGenerator.cs View File

@@ -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 };
}
}
}

+ 0
- 27
src/TensorFlowNET.Models/ObjectDetection/Builders/AnchorGeneratorBuilder.cs View File

@@ -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("");
}
}
}

+ 0
- 15
src/TensorFlowNET.Models/ObjectDetection/Builders/BoxPredictorBuilder.cs View File

@@ -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("");
}
}
}

+ 0
- 30
src/TensorFlowNET.Models/ObjectDetection/Builders/DatasetBuilder.cs View File

@@ -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<string, Tensor>, (Dictionary<string, Tensor>, Dictionary<string, Tensor>)> transform_and_pad_input_data_fn = (tensor_dict) =>
{
return (null, null);
};

var config = input_reader_config.TfRecordInputReader;

throw new NotImplementedException("");
}

public Dictionary<string, Tensor> process_fn(Tensor value)
{
throw new NotImplementedException("");
}
}
}

+ 0
- 65
src/TensorFlowNET.Models/ObjectDetection/Builders/ImageResizerBuilder.cs View File

@@ -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()
{

}

/// <summary>
/// Builds callable for image resizing operations.
/// </summary>
/// <param name="image_resizer_config"></param>
/// <returns></returns>
public Func<ResizeToRangeArgs, Tensor[]> 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<ResizeToRangeArgs, Tensor[]> 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;
}
}
}

+ 0
- 89
src/TensorFlowNET.Models/ObjectDetection/Builders/ModelBuilder.cs View File

@@ -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();
}

/// <summary>
/// Builds a DetectionModel based on the model config.
/// </summary>
/// <param name="model_config">A model.proto object containing the config for the desired DetectionModel.</param>
/// <param name="is_training">True if this model is being built for training purposes.</param>
/// <param name="add_summaries">Whether to add tensorflow summaries in the model graph.</param>
/// <returns>DetectionModel based on the config.</returns>
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}");
}

/// <summary>
/// Builds a Faster R-CNN or R-FCN detection model based on the model config.
/// </summary>
/// <param name="frcnn_config"></param>
/// <param name="is_training"></param>
/// <param name="add_summaries"></param>
/// <returns>FasterRCNNMetaArch based on the config.</returns>
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);
}
}
}

+ 0
- 10
src/TensorFlowNET.Models/ObjectDetection/Core/AnchorGenerator.cs View File

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Models.ObjectDetection.Core
{
public class AnchorGenerator
{
}
}

+ 0
- 10
src/TensorFlowNET.Models/ObjectDetection/Core/DetectionModel.cs View File

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Models.ObjectDetection.Core
{
public abstract class DetectionModel
{
}
}

+ 0
- 69
src/TensorFlowNET.Models/ObjectDetection/Core/Preprocessor.cs View File

@@ -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<Tensor, Tensor> _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<Tensor, Tensor> _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<Tensor> { new_image };
if (args.masks != null)
throw new NotImplementedException("");

result.Add(new_size);

return result.ToArray();
});
}
}
}

+ 0
- 18
src/TensorFlowNET.Models/ObjectDetection/Core/ResizeToRangeArgs.cs View File

@@ -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; }
}
}

+ 0
- 19
src/TensorFlowNET.Models/ObjectDetection/Entities/TrainAndEvalDict.cs View File

@@ -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<DatasetV1Adapter> 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; }
}
}

+ 0
- 60
src/TensorFlowNET.Models/ObjectDetection/Inputs.cs View File

@@ -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<DatasetV1Adapter> create_train_input_fn(TrainConfig train_config, InputReader train_input_config, DetectionModel model_config)
{
Func<DatasetV1Adapter> _train_input_fn = () =>
train_input(train_config, train_input_config, model_config);

return _train_input_fn;
}

/// <summary>
/// Returns `features` and `labels` tensor dictionaries for training.
/// </summary>
/// <param name="train_config"></param>
/// <param name="train_input_config"></param>
/// <param name="model_config"></param>
/// <returns></returns>
public DatasetV1Adapter train_input(TrainConfig train_config, InputReader train_input_config, DetectionModel model_config)
{
var arch = modelBuilder.build(model_config, true, true);
Func<Tensor, (Tensor, Tensor)> model_preprocess_fn = arch.preprocess;

Func<Dictionary<string, Tensor>, (Dictionary<string, Tensor>, Dictionary<string, Tensor>) > 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<string, Tensor> _get_features_dict(Dictionary<string, Tensor> input_dict)
{
throw new NotImplementedException("_get_features_dict");
}

private Dictionary<string, Tensor> _get_labels_dict(Dictionary<string, Tensor> input_dict)
{
throw new NotImplementedException("_get_labels_dict");
}
}
}

+ 0
- 31
src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNFeatureExtractor.cs View File

@@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Models.ObjectDetection
{
/// <summary>
/// Faster R-CNN Feature Extractor definition.
/// </summary>
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;
}
}
}

+ 0
- 20
src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNInitArgs.cs View File

@@ -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<ResizeToRangeArgs, Tensor[]> 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;
}
}

+ 0
- 42
src/TensorFlowNET.Models/ObjectDetection/MetaArchitectures/FasterRCNNMetaArch.cs View File

@@ -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;
}

/// <summary>
/// Feature-extractor specific preprocessing.
/// </summary>
/// <param name="inputs"></param>
/// <returns></returns>
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("");
}
}
}

+ 0
- 77
src/TensorFlowNET.Models/ObjectDetection/ModelLib.cs View File

@@ -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<DatasetV1Adapter> 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<DatasetV1Adapter> 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<EvalSpec>();
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());
}
}
}

+ 0
- 32
src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnet101FeatureExtractor.cs View File

@@ -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
{
/// <summary>
/// Faster R-CNN Resnet 101 feature extractor implementation.
/// </summary>
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)
{

}
}
}

+ 0
- 28
src/TensorFlowNET.Models/ObjectDetection/Models/FasterRCNNResnetV1FeatureExtractor.cs View File

@@ -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();
}
}
}

+ 0
- 133
src/TensorFlowNET.Models/ObjectDetection/Models/faster_rcnn_resnet101_voc07.config View File

@@ -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
}

+ 0
- 10
src/TensorFlowNET.Models/ObjectDetection/Predictors/ConvolutionalBoxPredictor.cs View File

@@ -1,10 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Models.ObjectDetection
{
public class ConvolutionalBoxPredictor
{
}
}

+ 0
- 343
src/TensorFlowNET.Models/ObjectDetection/Protos/AnchorGenerator.cs View File

@@ -1,343 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/anchor_generator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/anchor_generator.proto</summary>
public static partial class AnchorGeneratorReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/anchor_generator.proto</summary>
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
/// <summary>
/// Configuration proto for the anchor generator to use in the object detection
/// pipeline. See core/anchor_generator.py for details.
/// </summary>
public sealed partial class AnchorGenerator : pb::IMessage<AnchorGenerator> {
private static readonly pb::MessageParser<AnchorGenerator> _parser = new pb::MessageParser<AnchorGenerator>(() => new AnchorGenerator());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AnchorGenerator> 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);
}

/// <summary>Field number for the "grid_anchor_generator" field.</summary>
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;
}
}

/// <summary>Field number for the "ssd_anchor_generator" field.</summary>
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;
}
}

/// <summary>Field number for the "multiscale_anchor_generator" field.</summary>
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;
}
}

/// <summary>Field number for the "flexible_grid_anchor_generator" field.</summary>
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_;
/// <summary>Enum of possible cases for the "anchor_generator_oneof" oneof.</summary>
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

+ 0
- 343
src/TensorFlowNET.Models/ObjectDetection/Protos/ArgmaxMatcher.cs View File

@@ -1,343 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/argmax_matcher.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/argmax_matcher.proto</summary>
public static partial class ArgmaxMatcherReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/argmax_matcher.proto</summary>
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
/// <summary>
/// Configuration proto for ArgMaxMatcher. See
/// matchers/argmax_matcher.py for details.
/// </summary>
public sealed partial class ArgMaxMatcher : pb::IMessage<ArgMaxMatcher> {
private static readonly pb::MessageParser<ArgMaxMatcher> _parser = new pb::MessageParser<ArgMaxMatcher>(() => new ArgMaxMatcher());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ArgMaxMatcher> 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);
}

/// <summary>Field number for the "matched_threshold" field.</summary>
public const int MatchedThresholdFieldNumber = 1;
private float matchedThreshold_;
/// <summary>
/// Threshold for positive matches.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float MatchedThreshold {
get { return matchedThreshold_; }
set {
matchedThreshold_ = value;
}
}

/// <summary>Field number for the "unmatched_threshold" field.</summary>
public const int UnmatchedThresholdFieldNumber = 2;
private float unmatchedThreshold_;
/// <summary>
/// Threshold for negative matches.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float UnmatchedThreshold {
get { return unmatchedThreshold_; }
set {
unmatchedThreshold_ = value;
}
}

/// <summary>Field number for the "ignore_thresholds" field.</summary>
public const int IgnoreThresholdsFieldNumber = 3;
private bool ignoreThresholds_;
/// <summary>
/// Whether to construct ArgMaxMatcher without thresholds.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool IgnoreThresholds {
get { return ignoreThresholds_; }
set {
ignoreThresholds_ = value;
}
}

/// <summary>Field number for the "negatives_lower_than_unmatched" field.</summary>
public const int NegativesLowerThanUnmatchedFieldNumber = 4;
private bool negativesLowerThanUnmatched_;
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool NegativesLowerThanUnmatched {
get { return negativesLowerThanUnmatched_; }
set {
negativesLowerThanUnmatched_ = value;
}
}

/// <summary>Field number for the "force_match_for_each_row" field.</summary>
public const int ForceMatchForEachRowFieldNumber = 5;
private bool forceMatchForEachRow_;
/// <summary>
/// Whether to ensure each row is matched to at least one column.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool ForceMatchForEachRow {
get { return forceMatchForEachRow_; }
set {
forceMatchForEachRow_ = value;
}
}

/// <summary>Field number for the "use_matmul_gather" field.</summary>
public const int UseMatmulGatherFieldNumber = 6;
private bool useMatmulGather_;
/// <summary>
/// Force constructed match objects to use matrix multiplication based gather
/// instead of standard tf.gather
/// </summary>
[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

+ 0
- 181
src/TensorFlowNET.Models/ObjectDetection/Protos/BipartiteMatcher.cs View File

@@ -1,181 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/bipartite_matcher.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/bipartite_matcher.proto</summary>
public static partial class BipartiteMatcherReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/bipartite_matcher.proto</summary>
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
/// <summary>
/// Configuration proto for bipartite matcher. See
/// matchers/bipartite_matcher.py for details.
/// </summary>
public sealed partial class BipartiteMatcher : pb::IMessage<BipartiteMatcher> {
private static readonly pb::MessageParser<BipartiteMatcher> _parser = new pb::MessageParser<BipartiteMatcher>(() => new BipartiteMatcher());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BipartiteMatcher> 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);
}

/// <summary>Field number for the "use_matmul_gather" field.</summary>
public const int UseMatmulGatherFieldNumber = 6;
private bool useMatmulGather_;
/// <summary>
/// Force constructed match objects to use matrix multiplication based gather
/// instead of standard tf.gather
/// </summary>
[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

+ 0
- 341
src/TensorFlowNET.Models/ObjectDetection/Protos/BoxCoder.cs View File

@@ -1,341 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/box_coder.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/box_coder.proto</summary>
public static partial class BoxCoderReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/box_coder.proto</summary>
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
/// <summary>
/// Configuration proto for the box coder to be used in the object detection
/// pipeline. See core/box_coder.py for details.
/// </summary>
public sealed partial class BoxCoder : pb::IMessage<BoxCoder> {
private static readonly pb::MessageParser<BoxCoder> _parser = new pb::MessageParser<BoxCoder>(() => new BoxCoder());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BoxCoder> 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);
}

/// <summary>Field number for the "faster_rcnn_box_coder" field.</summary>
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;
}
}

/// <summary>Field number for the "mean_stddev_box_coder" field.</summary>
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;
}
}

/// <summary>Field number for the "square_box_coder" field.</summary>
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;
}
}

/// <summary>Field number for the "keypoint_box_coder" field.</summary>
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_;
/// <summary>Enum of possible cases for the "box_coder_oneof" oneof.</summary>
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

+ 0
- 2587
src/TensorFlowNET.Models/ObjectDetection/Protos/BoxPredictor.cs
File diff suppressed because it is too large
View File


+ 0
- 1413
src/TensorFlowNET.Models/ObjectDetection/Protos/Calibration.cs
File diff suppressed because it is too large
View File


+ 0
- 901
src/TensorFlowNET.Models/ObjectDetection/Protos/Eval.cs View File

@@ -1,901 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/eval.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/eval.proto</summary>
public static partial class EvalReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/eval.proto</summary>
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
/// <summary>
/// Message for configuring DetectionModel evaluation jobs (eval.py).
/// </summary>
public sealed partial class EvalConfig : pb::IMessage<EvalConfig> {
private static readonly pb::MessageParser<EvalConfig> _parser = new pb::MessageParser<EvalConfig>(() => new EvalConfig());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<EvalConfig> 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);
}

/// <summary>Field number for the "batch_size" field.</summary>
public const int BatchSizeFieldNumber = 25;
private uint batchSize_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint BatchSize {
get { return batchSize_; }
set {
batchSize_ = value;
}
}

/// <summary>Field number for the "num_visualizations" field.</summary>
public const int NumVisualizationsFieldNumber = 1;
private uint numVisualizations_;
/// <summary>
/// Number of visualization images to generate.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint NumVisualizations {
get { return numVisualizations_; }
set {
numVisualizations_ = value;
}
}

/// <summary>Field number for the "num_examples" field.</summary>
public const int NumExamplesFieldNumber = 2;
private uint numExamples_;
/// <summary>
/// Number of examples to process of evaluation.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint NumExamples {
get { return numExamples_; }
set {
numExamples_ = value;
}
}

/// <summary>Field number for the "eval_interval_secs" field.</summary>
public const int EvalIntervalSecsFieldNumber = 3;
private uint evalIntervalSecs_;
/// <summary>
/// How often to run evaluation.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint EvalIntervalSecs {
get { return evalIntervalSecs_; }
set {
evalIntervalSecs_ = value;
}
}

/// <summary>Field number for the "max_evals" field.</summary>
public const int MaxEvalsFieldNumber = 4;
private uint maxEvals_;
/// <summary>
/// Maximum number of times to run evaluation. If set to 0, will run forever.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint MaxEvals {
get { return maxEvals_; }
set {
maxEvals_ = value;
}
}

/// <summary>Field number for the "save_graph" field.</summary>
public const int SaveGraphFieldNumber = 5;
private bool saveGraph_;
/// <summary>
/// Whether the TensorFlow graph used for evaluation should be saved to disk.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool SaveGraph {
get { return saveGraph_; }
set {
saveGraph_ = value;
}
}

/// <summary>Field number for the "visualization_export_dir" field.</summary>
public const int VisualizationExportDirFieldNumber = 6;
private string visualizationExportDir_ = "";
/// <summary>
/// Path to directory to store visualizations in. If empty, visualization
/// images are not exported (only shown on Tensorboard).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string VisualizationExportDir {
get { return visualizationExportDir_; }
set {
visualizationExportDir_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "eval_master" field.</summary>
public const int EvalMasterFieldNumber = 7;
private string evalMaster_ = "";
/// <summary>
/// BNS name of the TensorFlow master.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string EvalMaster {
get { return evalMaster_; }
set {
evalMaster_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "metrics_set" field.</summary>
public const int MetricsSetFieldNumber = 8;
private static readonly pb::FieldCodec<string> _repeated_metricsSet_codec
= pb::FieldCodec.ForString(66);
private readonly pbc::RepeatedField<string> metricsSet_ = new pbc::RepeatedField<string>();
/// <summary>
/// Type of metrics to use for evaluation.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> MetricsSet {
get { return metricsSet_; }
}

/// <summary>Field number for the "export_path" field.</summary>
public const int ExportPathFieldNumber = 9;
private string exportPath_ = "";
/// <summary>
/// Path to export detections to COCO compatible JSON format.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string ExportPath {
get { return exportPath_; }
set {
exportPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "ignore_groundtruth" field.</summary>
public const int IgnoreGroundtruthFieldNumber = 10;
private bool ignoreGroundtruth_;
/// <summary>
/// Option to not read groundtruth labels and only export detections to
/// COCO-compatible JSON file.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool IgnoreGroundtruth {
get { return ignoreGroundtruth_; }
set {
ignoreGroundtruth_ = value;
}
}

/// <summary>Field number for the "use_moving_averages" field.</summary>
public const int UseMovingAveragesFieldNumber = 11;
private bool useMovingAverages_;
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool UseMovingAverages {
get { return useMovingAverages_; }
set {
useMovingAverages_ = value;
}
}

/// <summary>Field number for the "eval_instance_masks" field.</summary>
public const int EvalInstanceMasksFieldNumber = 12;
private bool evalInstanceMasks_;
/// <summary>
/// Whether to evaluate instance masks.
/// Note that since there is no evaluation code currently for instance
/// segmenation this option is unused.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool EvalInstanceMasks {
get { return evalInstanceMasks_; }
set {
evalInstanceMasks_ = value;
}
}

/// <summary>Field number for the "min_score_threshold" field.</summary>
public const int MinScoreThresholdFieldNumber = 13;
private float minScoreThreshold_;
/// <summary>
/// Minimum score threshold for a detected object box to be visualized
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float MinScoreThreshold {
get { return minScoreThreshold_; }
set {
minScoreThreshold_ = value;
}
}

/// <summary>Field number for the "max_num_boxes_to_visualize" field.</summary>
public const int MaxNumBoxesToVisualizeFieldNumber = 14;
private int maxNumBoxesToVisualize_;
/// <summary>
/// Maximum number of detections to visualize
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MaxNumBoxesToVisualize {
get { return maxNumBoxesToVisualize_; }
set {
maxNumBoxesToVisualize_ = value;
}
}

/// <summary>Field number for the "skip_scores" field.</summary>
public const int SkipScoresFieldNumber = 15;
private bool skipScores_;
/// <summary>
/// When drawing a single detection, each label is by default visualized as
/// &lt;label name> : &lt;label score>. One can skip the name or/and score using the
/// following fields:
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool SkipScores {
get { return skipScores_; }
set {
skipScores_ = value;
}
}

/// <summary>Field number for the "skip_labels" field.</summary>
public const int SkipLabelsFieldNumber = 16;
private bool skipLabels_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool SkipLabels {
get { return skipLabels_; }
set {
skipLabels_ = value;
}
}

/// <summary>Field number for the "visualize_groundtruth_boxes" field.</summary>
public const int VisualizeGroundtruthBoxesFieldNumber = 17;
private bool visualizeGroundtruthBoxes_;
/// <summary>
/// Whether to show groundtruth boxes in addition to detected boxes in
/// visualizations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool VisualizeGroundtruthBoxes {
get { return visualizeGroundtruthBoxes_; }
set {
visualizeGroundtruthBoxes_ = value;
}
}

/// <summary>Field number for the "groundtruth_box_visualization_color" field.</summary>
public const int GroundtruthBoxVisualizationColorFieldNumber = 18;
private string groundtruthBoxVisualizationColor_ = "";
/// <summary>
/// Box color for visualizing groundtruth boxes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string GroundtruthBoxVisualizationColor {
get { return groundtruthBoxVisualizationColor_; }
set {
groundtruthBoxVisualizationColor_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "keep_image_id_for_visualization_export" field.</summary>
public const int KeepImageIdForVisualizationExportFieldNumber = 19;
private bool keepImageIdForVisualizationExport_;
/// <summary>
/// Whether to keep image identifier in filename when exported to
/// visualization_export_dir.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool KeepImageIdForVisualizationExport {
get { return keepImageIdForVisualizationExport_; }
set {
keepImageIdForVisualizationExport_ = value;
}
}

/// <summary>Field number for the "retain_original_images" field.</summary>
public const int RetainOriginalImagesFieldNumber = 23;
private bool retainOriginalImages_;
/// <summary>
/// Whether to retain original images (i.e. not pre-processed) in the tensor
/// dictionary, so that they can be displayed in Tensorboard.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool RetainOriginalImages {
get { return retainOriginalImages_; }
set {
retainOriginalImages_ = value;
}
}

/// <summary>Field number for the "include_metrics_per_category" field.</summary>
public const int IncludeMetricsPerCategoryFieldNumber = 24;
private bool includeMetricsPerCategory_;
/// <summary>
/// If True, additionally include per-category metrics.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool IncludeMetricsPerCategory {
get { return includeMetricsPerCategory_; }
set {
includeMetricsPerCategory_ = value;
}
}

/// <summary>Field number for the "recall_lower_bound" field.</summary>
public const int RecallLowerBoundFieldNumber = 26;
private float recallLowerBound_;
/// <summary>
/// Recall range within which precision should be computed.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RecallLowerBound {
get { return recallLowerBound_; }
set {
recallLowerBound_ = value;
}
}

/// <summary>Field number for the "recall_upper_bound" field.</summary>
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

+ 0
- 1592
src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnn.cs
File diff suppressed because it is too large
View File


+ 0
- 272
src/TensorFlowNET.Models/ObjectDetection/Protos/FasterRcnnBoxCoder.cs View File

@@ -1,272 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/faster_rcnn_box_coder.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/faster_rcnn_box_coder.proto</summary>
public static partial class FasterRcnnBoxCoderReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/faster_rcnn_box_coder.proto</summary>
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
/// <summary>
/// Configuration proto for FasterRCNNBoxCoder. See
/// box_coders/faster_rcnn_box_coder.py for details.
/// </summary>
public sealed partial class FasterRcnnBoxCoder : pb::IMessage<FasterRcnnBoxCoder> {
private static readonly pb::MessageParser<FasterRcnnBoxCoder> _parser = new pb::MessageParser<FasterRcnnBoxCoder>(() => new FasterRcnnBoxCoder());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FasterRcnnBoxCoder> 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);
}

/// <summary>Field number for the "y_scale" field.</summary>
public const int YScaleFieldNumber = 1;
private float yScale_;
/// <summary>
/// Scale factor for anchor encoded box center.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float YScale {
get { return yScale_; }
set {
yScale_ = value;
}
}

/// <summary>Field number for the "x_scale" field.</summary>
public const int XScaleFieldNumber = 2;
private float xScale_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float XScale {
get { return xScale_; }
set {
xScale_ = value;
}
}

/// <summary>Field number for the "height_scale" field.</summary>
public const int HeightScaleFieldNumber = 3;
private float heightScale_;
/// <summary>
/// Scale factor for anchor encoded box height.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float HeightScale {
get { return heightScale_; }
set {
heightScale_ = value;
}
}

/// <summary>Field number for the "width_scale" field.</summary>
public const int WidthScaleFieldNumber = 4;
private float widthScale_;
/// <summary>
/// Scale factor for anchor encoded box width.
/// </summary>
[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

+ 0
- 476
src/TensorFlowNET.Models/ObjectDetection/Protos/FlexibleGridAnchorGenerator.cs View File

@@ -1,476 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/flexible_grid_anchor_generator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/flexible_grid_anchor_generator.proto</summary>
public static partial class FlexibleGridAnchorGeneratorReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/flexible_grid_anchor_generator.proto</summary>
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<FlexibleGridAnchorGenerator> {
private static readonly pb::MessageParser<FlexibleGridAnchorGenerator> _parser = new pb::MessageParser<FlexibleGridAnchorGenerator>(() => new FlexibleGridAnchorGenerator());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FlexibleGridAnchorGenerator> 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);
}

/// <summary>Field number for the "anchor_grid" field.</summary>
public const int AnchorGridFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid> _repeated_anchorGrid_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid> anchorGrid_ = new pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.AnchorGrid> AnchorGrid {
get { return anchorGrid_; }
}

/// <summary>Field number for the "normalize_coordinates" field.</summary>
public const int NormalizeCoordinatesFieldNumber = 2;
private bool normalizeCoordinates_;
/// <summary>
/// Whether to produce anchors in normalized coordinates.
/// </summary>
[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<AnchorGrid> {
private static readonly pb::MessageParser<AnchorGrid> _parser = new pb::MessageParser<AnchorGrid>(() => new AnchorGrid());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AnchorGrid> 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);
}

/// <summary>Field number for the "base_sizes" field.</summary>
public const int BaseSizesFieldNumber = 1;
private static readonly pb::FieldCodec<float> _repeated_baseSizes_codec
= pb::FieldCodec.ForFloat(10);
private readonly pbc::RepeatedField<float> baseSizes_ = new pbc::RepeatedField<float>();
/// <summary>
/// The base sizes in pixels for each anchor in this anchor layer.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> BaseSizes {
get { return baseSizes_; }
}

/// <summary>Field number for the "aspect_ratios" field.</summary>
public const int AspectRatiosFieldNumber = 2;
private static readonly pb::FieldCodec<float> _repeated_aspectRatios_codec
= pb::FieldCodec.ForFloat(18);
private readonly pbc::RepeatedField<float> aspectRatios_ = new pbc::RepeatedField<float>();
/// <summary>
/// The aspect ratios for each anchor in this anchor layer.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> AspectRatios {
get { return aspectRatios_; }
}

/// <summary>Field number for the "height_stride" field.</summary>
public const int HeightStrideFieldNumber = 3;
private uint heightStride_;
/// <summary>
/// The anchor height stride in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint HeightStride {
get { return heightStride_; }
set {
heightStride_ = value;
}
}

/// <summary>Field number for the "width_stride" field.</summary>
public const int WidthStrideFieldNumber = 4;
private uint widthStride_;
/// <summary>
/// The anchor width stride in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint WidthStride {
get { return widthStride_; }
set {
widthStride_ = value;
}
}

/// <summary>Field number for the "height_offset" field.</summary>
public const int HeightOffsetFieldNumber = 5;
private uint heightOffset_;
/// <summary>
/// The anchor height offset in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public uint HeightOffset {
get { return heightOffset_; }
set {
heightOffset_ = value;
}
}

/// <summary>Field number for the "width_offset" field.</summary>
public const int WidthOffsetFieldNumber = 6;
private uint widthOffset_;
/// <summary>
/// The anchor width offset in pixels.
/// </summary>
[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

+ 0
- 417
src/TensorFlowNET.Models/ObjectDetection/Protos/GraphRewriter.cs View File

@@ -1,417 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/graph_rewriter.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/graph_rewriter.proto</summary>
public static partial class GraphRewriterReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/graph_rewriter.proto</summary>
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
/// <summary>
/// Message to configure graph rewriter for the tf graph.
/// </summary>
public sealed partial class GraphRewriter : pb::IMessage<GraphRewriter> {
private static readonly pb::MessageParser<GraphRewriter> _parser = new pb::MessageParser<GraphRewriter>(() => new GraphRewriter());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GraphRewriter> 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);
}

/// <summary>Field number for the "quantization" field.</summary>
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;
}
}
}
}

}

/// <summary>
/// Message for quantization options. See
/// tensorflow/contrib/quantize/python/quantize.py for details.
/// </summary>
public sealed partial class Quantization : pb::IMessage<Quantization> {
private static readonly pb::MessageParser<Quantization> _parser = new pb::MessageParser<Quantization>(() => new Quantization());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Quantization> 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);
}

/// <summary>Field number for the "delay" field.</summary>
public const int DelayFieldNumber = 1;
private int delay_;
/// <summary>
/// Number of steps to delay before quantization takes effect during training.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Delay {
get { return delay_; }
set {
delay_ = value;
}
}

/// <summary>Field number for the "weight_bits" field.</summary>
public const int WeightBitsFieldNumber = 2;
private int weightBits_;
/// <summary>
/// Number of bits to use for quantizing weights.
/// Only 8 bit is supported for now.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int WeightBits {
get { return weightBits_; }
set {
weightBits_ = value;
}
}

/// <summary>Field number for the "activation_bits" field.</summary>
public const int ActivationBitsFieldNumber = 3;
private int activationBits_;
/// <summary>
/// Number of bits to use for quantizing activations.
/// Only 8 bit is supported for now.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ActivationBits {
get { return activationBits_; }
set {
activationBits_ = value;
}
}

/// <summary>Field number for the "symmetric" field.</summary>
public const int SymmetricFieldNumber = 4;
private bool symmetric_;
/// <summary>
/// Whether to use symmetric weight quantization.
/// </summary>
[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

+ 0
- 386
src/TensorFlowNET.Models/ObjectDetection/Protos/GridAnchorGenerator.cs View File

@@ -1,386 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/grid_anchor_generator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/grid_anchor_generator.proto</summary>
public static partial class GridAnchorGeneratorReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/grid_anchor_generator.proto</summary>
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
/// <summary>
/// Configuration proto for GridAnchorGenerator. See
/// anchor_generators/grid_anchor_generator.py for details.
/// </summary>
public sealed partial class GridAnchorGenerator : pb::IMessage<GridAnchorGenerator> {
private static readonly pb::MessageParser<GridAnchorGenerator> _parser = new pb::MessageParser<GridAnchorGenerator>(() => new GridAnchorGenerator());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GridAnchorGenerator> 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);
}

/// <summary>Field number for the "height" field.</summary>
public const int HeightFieldNumber = 1;
private int height_;
/// <summary>
/// Anchor height in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Height {
get { return height_; }
set {
height_ = value;
}
}

/// <summary>Field number for the "width" field.</summary>
public const int WidthFieldNumber = 2;
private int width_;
/// <summary>
/// Anchor width in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Width {
get { return width_; }
set {
width_ = value;
}
}

/// <summary>Field number for the "height_stride" field.</summary>
public const int HeightStrideFieldNumber = 3;
private int heightStride_;
/// <summary>
/// Anchor stride in height dimension in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int HeightStride {
get { return heightStride_; }
set {
heightStride_ = value;
}
}

/// <summary>Field number for the "width_stride" field.</summary>
public const int WidthStrideFieldNumber = 4;
private int widthStride_;
/// <summary>
/// Anchor stride in width dimension in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int WidthStride {
get { return widthStride_; }
set {
widthStride_ = value;
}
}

/// <summary>Field number for the "height_offset" field.</summary>
public const int HeightOffsetFieldNumber = 5;
private int heightOffset_;
/// <summary>
/// Anchor height offset in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int HeightOffset {
get { return heightOffset_; }
set {
heightOffset_ = value;
}
}

/// <summary>Field number for the "width_offset" field.</summary>
public const int WidthOffsetFieldNumber = 6;
private int widthOffset_;
/// <summary>
/// Anchor width offset in pixels.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int WidthOffset {
get { return widthOffset_; }
set {
widthOffset_ = value;
}
}

/// <summary>Field number for the "scales" field.</summary>
public const int ScalesFieldNumber = 7;
private static readonly pb::FieldCodec<float> _repeated_scales_codec
= pb::FieldCodec.ForFloat(58);
private readonly pbc::RepeatedField<float> scales_ = new pbc::RepeatedField<float>();
/// <summary>
/// List of scales for the anchors.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> Scales {
get { return scales_; }
}

/// <summary>Field number for the "aspect_ratios" field.</summary>
public const int AspectRatiosFieldNumber = 8;
private static readonly pb::FieldCodec<float> _repeated_aspectRatios_codec
= pb::FieldCodec.ForFloat(66);
private readonly pbc::RepeatedField<float> aspectRatios_ = new pbc::RepeatedField<float>();
/// <summary>
/// List of aspect ratios for the anchors.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> 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

+ 0
- 2106
src/TensorFlowNET.Models/ObjectDetection/Protos/Hyperparams.cs
File diff suppressed because it is too large
View File


+ 0
- 1255
src/TensorFlowNET.Models/ObjectDetection/Protos/ImageResizer.cs
File diff suppressed because it is too large
View File


+ 0
- 1225
src/TensorFlowNET.Models/ObjectDetection/Protos/InputReader.cs
File diff suppressed because it is too large
View File


+ 0
- 300
src/TensorFlowNET.Models/ObjectDetection/Protos/KeypointBoxCoder.cs View File

@@ -1,300 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/keypoint_box_coder.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/keypoint_box_coder.proto</summary>
public static partial class KeypointBoxCoderReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/keypoint_box_coder.proto</summary>
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
/// <summary>
/// Configuration proto for KeypointBoxCoder. See
/// box_coders/keypoint_box_coder.py for details.
/// </summary>
public sealed partial class KeypointBoxCoder : pb::IMessage<KeypointBoxCoder> {
private static readonly pb::MessageParser<KeypointBoxCoder> _parser = new pb::MessageParser<KeypointBoxCoder>(() => new KeypointBoxCoder());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<KeypointBoxCoder> 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);
}

/// <summary>Field number for the "num_keypoints" field.</summary>
public const int NumKeypointsFieldNumber = 1;
private int numKeypoints_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumKeypoints {
get { return numKeypoints_; }
set {
numKeypoints_ = value;
}
}

/// <summary>Field number for the "y_scale" field.</summary>
public const int YScaleFieldNumber = 2;
private float yScale_;
/// <summary>
/// Scale factor for anchor encoded box center and keypoints.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float YScale {
get { return yScale_; }
set {
yScale_ = value;
}
}

/// <summary>Field number for the "x_scale" field.</summary>
public const int XScaleFieldNumber = 3;
private float xScale_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float XScale {
get { return xScale_; }
set {
xScale_ = value;
}
}

/// <summary>Field number for the "height_scale" field.</summary>
public const int HeightScaleFieldNumber = 4;
private float heightScale_;
/// <summary>
/// Scale factor for anchor encoded box height.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float HeightScale {
get { return heightScale_; }
set {
heightScale_ = value;
}
}

/// <summary>Field number for the "width_scale" field.</summary>
public const int WidthScaleFieldNumber = 5;
private float widthScale_;
/// <summary>
/// Scale factor for anchor encoded box width.
/// </summary>
[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

+ 0
- 3009
src/TensorFlowNET.Models/ObjectDetection/Protos/Losses.cs
File diff suppressed because it is too large
View File


+ 0
- 257
src/TensorFlowNET.Models/ObjectDetection/Protos/Matcher.cs View File

@@ -1,257 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/matcher.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/matcher.proto</summary>
public static partial class MatcherReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/matcher.proto</summary>
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
/// <summary>
/// Configuration proto for the matcher to be used in the object detection
/// pipeline. See core/matcher.py for details.
/// </summary>
public sealed partial class Matcher : pb::IMessage<Matcher> {
private static readonly pb::MessageParser<Matcher> _parser = new pb::MessageParser<Matcher>(() => new Matcher());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Matcher> 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);
}

/// <summary>Field number for the "argmax_matcher" field.</summary>
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;
}
}

/// <summary>Field number for the "bipartite_matcher" field.</summary>
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_;
/// <summary>Enum of possible cases for the "matcher_oneof" oneof.</summary>
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

+ 0
- 180
src/TensorFlowNET.Models/ObjectDetection/Protos/MeanStddevBoxCoder.cs View File

@@ -1,180 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/mean_stddev_box_coder.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/mean_stddev_box_coder.proto</summary>
public static partial class MeanStddevBoxCoderReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/mean_stddev_box_coder.proto</summary>
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
/// <summary>
/// Configuration proto for MeanStddevBoxCoder. See
/// box_coders/mean_stddev_box_coder.py for details.
/// </summary>
public sealed partial class MeanStddevBoxCoder : pb::IMessage<MeanStddevBoxCoder> {
private static readonly pb::MessageParser<MeanStddevBoxCoder> _parser = new pb::MessageParser<MeanStddevBoxCoder>(() => new MeanStddevBoxCoder());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MeanStddevBoxCoder> 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);
}

/// <summary>Field number for the "stddev" field.</summary>
public const int StddevFieldNumber = 1;
private float stddev_;
/// <summary>
/// The standard deviation used to encode and decode boxes.
/// </summary>
[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

+ 0
- 255
src/TensorFlowNET.Models/ObjectDetection/Protos/Model.cs View File

@@ -1,255 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/model.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/model.proto</summary>
public static partial class ModelReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/model.proto</summary>
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
/// <summary>
/// Top level configuration for DetectionModels.
/// </summary>
public sealed partial class DetectionModel : pb::IMessage<DetectionModel> {
private static readonly pb::MessageParser<DetectionModel> _parser = new pb::MessageParser<DetectionModel>(() => new DetectionModel());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DetectionModel> 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);
}

/// <summary>Field number for the "faster_rcnn" field.</summary>
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;
}
}

/// <summary>Field number for the "ssd" field.</summary>
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_;
/// <summary>Enum of possible cases for the "model" oneof.</summary>
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

+ 0
- 332
src/TensorFlowNET.Models/ObjectDetection/Protos/MultiscaleAnchorGenerator.cs View File

@@ -1,332 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/multiscale_anchor_generator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/multiscale_anchor_generator.proto</summary>
public static partial class MultiscaleAnchorGeneratorReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/multiscale_anchor_generator.proto</summary>
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
/// <summary>
/// Configuration proto for RetinaNet anchor generator described in
/// https://arxiv.org/abs/1708.02002. See
/// anchor_generators/multiscale_grid_anchor_generator.py for details.
/// </summary>
public sealed partial class MultiscaleAnchorGenerator : pb::IMessage<MultiscaleAnchorGenerator> {
private static readonly pb::MessageParser<MultiscaleAnchorGenerator> _parser = new pb::MessageParser<MultiscaleAnchorGenerator>(() => new MultiscaleAnchorGenerator());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<MultiscaleAnchorGenerator> 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);
}

/// <summary>Field number for the "min_level" field.</summary>
public const int MinLevelFieldNumber = 1;
private int minLevel_;
/// <summary>
/// minimum level in feature pyramid
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MinLevel {
get { return minLevel_; }
set {
minLevel_ = value;
}
}

/// <summary>Field number for the "max_level" field.</summary>
public const int MaxLevelFieldNumber = 2;
private int maxLevel_;
/// <summary>
/// maximum level in feature pyramid
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MaxLevel {
get { return maxLevel_; }
set {
maxLevel_ = value;
}
}

/// <summary>Field number for the "anchor_scale" field.</summary>
public const int AnchorScaleFieldNumber = 3;
private float anchorScale_;
/// <summary>
/// Scale of anchor to feature stride
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float AnchorScale {
get { return anchorScale_; }
set {
anchorScale_ = value;
}
}

/// <summary>Field number for the "aspect_ratios" field.</summary>
public const int AspectRatiosFieldNumber = 4;
private static readonly pb::FieldCodec<float> _repeated_aspectRatios_codec
= pb::FieldCodec.ForFloat(34);
private readonly pbc::RepeatedField<float> aspectRatios_ = new pbc::RepeatedField<float>();
/// <summary>
/// Aspect ratios for anchors at each grid point.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> AspectRatios {
get { return aspectRatios_; }
}

/// <summary>Field number for the "scales_per_octave" field.</summary>
public const int ScalesPerOctaveFieldNumber = 5;
private int scalesPerOctave_;
/// <summary>
/// Number of intermediate scale each scale octave
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int ScalesPerOctave {
get { return scalesPerOctave_; }
set {
scalesPerOctave_ = value;
}
}

/// <summary>Field number for the "normalize_coordinates" field.</summary>
public const int NormalizeCoordinatesFieldNumber = 6;
private bool normalizeCoordinates_;
/// <summary>
/// Whether to produce anchors in normalized coordinates.
/// </summary>
[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

+ 0
- 2231
src/TensorFlowNET.Models/ObjectDetection/Protos/Optimizer.cs
File diff suppressed because it is too large
View File


+ 0
- 352
src/TensorFlowNET.Models/ObjectDetection/Protos/Pipeline.cs View File

@@ -1,352 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/pipeline.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/pipeline.proto</summary>
public static partial class PipelineReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/pipeline.proto</summary>
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
/// <summary>
/// Convenience message for configuring a training and eval pipeline. Allows all
/// of the pipeline parameters to be configured from one file.
/// Next id: 7
/// </summary>
public sealed partial class TrainEvalPipelineConfig : pb::IMessage<TrainEvalPipelineConfig> {
private static readonly pb::MessageParser<TrainEvalPipelineConfig> _parser = new pb::MessageParser<TrainEvalPipelineConfig>(() => new TrainEvalPipelineConfig());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<TrainEvalPipelineConfig> 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);
}

/// <summary>Field number for the "model" field.</summary>
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;
}
}

/// <summary>Field number for the "train_config" field.</summary>
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;
}
}

/// <summary>Field number for the "train_input_reader" field.</summary>
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;
}
}

/// <summary>Field number for the "eval_config" field.</summary>
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;
}
}

/// <summary>Field number for the "eval_input_reader" field.</summary>
public const int EvalInputReaderFieldNumber = 5;
private static readonly pb::FieldCodec<global::Tensorflow.Models.ObjectDetection.Protos.InputReader> _repeated_evalInputReader_codec
= pb::FieldCodec.ForMessage(42, global::Tensorflow.Models.ObjectDetection.Protos.InputReader.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.InputReader> evalInputReader_ = new pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.InputReader>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.InputReader> EvalInputReader {
get { return evalInputReader_; }
}

/// <summary>Field number for the "graph_rewriter" field.</summary>
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

+ 0
- 685
src/TensorFlowNET.Models/ObjectDetection/Protos/PostProcessing.cs View File

@@ -1,685 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/post_processing.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/post_processing.proto</summary>
public static partial class PostProcessingReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/post_processing.proto</summary>
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
/// <summary>
/// Configuration proto for non-max-suppression operation on a batch of
/// detections.
/// </summary>
public sealed partial class BatchNonMaxSuppression : pb::IMessage<BatchNonMaxSuppression> {
private static readonly pb::MessageParser<BatchNonMaxSuppression> _parser = new pb::MessageParser<BatchNonMaxSuppression>(() => new BatchNonMaxSuppression());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<BatchNonMaxSuppression> 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);
}

/// <summary>Field number for the "score_threshold" field.</summary>
public const int ScoreThresholdFieldNumber = 1;
private float scoreThreshold_;
/// <summary>
/// Scalar threshold for score (low scoring boxes are removed).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ScoreThreshold {
get { return scoreThreshold_; }
set {
scoreThreshold_ = value;
}
}

/// <summary>Field number for the "iou_threshold" field.</summary>
public const int IouThresholdFieldNumber = 2;
private float iouThreshold_;
/// <summary>
/// Scalar threshold for IOU (boxes that have high IOU overlap
/// with previously selected boxes are removed).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float IouThreshold {
get { return iouThreshold_; }
set {
iouThreshold_ = value;
}
}

/// <summary>Field number for the "max_detections_per_class" field.</summary>
public const int MaxDetectionsPerClassFieldNumber = 3;
private int maxDetectionsPerClass_;
/// <summary>
/// Maximum number of detections to retain per class.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MaxDetectionsPerClass {
get { return maxDetectionsPerClass_; }
set {
maxDetectionsPerClass_ = value;
}
}

/// <summary>Field number for the "max_total_detections" field.</summary>
public const int MaxTotalDetectionsFieldNumber = 5;
private int maxTotalDetections_;
/// <summary>
/// Maximum number of detections to retain across all classes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MaxTotalDetections {
get { return maxTotalDetections_; }
set {
maxTotalDetections_ = value;
}
}

/// <summary>Field number for the "use_static_shapes" field.</summary>
public const int UseStaticShapesFieldNumber = 6;
private bool useStaticShapes_;
/// <summary>
/// Whether to use the implementation of NMS that guarantees static shapes.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool UseStaticShapes {
get { return useStaticShapes_; }
set {
useStaticShapes_ = value;
}
}

/// <summary>Field number for the "use_class_agnostic_nms" field.</summary>
public const int UseClassAgnosticNmsFieldNumber = 7;
private bool useClassAgnosticNms_;
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool UseClassAgnosticNms {
get { return useClassAgnosticNms_; }
set {
useClassAgnosticNms_ = value;
}
}

/// <summary>Field number for the "max_classes_per_detection" field.</summary>
public const int MaxClassesPerDetectionFieldNumber = 8;
private int maxClassesPerDetection_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int MaxClassesPerDetection {
get { return maxClassesPerDetection_; }
set {
maxClassesPerDetection_ = value;
}
}

/// <summary>Field number for the "soft_nms_sigma" field.</summary>
public const int SoftNmsSigmaFieldNumber = 9;
private float softNmsSigma_;
/// <summary>
/// Soft NMS sigma parameter; Bodla et al, https://arxiv.org/abs/1704.04503)
/// </summary>
[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;
}
}
}
}

}

/// <summary>
/// Configuration proto for post-processing predicted boxes and
/// scores.
/// </summary>
public sealed partial class PostProcessing : pb::IMessage<PostProcessing> {
private static readonly pb::MessageParser<PostProcessing> _parser = new pb::MessageParser<PostProcessing>(() => new PostProcessing());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PostProcessing> 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);
}

/// <summary>Field number for the "batch_non_max_suppression" field.</summary>
public const int BatchNonMaxSuppressionFieldNumber = 1;
private global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression batchNonMaxSuppression_;
/// <summary>
/// Non max suppression parameters.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Models.ObjectDetection.Protos.BatchNonMaxSuppression BatchNonMaxSuppression {
get { return batchNonMaxSuppression_; }
set {
batchNonMaxSuppression_ = value;
}
}

/// <summary>Field number for the "score_converter" field.</summary>
public const int ScoreConverterFieldNumber = 2;
private global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter scoreConverter_ = 0;
/// <summary>
/// Score converter to use.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Tensorflow.Models.ObjectDetection.Protos.PostProcessing.Types.ScoreConverter ScoreConverter {
get { return scoreConverter_; }
set {
scoreConverter_ = value;
}
}

/// <summary>Field number for the "logit_scale" field.</summary>
public const int LogitScaleFieldNumber = 3;
private float logitScale_;
/// <summary>
/// Scale logit (input) value before conversion in post-processing step.
/// Typically used for softmax distillation, though can be used to scale for
/// other reasons.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float LogitScale {
get { return logitScale_; }
set {
logitScale_ = value;
}
}

/// <summary>Field number for the "calibration_config" field.</summary>
public const int CalibrationConfigFieldNumber = 4;
private global::Tensorflow.Models.ObjectDetection.Protos.CalibrationConfig calibrationConfig_;
/// <summary>
/// Calibrate score outputs. Calibration is applied after score converter
/// and before non max suppression.
/// </summary>
[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
/// <summary>Container for nested types declared in the PostProcessing message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// Enum to specify how to convert the detection scores.
/// </summary>
public enum ScoreConverter {
/// <summary>
/// Input scores equals output scores.
/// </summary>
[pbr::OriginalName("IDENTITY")] Identity = 0,
/// <summary>
/// Applies a sigmoid on input scores.
/// </summary>
[pbr::OriginalName("SIGMOID")] Sigmoid = 1,
/// <summary>
/// Applies a softmax on input scores
/// </summary>
[pbr::OriginalName("SOFTMAX")] Softmax = 2,
}

}
#endregion

}

#endregion

}

#endregion Designer generated code

+ 0
- 8697
src/TensorFlowNET.Models/ObjectDetection/Protos/Preprocessor.cs
File diff suppressed because it is too large
View File


+ 0
- 791
src/TensorFlowNET.Models/ObjectDetection/Protos/RegionSimilarityCalculator.cs View File

@@ -1,791 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/region_similarity_calculator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/region_similarity_calculator.proto</summary>
public static partial class RegionSimilarityCalculatorReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/region_similarity_calculator.proto</summary>
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
/// <summary>
/// Configuration proto for region similarity calculators. See
/// core/region_similarity_calculator.py for details.
/// </summary>
public sealed partial class RegionSimilarityCalculator : pb::IMessage<RegionSimilarityCalculator> {
private static readonly pb::MessageParser<RegionSimilarityCalculator> _parser = new pb::MessageParser<RegionSimilarityCalculator>(() => new RegionSimilarityCalculator());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegionSimilarityCalculator> 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);
}

/// <summary>Field number for the "neg_sq_dist_similarity" field.</summary>
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;
}
}

/// <summary>Field number for the "iou_similarity" field.</summary>
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;
}
}

/// <summary>Field number for the "ioa_similarity" field.</summary>
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;
}
}

/// <summary>Field number for the "thresholded_iou_similarity" field.</summary>
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_;
/// <summary>Enum of possible cases for the "region_similarity" oneof.</summary>
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;
}
}
}
}

}

/// <summary>
/// Configuration for negative squared distance similarity calculator.
/// </summary>
public sealed partial class NegSqDistSimilarity : pb::IMessage<NegSqDistSimilarity> {
private static readonly pb::MessageParser<NegSqDistSimilarity> _parser = new pb::MessageParser<NegSqDistSimilarity>(() => new NegSqDistSimilarity());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<NegSqDistSimilarity> 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;
}
}
}

}

/// <summary>
/// Configuration for intersection-over-union (IOU) similarity calculator.
/// </summary>
public sealed partial class IouSimilarity : pb::IMessage<IouSimilarity> {
private static readonly pb::MessageParser<IouSimilarity> _parser = new pb::MessageParser<IouSimilarity>(() => new IouSimilarity());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<IouSimilarity> 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;
}
}
}

}

/// <summary>
/// Configuration for intersection-over-area (IOA) similarity calculator.
/// </summary>
public sealed partial class IoaSimilarity : pb::IMessage<IoaSimilarity> {
private static readonly pb::MessageParser<IoaSimilarity> _parser = new pb::MessageParser<IoaSimilarity>(() => new IoaSimilarity());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<IoaSimilarity> 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;
}
}
}

}

/// <summary>
/// Configuration for thresholded-intersection-over-union similarity calculator.
/// </summary>
public sealed partial class ThresholdedIouSimilarity : pb::IMessage<ThresholdedIouSimilarity> {
private static readonly pb::MessageParser<ThresholdedIouSimilarity> _parser = new pb::MessageParser<ThresholdedIouSimilarity>(() => new ThresholdedIouSimilarity());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<ThresholdedIouSimilarity> 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);
}

/// <summary>Field number for the "iou_threshold" field.</summary>
public const int IouThresholdFieldNumber = 1;
private float iouThreshold_;
/// <summary>
/// IOU threshold used for filtering scores.
/// </summary>
[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

+ 0
- 240
src/TensorFlowNET.Models/ObjectDetection/Protos/SquareBoxCoder.cs View File

@@ -1,240 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/square_box_coder.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/square_box_coder.proto</summary>
public static partial class SquareBoxCoderReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/square_box_coder.proto</summary>
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
/// <summary>
/// Configuration proto for SquareBoxCoder. See
/// box_coders/square_box_coder.py for details.
/// </summary>
public sealed partial class SquareBoxCoder : pb::IMessage<SquareBoxCoder> {
private static readonly pb::MessageParser<SquareBoxCoder> _parser = new pb::MessageParser<SquareBoxCoder>(() => new SquareBoxCoder());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SquareBoxCoder> 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);
}

/// <summary>Field number for the "y_scale" field.</summary>
public const int YScaleFieldNumber = 1;
private float yScale_;
/// <summary>
/// Scale factor for anchor encoded box center.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float YScale {
get { return yScale_; }
set {
yScale_ = value;
}
}

/// <summary>Field number for the "x_scale" field.</summary>
public const int XScaleFieldNumber = 2;
private float xScale_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float XScale {
get { return xScale_; }
set {
xScale_ = value;
}
}

/// <summary>Field number for the "length_scale" field.</summary>
public const int LengthScaleFieldNumber = 3;
private float lengthScale_;
/// <summary>
/// Scale factor for anchor encoded box length.
/// </summary>
[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

+ 0
- 2028
src/TensorFlowNET.Models/ObjectDetection/Protos/Ssd.cs
File diff suppressed because it is too large
View File


+ 0
- 526
src/TensorFlowNET.Models/ObjectDetection/Protos/SsdAnchorGenerator.cs View File

@@ -1,526 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/ssd_anchor_generator.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/ssd_anchor_generator.proto</summary>
public static partial class SsdAnchorGeneratorReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/ssd_anchor_generator.proto</summary>
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
/// <summary>
/// Configuration proto for SSD anchor generator described in
/// https://arxiv.org/abs/1512.02325. See
/// anchor_generators/multiple_grid_anchor_generator.py for details.
/// </summary>
public sealed partial class SsdAnchorGenerator : pb::IMessage<SsdAnchorGenerator> {
private static readonly pb::MessageParser<SsdAnchorGenerator> _parser = new pb::MessageParser<SsdAnchorGenerator>(() => new SsdAnchorGenerator());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<SsdAnchorGenerator> 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);
}

/// <summary>Field number for the "num_layers" field.</summary>
public const int NumLayersFieldNumber = 1;
private int numLayers_;
/// <summary>
/// Number of grid layers to create anchors for.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int NumLayers {
get { return numLayers_; }
set {
numLayers_ = value;
}
}

/// <summary>Field number for the "min_scale" field.</summary>
public const int MinScaleFieldNumber = 2;
private float minScale_;
/// <summary>
/// Scale of anchors corresponding to finest resolution.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float MinScale {
get { return minScale_; }
set {
minScale_ = value;
}
}

/// <summary>Field number for the "max_scale" field.</summary>
public const int MaxScaleFieldNumber = 3;
private float maxScale_;
/// <summary>
/// Scale of anchors corresponding to coarsest resolution
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float MaxScale {
get { return maxScale_; }
set {
maxScale_ = value;
}
}

/// <summary>Field number for the "scales" field.</summary>
public const int ScalesFieldNumber = 12;
private static readonly pb::FieldCodec<float> _repeated_scales_codec
= pb::FieldCodec.ForFloat(98);
private readonly pbc::RepeatedField<float> scales_ = new pbc::RepeatedField<float>();
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> Scales {
get { return scales_; }
}

/// <summary>Field number for the "aspect_ratios" field.</summary>
public const int AspectRatiosFieldNumber = 4;
private static readonly pb::FieldCodec<float> _repeated_aspectRatios_codec
= pb::FieldCodec.ForFloat(34);
private readonly pbc::RepeatedField<float> aspectRatios_ = new pbc::RepeatedField<float>();
/// <summary>
/// Aspect ratios for anchors at each grid point.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<float> AspectRatios {
get { return aspectRatios_; }
}

/// <summary>Field number for the "interpolated_scale_aspect_ratio" field.</summary>
public const int InterpolatedScaleAspectRatioFieldNumber = 13;
private float interpolatedScaleAspectRatio_;
/// <summary>
/// When this aspect ratio is greater than 0, then an additional
/// anchor, with an interpolated scale is added with this aspect ratio.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float InterpolatedScaleAspectRatio {
get { return interpolatedScaleAspectRatio_; }
set {
interpolatedScaleAspectRatio_ = value;
}
}

/// <summary>Field number for the "reduce_boxes_in_lowest_layer" field.</summary>
public const int ReduceBoxesInLowestLayerFieldNumber = 5;
private bool reduceBoxesInLowestLayer_;
/// <summary>
/// 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).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool ReduceBoxesInLowestLayer {
get { return reduceBoxesInLowestLayer_; }
set {
reduceBoxesInLowestLayer_ = value;
}
}

/// <summary>Field number for the "base_anchor_height" field.</summary>
public const int BaseAnchorHeightFieldNumber = 6;
private float baseAnchorHeight_;
/// <summary>
/// The base anchor size in height dimension.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float BaseAnchorHeight {
get { return baseAnchorHeight_; }
set {
baseAnchorHeight_ = value;
}
}

/// <summary>Field number for the "base_anchor_width" field.</summary>
public const int BaseAnchorWidthFieldNumber = 7;
private float baseAnchorWidth_;
/// <summary>
/// The base anchor size in width dimension.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float BaseAnchorWidth {
get { return baseAnchorWidth_; }
set {
baseAnchorWidth_ = value;
}
}

/// <summary>Field number for the "height_stride" field.</summary>
public const int HeightStrideFieldNumber = 8;
private static readonly pb::FieldCodec<int> _repeated_heightStride_codec
= pb::FieldCodec.ForInt32(66);
private readonly pbc::RepeatedField<int> heightStride_ = new pbc::RepeatedField<int>();
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> HeightStride {
get { return heightStride_; }
}

/// <summary>Field number for the "width_stride" field.</summary>
public const int WidthStrideFieldNumber = 9;
private static readonly pb::FieldCodec<int> _repeated_widthStride_codec
= pb::FieldCodec.ForInt32(74);
private readonly pbc::RepeatedField<int> widthStride_ = new pbc::RepeatedField<int>();
/// <summary>
/// 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.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> WidthStride {
get { return widthStride_; }
}

/// <summary>Field number for the "height_offset" field.</summary>
public const int HeightOffsetFieldNumber = 10;
private static readonly pb::FieldCodec<int> _repeated_heightOffset_codec
= pb::FieldCodec.ForInt32(82);
private readonly pbc::RepeatedField<int> heightOffset_ = new pbc::RepeatedField<int>();
/// <summary>
/// Anchor height offset in pixels for each layer. The length of this field is
/// expected to be equal to the value of num_layers.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> HeightOffset {
get { return heightOffset_; }
}

/// <summary>Field number for the "width_offset" field.</summary>
public const int WidthOffsetFieldNumber = 11;
private static readonly pb::FieldCodec<int> _repeated_widthOffset_codec
= pb::FieldCodec.ForInt32(90);
private readonly pbc::RepeatedField<int> widthOffset_ = new pbc::RepeatedField<int>();
/// <summary>
/// Anchor width offset in pixels for each layer. The length of this field is
/// expected to be equal to the value of num_layers.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> 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

+ 0
- 365
src/TensorFlowNET.Models/ObjectDetection/Protos/StringIntLabelMap.cs View File

@@ -1,365 +0,0 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: object_detection/protos/string_int_label_map.proto
// </auto-generated>
#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 {

/// <summary>Holder for reflection information generated from object_detection/protos/string_int_label_map.proto</summary>
public static partial class StringIntLabelMapReflection {

#region Descriptor
/// <summary>File descriptor for object_detection/protos/string_int_label_map.proto</summary>
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<StringIntLabelMapItem> {
private static readonly pb::MessageParser<StringIntLabelMapItem> _parser = new pb::MessageParser<StringIntLabelMapItem>(() => new StringIntLabelMapItem());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<StringIntLabelMapItem> 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);
}

/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// String name. The most common practice is to set this to a MID or synsets
/// id.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}

/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 2;
private int id_;
/// <summary>
/// Integer id that maps to the string name above. Label ids should start from
/// 1.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Id {
get { return id_; }
set {
id_ = value;
}
}

/// <summary>Field number for the "display_name" field.</summary>
public const int DisplayNameFieldNumber = 3;
private string displayName_ = "";
/// <summary>
/// Human readable string label.
/// </summary>
[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<StringIntLabelMap> {
private static readonly pb::MessageParser<StringIntLabelMap> _parser = new pb::MessageParser<StringIntLabelMap>(() => new StringIntLabelMap());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<StringIntLabelMap> 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);
}

/// <summary>Field number for the "item" field.</summary>
public const int ItemFieldNumber = 1;
private static readonly pb::FieldCodec<global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem> _repeated_item_codec
= pb::FieldCodec.ForMessage(10, global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem.Parser);
private readonly pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem> item_ = new pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Tensorflow.Models.ObjectDetection.Protos.StringIntLabelMapItem> 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

+ 0
- 1020
src/TensorFlowNET.Models/ObjectDetection/Protos/Train.cs
File diff suppressed because it is too large
View File


+ 0
- 101
src/TensorFlowNET.Models/ObjectDetection/Utils/ConfigUtil.cs View File

@@ -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<string, object> create_configs_from_pipeline_proto(TrainEvalPipelineConfig pipeline_config)
{
var configs = new Dictionary<string, object>(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();
}
}
}

+ 0
- 14
src/TensorFlowNET.Models/Slim/Nets/ResNetV1.cs View File

@@ -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("");
}
}
}

+ 0
- 37
src/TensorFlowNET.Models/TensorFlowNET.Models.csproj View File

@@ -1,37 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AssemblyName>TensorFlow.Models</AssemblyName>
<RootNamespace>Tensorflow.Models</RootNamespace>
<Version>0.0.1</Version>
<Authors>Haiping Chen</Authors>
<Company>SciSharp STACK</Company>
<PackageProjectUrl>https://github.com/SciSharp/TensorFlow.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>TensorFlow</PackageTags>
<Description>Models and examples built with TensorFlow.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Apache2</Copyright>
</PropertyGroup>

<ItemGroup>
<None Remove="ObjectDetection\Models\faster_rcnn_resnet101_voc07.config" />
</ItemGroup>

<ItemGroup>
<Content Include="ObjectDetection\Models\faster_rcnn_resnet101_voc07.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Protobuf.Text" Version="0.3.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\TensorFlowNET.Core\TensorFlowNET.Core.csproj" />
</ItemGroup>

</Project>

+ 0
- 9
src/TensorFlowNET.Text/README.md View File

@@ -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

+ 0
- 22
src/TensorFlowNET.Text/TensorFlowNET.Text.csproj View File

@@ -1,22 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>SciSharp.TensorFlowText</PackageId>
<Version>0.0.1</Version>
<Authors>Haiping Chen</Authors>
<Company>SciSharp STACK</Company>
<Product>TensorFlowText</Product>
<Description>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.</Description>
<Copyright>Apache 2.0</Copyright>
<PackageProjectUrl>http://scisharpstack.org</PackageProjectUrl>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<PackageTags>TensorFlow, SciSharp</PackageTags>
<RepositoryType>git</RepositoryType>
<PackageIconUrl>https://avatars3.githubusercontent.com/u/44989469?s=200&amp;v=4</PackageIconUrl>
<AssemblyName>TensorFlow.Text</AssemblyName>
<RootNamespace>TensorFlow.Text</RootNamespace>
</PropertyGroup>

</Project>

+ 0
- 8
src/TensorFlowNET.Text/Tokenizer.cs View File

@@ -1,8 +0,0 @@
using System;

namespace TensorFlowText
{
public class Tokenizer
{
}
}

+ 21
- 0
src/TensorFlowNet.Benchmarks/Benchmark.csproj View File

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<None Remove="tensorflow.dll" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
<PackageReference Include="TensorFlow.NET" Version="0.12.0" />
</ItemGroup>

</Project>

+ 29
- 0
src/TensorFlowNet.Benchmarks/Program.cs View File

@@ -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();
}
}
}

+ 88
- 0
src/TensorFlowNet.Benchmarks/TensorBenchmark.cs View File

@@ -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);
// }
//}

}
}


+ 76
- 0
src/TensorFlowNet.Benchmarks/Unmanaged/StructCastBenchmark.cs View File

@@ -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>(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<UnmanagedStruct>());
dataptr = data.ToPointer();
}

[Benchmark, MethodImpl(MethodImplOptions.NoOptimization)]
public void Marshal_PtrToStructure()
{
UnmanagedStruct _;
for (int i = 0; i < 10000; i++)
{
_ = Marshal.PtrToStructure<UnmanagedStruct>(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<UnmanagedStruct>(dptr);
}
}

}
}

+ 0
- 24
test/TensorFlowNET.UnitTest/Hub/MnistModelLoaderTest.cs View File

@@ -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);
}
}
}

test/TensorFlowNET.UnitTest/TensorFlowNET.UnitTest.csproj → test/TensorFlowNET.UnitTest/UnitTest.csproj View File

@@ -36,11 +36,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\TensorFlowNET.Core\TensorFlowNET.Core.csproj" />
<ProjectReference Include="..\..\src\TensorFlowNET.Datasets\TensorFlowNET.Datasets.csproj" />
<ProjectReference Include="..\..\src\TensorFlowNET.Hub\TensorFlowNET.Hub.csproj" />
<ProjectReference Include="..\..\src\TensorFlowNET.Models\TensorFlowNET.Models.csproj" />
<ProjectReference Include="..\..\src\TensorFlowNET.Text\TensorFlowNET.Text.csproj" />
<ProjectReference Include="..\..\src\TensorFlowNET.Core\TensorFlow.Binding.csproj" />
</ItemGroup>

<ItemGroup>

Loading…
Cancel
Save