From 874233c9d486d23ed973284ce33cc46ca7ccd2c6 Mon Sep 17 00:00:00 2001 From: asiryan Date: Tue, 2 Jul 2024 01:17:12 +0300 Subject: [PATCH] add normalization to the model --- netstandard/DepthONNX/DepthEstimator.cs | 3 ++- netstandard/Examples/DepthEstimation/Form1.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/netstandard/DepthONNX/DepthEstimator.cs b/netstandard/DepthONNX/DepthEstimator.cs index 4c7e0a4..fa385e3 100644 --- a/netstandard/DepthONNX/DepthEstimator.cs +++ b/netstandard/DepthONNX/DepthEstimator.cs @@ -125,7 +125,8 @@ public DepthEstimator(SessionOptions options, DepthEstimatorQuality depthSegment } } - return mask.ResizePreserved(height, width, interpolationMode); + // normalize and resize + return mask.Normalized().ResizePreserved(height, width, interpolationMode); } #endregion diff --git a/netstandard/Examples/DepthEstimation/Form1.cs b/netstandard/Examples/DepthEstimation/Form1.cs index 60d09be..683e991 100644 --- a/netstandard/Examples/DepthEstimation/Form1.cs +++ b/netstandard/Examples/DepthEstimation/Form1.cs @@ -43,7 +43,7 @@ private void Process(Bitmap image) image: image, interpolationMode: InterpolationMode.Bicubic); - var mask = results.Normalized().FromGrayscale(); + var mask = results.FromGrayscale(); image?.Dispose(); //mask.Save("output.png", System.Drawing.Imaging.ImageFormat.Png);