Skip to content

Commit

Permalink
Fixtures and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
asiryan committed Jul 1, 2024
1 parent 874233c commit 7979ccb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 FaceONNX
Copyright (c) 2024 Valery Asiryan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 9 additions & 9 deletions netstandard/DepthONNX/DepthEstimator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ public class DepthEstimator

/// <summary>
/// Initializes depth estimator.
/// <param name="depthSegmentatorQuality">Depth estimator quality</param>
/// <param name="depthEstimatorQuality">Depth estimator quality</param>
/// </summary>
public DepthEstimator(DepthEstimatorQuality depthSegmentatorQuality = DepthEstimatorQuality.Medium)
public DepthEstimator(DepthEstimatorQuality depthEstimatorQuality = DepthEstimatorQuality.Medium)
{
DepthSegmentatorQuality = depthSegmentatorQuality;
DepthEstimatorQuality = depthEstimatorQuality;
_session = new InferenceSession(Properties.Resources.depth_anything_v2_vits);
}

/// <summary>
/// Initializes depth estimator.
/// </summary>
/// <param name="depthSegmentatorQuality">Depth estimator quality</param>
/// <param name="depthEstimatorQuality">Depth estimator quality</param>
/// <param name="options">Session options</param>
public DepthEstimator(SessionOptions options, DepthEstimatorQuality depthSegmentatorQuality = DepthEstimatorQuality.Medium)
public DepthEstimator(SessionOptions options, DepthEstimatorQuality depthEstimatorQuality = DepthEstimatorQuality.Medium)
{
DepthSegmentatorQuality = depthSegmentatorQuality;
DepthEstimatorQuality = depthEstimatorQuality;
_session = new InferenceSession(Properties.Resources.depth_anything_v2_vits, options);
}

Expand All @@ -51,9 +51,9 @@ public DepthEstimator(SessionOptions options, DepthEstimatorQuality depthSegment
#region Properties

/// <summary>
/// Gets or sets depth segmentator quality.
/// Gets or sets depth estimator quality.
/// </summary>
public DepthEstimatorQuality DepthSegmentatorQuality { get; set; }
public DepthEstimatorQuality DepthEstimatorQuality { get; set; }

#endregion

Expand All @@ -74,7 +74,7 @@ public DepthEstimator(SessionOptions options, DepthEstimatorQuality depthSegment

var width = image[0].GetLength(1);
var height = image[0].GetLength(0);
var length = (int)DepthSegmentatorQuality;
var length = (int)DepthEstimatorQuality;
var size = new Size(length, length);

var resized = new float[3][,];
Expand Down
6 changes: 3 additions & 3 deletions netstandard/DepthONNX/DepthONNX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>DepthONNX</AssemblyName>
<LangVersion>8.0</LangVersion>
<Version>1.0.0.1</Version>
<FileVersion>1.0.0.1</FileVersion>
<Version>1.0.1.1</Version>
<FileVersion>1.0.1.1</FileVersion>
<Authors>Valery Asiryan</Authors>
<Company>Valery Asiryan</Company>
<Description>Monocular depth estimation library based on deep neural networks and ONNX runtime.</Description>
<Copyright>Valery Asiryan, © 2024</Copyright>
<RepositoryType>Open-source</RepositoryType>
<PackageId>DepthONNX</PackageId>
<Product>DepthONNX</Product>
<AssemblyVersion>1.0.0.1</AssemblyVersion>
<AssemblyVersion>1.0.1.1</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageTags>monocular depth estimation onnx neural-networks</PackageTags>
<RepositoryUrl>https://github.com/FaceONNX/DepthONNX</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion netstandard/Examples/DepthEstimation/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions netstandard/Examples/DepthEstimation/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using UMapx.Core;
using UMapx.Imaging;

namespace DepthSegmentation
namespace DepthEstimation
{
public partial class Form1 : Form
{
private readonly DepthEstimator _depthSegmentator;
private readonly DepthEstimator _depthEstimator;

public Form1()
{
Expand All @@ -18,7 +18,7 @@ public Form1()
AllowDrop = true;
Text = "DepthONNX: Depth estimation";

_depthSegmentator = new DepthEstimator(DepthEstimatorQuality.High);
_depthEstimator = new DepthEstimator(DepthEstimatorQuality.High);
var image = new Bitmap("example.png");
Process(image);
}
Expand All @@ -39,7 +39,7 @@ private void Form1_DragDrop(object sender, DragEventArgs e)

private void Process(Bitmap image)
{
var results = _depthSegmentator.Forward(
var results = _depthEstimator.Forward(
image: image,
interpolationMode: InterpolationMode.Bicubic);

Expand Down
2 changes: 0 additions & 2 deletions netstandard/Examples/DepthEstimation/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using DepthSegmentation;

namespace DepthEstimation
{
internal static class Program
Expand Down
2 changes: 1 addition & 1 deletion netstandard/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023-2024 Valery Asiryan
Copyright (c) 2024 Valery Asiryan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 7979ccb

Please sign in to comment.