Skip to content

Commit

Permalink
Simplify the code, remove OpenCvSharp dependencies from the code, and…
Browse files Browse the repository at this point in the history
… handle common models.
  • Loading branch information
guojin-yan committed Oct 19, 2023
1 parent cabc899 commit 732887c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 16 deletions.
3 changes: 1 addition & 2 deletions modules/csharp_api/csharp/core/compiled_model.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using OpenCvSharp;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
Expand Down
3 changes: 1 addition & 2 deletions modules/csharp_api/csharp/core/infer_request.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using OpenCvSharp;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
Expand Down
1 change: 0 additions & 1 deletion modules/csharp_api/csharp/core/model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using static OpenCvSharp.FileStorage;

namespace OpenVinoSharp
{
Expand Down
3 changes: 1 addition & 2 deletions modules/csharp_api/csharp/core/partial_shape.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using OpenCvSharp;
using System;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
Expand Down
6 changes: 3 additions & 3 deletions modules/csharp_api/csharp/core/tensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ public Tensor(IntPtr ptr)
/// <param name="type">Tensor element type</param>
/// <param name="shape">Tensor shape</param>
/// <param name="mat">Image data</param>
public Tensor(element.Type type, Shape shape, OvMat mat)
public Tensor(element.Type type, Shape shape, byte[] mat)
{
int l =mat.mat_data.Length;
int l =mat.Length;
IntPtr data = Marshal.AllocHGlobal(l);
Marshal.Copy(mat.mat_data, 0, data, (int)mat.mat_data_size);
Marshal.Copy(mat, 0, data, (int)mat.Length);
HandleException.handler(
NativeMethods.ov_tensor_create_from_host_ptr
((uint)type.get_type(), shape.shape, data, ref m_ptr));
Expand Down
3 changes: 1 addition & 2 deletions modules/csharp_api/csharp/exception/exception.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using OpenCvSharp;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
Expand Down
2 changes: 1 addition & 1 deletion modules/csharp_api/csharp/native_methods/ov_base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ namespace OpenVinoSharp
/// </summary>
public partial class NativeMethods
{
private const string dll_extern = "./openvino2023.1/openvino_c.dll";
private const string dll_extern = "openvino_c";
}
}
4 changes: 1 addition & 3 deletions modules/csharp_api/csharp/native_methods/ov_infer_request.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using OpenCvSharp;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Threading.Tasks;
using static OpenCvSharp.Stitcher;

namespace OpenVinoSharp
{
Expand Down

0 comments on commit 732887c

Please sign in to comment.