📄 Awesome OCR multiple programing languages toolkits based on ONNX Runtime, OpenVINO, MNN, PaddlePaddle, TensorRT and PyTorch.
升级.net C#版代码,支持模型v3,onnxruntime 1.12.1
benjaminwanbc3f43a21979
diff --git a/dotnet/README.md b/dotnet/README.mdindex 82c26ee..ae2bc33 100755--- a/dotnet/README.md+++ b/dotnet/README.md@@ -1,5 +1,5 @@-# .Net版BaiPiaoOcr范例+# .Net版RapidOcr范例#### 介绍本目录存放.Net相关demo项目-* BaiPiaoOcrOnnxCs项目是Windows平台C# WinForm范例,采用onnxruntime为推理框架+* RapidOcrOnnxCs项目是Windows平台C# WinForm范例,采用onnxruntime为推理框架diff --git a/dotnet/BaiPiaoOcrOnnxCs/.gitignore b/dotnet/RapidOcrOnnxCs/.gitignoresimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/.gitignorerename to dotnet/RapidOcrOnnxCs/.gitignorediff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/AngleNet.cs b/dotnet/RapidOcrOnnxCs/OcrLib/AngleNet.cssimilarity index 99%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/AngleNet.csrename to dotnet/RapidOcrOnnxCs/OcrLib/AngleNet.csindex 1893351..cb5f4af 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/AngleNet.cs+++ b/dotnet/RapidOcrOnnxCs/OcrLib/AngleNet.cs@@ -35,7 +35,7 @@ namespace OcrLiteLibop.GraphOptimizationLevel = GraphOptimizationLevel.ORT_ENABLE_EXTENDED;op.InterOpNumThreads = numThread;op.IntraOpNumThreads = numThread;- angleNet = new InferenceSession(path);+ angleNet = new InferenceSession(path, op);inputNames = angleNet.InputMetadata.Keys.ToList();}catch (Exception ex)diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/CrnnNet.cs b/dotnet/RapidOcrOnnxCs/OcrLib/CrnnNet.cssimilarity index 99%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/CrnnNet.csrename to dotnet/RapidOcrOnnxCs/OcrLib/CrnnNet.csindex 76c0ba4..43fbf06 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/CrnnNet.cs+++ b/dotnet/RapidOcrOnnxCs/OcrLib/CrnnNet.cs@@ -14,7 +14,7 @@ namespace OcrLiteLib{private readonly float[] MeanValues = { 127.5F, 127.5F, 127.5F };private readonly float[] NormValues = { 1.0F / 127.5F, 1.0F / 127.5F, 1.0F / 127.5F };- private const int crnnDstHeight = 32;+ private const int crnnDstHeight = 48;private const int crnnCols = 6625;private InferenceSession crnnNet;diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/DbNet.cs b/dotnet/RapidOcrOnnxCs/OcrLib/DbNet.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/DbNet.csrename to dotnet/RapidOcrOnnxCs/OcrLib/DbNet.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrLib.csproj b/dotnet/RapidOcrOnnxCs/OcrLib/OcrLib.csprojold mode 100755new mode 100644similarity index 83%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrLib.csprojrename to dotnet/RapidOcrOnnxCs/OcrLib/OcrLib.csprojindex 6922b26..400e2b1--- a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrLib.csproj+++ b/dotnet/RapidOcrOnnxCs/OcrLib/OcrLib.csproj@@ -1,6 +1,6 @@<?xml version="1.0" encoding="utf-8"?><Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">- <Import Project="..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.props" Condition="Exists('..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.props')" />+ <Import Project="..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.props" Condition="Exists('..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.props')" /><Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /><PropertyGroup><Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>@@ -34,6 +34,24 @@<ErrorReport>prompt</ErrorReport><WarningLevel>4</WarningLevel></PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">+ <DebugSymbols>true</DebugSymbols>+ <OutputPath>bin\x64\Debug\</OutputPath>+ <DefineConstants>DEBUG;TRACE</DefineConstants>+ <DebugType>full</DebugType>+ <PlatformTarget>x64</PlatformTarget>+ <LangVersion>7.3</LangVersion>+ <ErrorReport>prompt</ErrorReport>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">+ <OutputPath>bin\x64\Release\</OutputPath>+ <DefineConstants>TRACE</DefineConstants>+ <Optimize>true</Optimize>+ <DebugType>pdbonly</DebugType>+ <PlatformTarget>x64</PlatformTarget>+ <LangVersion>7.3</LangVersion>+ <ErrorReport>prompt</ErrorReport>+ </PropertyGroup><ItemGroup><Reference Include="clipper_library, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"><HintPath>..\packages\clipper_library.6.2.1\lib\net40\clipper_library.dll</HintPath>@@ -42,7 +60,7 @@<HintPath>..\packages\Emgu.CV.4.4.0.4099\lib\netstandard2.0\Emgu.CV.Platform.NetStandard.dll</HintPath></Reference><Reference Include="Microsoft.ML.OnnxRuntime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f27f157f0a5b7bb6, processorArchitecture=MSIL">- <HintPath>..\packages\Microsoft.ML.OnnxRuntime.Managed.1.6.0\lib\netstandard1.1\Microsoft.ML.OnnxRuntime.dll</HintPath>+ <HintPath>..\packages\Microsoft.ML.OnnxRuntime.Managed.1.12.1\lib\netstandard2.0\Microsoft.ML.OnnxRuntime.dll</HintPath></Reference><Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"><HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>@@ -172,10 +190,10 @@<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText></PropertyGroup><Error Condition="!Exists('..\packages\Emgu.CV.runtime.windows.4.4.0.4099\build\Emgu.CV.runtime.windows.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Emgu.CV.runtime.windows.4.4.0.4099\build\Emgu.CV.runtime.windows.targets'))" />- <Error Condition="!Exists('..\packages\Microsoft.ML.OnnxRuntime.Managed.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.Managed.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.ML.OnnxRuntime.Managed.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.Managed.targets'))" />- <Error Condition="!Exists('..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.props'))" />- <Error Condition="!Exists('..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.targets'))" />+ <Error Condition="!Exists('..\packages\Microsoft.ML.OnnxRuntime.Managed.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.Managed.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.ML.OnnxRuntime.Managed.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.Managed.targets'))" />+ <Error Condition="!Exists('..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.props'))" />+ <Error Condition="!Exists('..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.targets'))" /></Target>- <Import Project="..\packages\Microsoft.ML.OnnxRuntime.Managed.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.Managed.targets" Condition="Exists('..\packages\Microsoft.ML.OnnxRuntime.Managed.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.Managed.targets')" />- <Import Project="..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.targets" Condition="Exists('..\packages\Microsoft.ML.OnnxRuntime.1.6.0\build\netstandard1.1\Microsoft.ML.OnnxRuntime.targets')" />+ <Import Project="..\packages\Microsoft.ML.OnnxRuntime.Managed.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.Managed.targets" Condition="Exists('..\packages\Microsoft.ML.OnnxRuntime.Managed.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.Managed.targets')" />+ <Import Project="..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.targets" Condition="Exists('..\packages\Microsoft.ML.OnnxRuntime.1.12.1\build\netstandard2.0\Microsoft.ML.OnnxRuntime.targets')" /></Project>\ No newline at end of filediff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrLite.cs b/dotnet/RapidOcrOnnxCs/OcrLib/OcrLite.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrLite.csrename to dotnet/RapidOcrOnnxCs/OcrLib/OcrLite.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrResult.cs b/dotnet/RapidOcrOnnxCs/OcrLib/OcrResult.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrResult.csrename to dotnet/RapidOcrOnnxCs/OcrLib/OcrResult.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrUtils.cs b/dotnet/RapidOcrOnnxCs/OcrLib/OcrUtils.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/OcrUtils.csrename to dotnet/RapidOcrOnnxCs/OcrLib/OcrUtils.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/Properties/AssemblyInfo.cs b/dotnet/RapidOcrOnnxCs/OcrLib/Properties/AssemblyInfo.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/Properties/AssemblyInfo.csrename to dotnet/RapidOcrOnnxCs/OcrLib/Properties/AssemblyInfo.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/ScaleParam.cs b/dotnet/RapidOcrOnnxCs/OcrLib/ScaleParam.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/ScaleParam.csrename to dotnet/RapidOcrOnnxCs/OcrLib/ScaleParam.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/packages.config b/dotnet/RapidOcrOnnxCs/OcrLib/packages.configsimilarity index 96%rename from dotnet/BaiPiaoOcrOnnxCs/OcrLib/packages.configrename to dotnet/RapidOcrOnnxCs/OcrLib/packages.configindex 312a881..95c3882 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrLib/packages.config+++ b/dotnet/RapidOcrOnnxCs/OcrLib/packages.config@@ -3,8 +3,8 @@<package id="clipper_library" version="6.2.1" targetFramework="net461" /><package id="Emgu.CV" version="4.4.0.4099" targetFramework="net461" /><package id="Emgu.CV.runtime.windows" version="4.4.0.4099" targetFramework="net461" />- <package id="Microsoft.ML.OnnxRuntime" version="1.6.0" targetFramework="net461" />- <package id="Microsoft.ML.OnnxRuntime.Managed" version="1.6.0" targetFramework="net461" />+ <package id="Microsoft.ML.OnnxRuntime" version="1.12.1" targetFramework="net461" />+ <package id="Microsoft.ML.OnnxRuntime.Managed" version="1.12.1" targetFramework="net461" /><package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net461" /><package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" /><package id="NETStandard.Library" version="1.6.1" targetFramework="net461" />diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/App.config b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/App.configsimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/App.configrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/App.configdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.Designer.cs b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.Designer.cssimilarity index 98%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.Designer.csrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.Designer.csindex 2207ebd..67d70cf 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.Designer.cs+++ b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.Designer.cs@@ -219,7 +219,7 @@this.detNameTextBox.Name = "detNameTextBox";this.detNameTextBox.Size = new System.Drawing.Size(489, 21);this.detNameTextBox.TabIndex = 12;- this.detNameTextBox.Text = "ch_ppocr_server_v2.0_det_infer.onnx";+ this.detNameTextBox.Text = "ch_PP-OCRv3_det_infer.onnx";//// label10//@@ -253,7 +253,7 @@this.recNameTextBox.Name = "recNameTextBox";this.recNameTextBox.Size = new System.Drawing.Size(489, 21);this.recNameTextBox.TabIndex = 16;- this.recNameTextBox.Text = "ch_ppocr_server_v2.0_rec_infer.onnx";+ this.recNameTextBox.Text = "ch_PP-OCRv3_rec_infer.onnx";//// label12//@@ -341,7 +341,7 @@this.unClipRatioNumeric.Size = new System.Drawing.Size(74, 21);this.unClipRatioNumeric.TabIndex = 22;this.unClipRatioNumeric.Value = new decimal(new int[] {- 15,+ 16,0,0,65536});@@ -414,6 +414,11 @@this.paddingNumeric.Name = "paddingNumeric";this.paddingNumeric.Size = new System.Drawing.Size(74, 21);this.paddingNumeric.TabIndex = 7;+ this.paddingNumeric.Value = new decimal(new int[] {+ 50,+ 0,+ 0,+ 0});//// label2//@@ -447,7 +452,7 @@this.boxScoreThreshNumeric.Size = new System.Drawing.Size(74, 21);this.boxScoreThreshNumeric.TabIndex = 13;this.boxScoreThreshNumeric.Value = new decimal(new int[] {- 7,+ 5,0,0,65536});@@ -498,7 +503,7 @@this.tableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Outset;this.tableLayoutPanel1.ColumnCount = 2;this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 80F));- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 94F));+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 96F));this.tableLayoutPanel1.Controls.Add(this.boxScoreThreshNumeric, 1, 2);this.tableLayoutPanel1.Controls.Add(this.label4, 0, 2);this.tableLayoutPanel1.Controls.Add(this.imgResizeNumeric, 1, 1);@@ -594,7 +599,7 @@this.Controls.Add(this.initBtn);this.Controls.Add(this.ocrResultTextBox);this.Name = "FormOcr";- this.Text = "BaiPiaoOcrOnnxCs v1.0.0";+ this.Text = "RapidOcrOnnxCs v1.2.0";this.Load += new System.EventHandler(this.Form1_Load);this.tableLayoutPanel2.ResumeLayout(false);this.tableLayoutPanel2.PerformLayout();diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.cs b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.csrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.resx b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.resxsimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/FormOcr.resxrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/FormOcr.resxdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/OcrOnnxForm.csproj b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/OcrOnnxForm.csprojsimilarity index 84%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/OcrOnnxForm.csprojrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/OcrOnnxForm.csprojindex ac1436f..75212e9 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/OcrOnnxForm.csproj+++ b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/OcrOnnxForm.csproj@@ -6,8 +6,8 @@<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform><ProjectGuid>{43A96152-8891-4505-8389-32276F3A9422}</ProjectGuid><OutputType>WinExe</OutputType>- <RootNamespace>BaiPiaoOcrOnnxCs</RootNamespace>- <AssemblyName>BaiPiaoOcrOnnxCs</AssemblyName>+ <RootNamespace>RapidOcrOnnxCs</RootNamespace>+ <AssemblyName>RapidOcrOnnxCs</AssemblyName><TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion><FileAlignment>512</FileAlignment><AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>@@ -32,6 +32,26 @@<ErrorReport>prompt</ErrorReport><WarningLevel>4</WarningLevel></PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">+ <DebugSymbols>true</DebugSymbols>+ <OutputPath>bin\x64\Debug\</OutputPath>+ <DefineConstants>DEBUG;TRACE</DefineConstants>+ <DebugType>full</DebugType>+ <PlatformTarget>x64</PlatformTarget>+ <LangVersion>7.3</LangVersion>+ <ErrorReport>prompt</ErrorReport>+ <Prefer32Bit>true</Prefer32Bit>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">+ <OutputPath>bin\x64\Release\</OutputPath>+ <DefineConstants>TRACE</DefineConstants>+ <Optimize>true</Optimize>+ <DebugType>pdbonly</DebugType>+ <PlatformTarget>x64</PlatformTarget>+ <LangVersion>7.3</LangVersion>+ <ErrorReport>prompt</ErrorReport>+ <Prefer32Bit>true</Prefer32Bit>+ </PropertyGroup><ItemGroup><Reference Include="Emgu.CV.Bitmap, Version=4.4.0.4099, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL"><HintPath>..\packages\Emgu.CV.Bitmap.4.4.0.4099\lib\netstandard2.0\Emgu.CV.Bitmap.dll</HintPath>@@ -81,6 +101,7 @@<Compile Include="Properties\Resources.Designer.cs"><AutoGen>True</AutoGen><DependentUpon>Resources.resx</DependentUpon>+ <DesignTime>True</DesignTime></Compile><None Include="packages.config" /><None Include="Properties\Settings.settings">diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Program.cs b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Program.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Program.csrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/Program.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/AssemblyInfo.cs b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/AssemblyInfo.cssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/AssemblyInfo.csrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/AssemblyInfo.csdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Resources.Designer.cs b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Resources.Designer.cssimilarity index 63%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Resources.Designer.csrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Resources.Designer.csindex 1c21f86..31415a2 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Resources.Designer.cs+++ b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Resources.Designer.cs@@ -1,69 +1,61 @@//------------------------------------------------------------------------------// <auto-generated>// 此代码由工具生成。-// 运行时版本: 4.0.30319.42000+// 运行时版本:4.0.30319.42000//-// 对此文件的更改可能导致不正确的行为,如果-// 重新生成代码,则所做更改将丢失。+// 对此文件的更改可能会导致不正确的行为,并且如果+// 重新生成代码,这些更改将会丢失。// </auto-generated>//-------------------------------------------------------------------------------namespace BaiPiaoOcrOnnxCs.Properties-{--+namespace RapidOcrOnnxCs.Properties {+ using System;++/// <summary>- /// 强类型资源类,用于查找本地化字符串等。+ /// 一个强类型的资源类,用于查找本地化的字符串等。/// </summary>// 此类是由 StronglyTypedResourceBuilder// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。- // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen// (以 /str 作为命令选项),或重新生成 VS 项目。- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")][global::System.Diagnostics.DebuggerNonUserCodeAttribute()][global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]- internal class Resources- {-+ internal class Resources {+private static global::System.Resources.ResourceManager resourceMan;-+private static global::System.Globalization.CultureInfo resourceCulture;-+[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]- internal Resources()- {+ internal Resources() {}-+/// <summary>- /// 返回此类使用的缓存 ResourceManager 实例。+ /// 返回此类使用的缓存的 ResourceManager 实例。/// </summary>[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]- internal static global::System.Resources.ResourceManager ResourceManager- {- get- {- if ((resourceMan == null))- {- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BaiPiaoOcrOnnxCs.Properties.Resources", typeof(Resources).Assembly);+ internal static global::System.Resources.ResourceManager ResourceManager {+ get {+ if (object.ReferenceEquals(resourceMan, null)) {+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RapidOcrOnnxCs.Properties.Resources", typeof(Resources).Assembly);resourceMan = temp;}return resourceMan;}}-+/// <summary>- /// 覆盖当前线程的 CurrentUICulture 属性- /// 使用此强类型的资源类的资源查找。+ /// 重写当前线程的 CurrentUICulture 属性,对+ /// 使用此强类型资源类的所有资源查找执行重写。/// </summary>[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]- internal static global::System.Globalization.CultureInfo Culture- {- get- {+ internal static global::System.Globalization.CultureInfo Culture {+ get {return resourceCulture;}- set- {+ set {resourceCulture = value;}}diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Resources.resx b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Resources.resxsimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Resources.resxrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Resources.resxdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Settings.Designer.cs b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Settings.Designer.cssimilarity index 63%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Settings.Designer.csrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Settings.Designer.csindex 92d9030..d14f8cb 100755--- a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Settings.Designer.cs+++ b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Settings.Designer.cs@@ -1,28 +1,24 @@//------------------------------------------------------------------------------// <auto-generated>-// This code was generated by a tool.-// Runtime Version:4.0.30319.42000+// 此代码由工具生成。+// 运行时版本:4.0.30319.42000//-// Changes to this file may cause incorrect behavior and will be lost if-// the code is regenerated.+// 对此文件的更改可能会导致不正确的行为,并且如果+// 重新生成代码,这些更改将会丢失。// </auto-generated>//-------------------------------------------------------------------------------namespace BaiPiaoOcrOnnxCs.Properties-{--+namespace RapidOcrOnnxCs.Properties {++[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase- {-+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {+private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));-- public static Settings Default- {- get- {++ public static Settings Default {+ get {return defaultInstance;}}diff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Settings.settings b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Settings.settingssimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/Properties/Settings.settingsrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/Properties/Settings.settingsdiff --git a/dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/packages.config b/dotnet/RapidOcrOnnxCs/OcrOnnxForm/packages.configsimilarity index 100%rename from dotnet/BaiPiaoOcrOnnxCs/OcrOnnxForm/packages.configrename to dotnet/RapidOcrOnnxCs/OcrOnnxForm/packages.configdiff --git a/dotnet/BaiPiaoOcrOnnxCs/README.md b/dotnet/RapidOcrOnnxCs/README.mdsimilarity index 80%rename from dotnet/BaiPiaoOcrOnnxCs/README.mdrename to dotnet/RapidOcrOnnxCs/README.mdindex 88aec62..306ef44 100755--- a/dotnet/BaiPiaoOcrOnnxCs/README.md+++ b/dotnet/RapidOcrOnnxCs/README.md@@ -1,4 +1,4 @@-# BaiPiaoOcrOnnxCs+# RapidOcrOnnxCs### 介绍* 本项目为Windows平台C# WinForm范例。@@ -12,22 +12,22 @@2. Visual Studio 2017或以上### 编译说明-1. Vs2017打开BaiPiaoOcrOnnxCs.sln。+1. Vs2019打开RapidOcrOnnxCs.sln。2. 解决方案资源管理器->OcrLib->右键->管理NuGet程序包->浏览->搜索->安装* 注意:Emgu.CV要选作者是“Emgu Corporation”-* Emgu.CV 4.4.0.4099-* Emgu.CV.runtime.windows 4.4.0.4099-* MicroSoft.ML.OnnxRuntime 1.6.0+* Emgu.CV 4.5.5.4823+* Emgu.CV.runtime.windows 4.5.5.4823+* MicroSoft.ML.OnnxRuntime 1.12.1* clipper_library 6.2.13. 解决方案资源管理器->OcrLiteOnnxForm->右键->管理NuGet程序包->浏览->搜索->安装* 注意:Emgu.CV要选作者是“Emgu Corporation”-* Emgu.CV 4.4.0.4099-* Emgu.CV.Bitmap 4.4.0.4099+* Emgu.CV 4.5.5.4823+* Emgu.CV.Bitmap 4.5.5.48234. 确保:OcrLiteOnnxForm设为启动项目5. 确保:OcrLiteOnnxForm->右键->属性->生成->平台目标:x646. 确保:OcrLiteLib->右键->属性->生成->平台目标:x647. 生成解决方案-8. 把models文件夹复制到```\BaiPiaoOcrOnnxCs\OcrOnnxForm\bin\Debug(或Release)```+8. 把models文件夹复制到```\RapidOcrOnnxCs\OcrOnnxForm\bin\Debug(或Release)```* [模型下载地址](https://github.com/znsoftm/BaiPiaoOCR/tree/main/models)9. 运行diff --git a/dotnet/BaiPiaoOcrOnnxCs/BaiPiaoOcrOnnxCs.sln b/dotnet/RapidOcrOnnxCs/RapidOcrOnnxCs.slnold mode 100755new mode 100644similarity index 68%rename from dotnet/BaiPiaoOcrOnnxCs/BaiPiaoOcrOnnxCs.slnrename to dotnet/RapidOcrOnnxCs/RapidOcrOnnxCs.slnindex 7c866ed..ccb096e--- a/dotnet/BaiPiaoOcrOnnxCs/BaiPiaoOcrOnnxCs.sln+++ b/dotnet/RapidOcrOnnxCs/RapidOcrOnnxCs.sln@@ -1,7 +1,7 @@Microsoft Visual Studio Solution File, Format Version 12.00-# Visual Studio 15-VisualStudioVersion = 15.0.28307.1340+# Visual Studio Version 16+VisualStudioVersion = 16.0.32929.386MinimumVisualStudioVersion = 10.0.40219.1Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OcrOnnxForm", "OcrOnnxForm\OcrOnnxForm.csproj", "{43A96152-8891-4505-8389-32276F3A9422}"EndProject@@ -10,17 +10,27 @@ EndProjectGlobalGlobalSection(SolutionConfigurationPlatforms) = preSolutionDebug|Any CPU = Debug|Any CPU+ Debug|x64 = Debug|x64Release|Any CPU = Release|Any CPU+ Release|x64 = Release|x64EndGlobalSectionGlobalSection(ProjectConfigurationPlatforms) = postSolution{43A96152-8891-4505-8389-32276F3A9422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{43A96152-8891-4505-8389-32276F3A9422}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {43A96152-8891-4505-8389-32276F3A9422}.Debug|x64.ActiveCfg = Debug|x64+ {43A96152-8891-4505-8389-32276F3A9422}.Debug|x64.Build.0 = Debug|x64{43A96152-8891-4505-8389-32276F3A9422}.Release|Any CPU.ActiveCfg = Release|Any CPU{43A96152-8891-4505-8389-32276F3A9422}.Release|Any CPU.Build.0 = Release|Any CPU+ {43A96152-8891-4505-8389-32276F3A9422}.Release|x64.ActiveCfg = Release|x64+ {43A96152-8891-4505-8389-32276F3A9422}.Release|x64.Build.0 = Release|x64{AB10D356-2D95-4460-96CA-9A7129AD0A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU{AB10D356-2D95-4460-96CA-9A7129AD0A76}.Debug|Any CPU.Build.0 = Debug|Any CPU+ {AB10D356-2D95-4460-96CA-9A7129AD0A76}.Debug|x64.ActiveCfg = Debug|x64+ {AB10D356-2D95-4460-96CA-9A7129AD0A76}.Debug|x64.Build.0 = Debug|x64{AB10D356-2D95-4460-96CA-9A7129AD0A76}.Release|Any CPU.ActiveCfg = Release|Any CPU{AB10D356-2D95-4460-96CA-9A7129AD0A76}.Release|Any CPU.Build.0 = Release|Any CPU+ {AB10D356-2D95-4460-96CA-9A7129AD0A76}.Release|x64.ActiveCfg = Release|x64+ {AB10D356-2D95-4460-96CA-9A7129AD0A76}.Release|x64.Build.0 = Release|x64EndGlobalSectionGlobalSection(SolutionProperties) = preSolutionHideSolutionNode = FALSE