Skip to content

Commit

Permalink
add normalization to the model
Browse files Browse the repository at this point in the history
  • Loading branch information
asiryan committed Jul 1, 2024
1 parent 6d8ffa7 commit 874233c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion netstandard/DepthONNX/DepthEstimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion netstandard/Examples/DepthEstimation/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 874233c

Please sign in to comment.