diff --git a/deploy/cpp_dll/.clang-format b/deploy/cpp_dll/.clang-format
new file mode 100644
index 0000000000000000000000000000000000000000..8b5830627348c6bff12260b7d9adbd357f074718
--- /dev/null
+++ b/deploy/cpp_dll/.clang-format
@@ -0,0 +1,27 @@
+# This file is used by clang-format to autoformat paddle source code
+#
+# The clang-format is part of llvm toolchain.
+# It need to install llvm and clang to format source code style.
+#
+# The basic usage is,
+# clang-format -i -style=file PATH/TO/SOURCE/CODE
+#
+# The -style=file implicit use ".clang-format" file located in one of
+# parent directory.
+# The -i means inplace change.
+#
+# The document of clang-format is
+# http://clang.llvm.org/docs/ClangFormat.html
+# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
+---
+Language: Cpp
+BasedOnStyle: Google
+IndentWidth: 2
+TabWidth: 2
+ContinuationIndentWidth: 4
+AccessModifierOffset: -1 # The private/protected/public has no indent in class
+Standard: Cpp11
+AllowAllParametersOfDeclarationOnNextLine: true
+BinPackParameters: false
+BinPackArguments: false
+...
diff --git a/deploy/cpp_dll/C#_dll/.vs/WindowsFormsApp1/v16/.suo b/deploy/cpp_dll/C#_dll/.vs/WindowsFormsApp1/v16/.suo
new file mode 100644
index 0000000000000000000000000000000000000000..107fc2d51a82184287e0d23361ae2c69f5c3d9c9
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/.vs/WindowsFormsApp1/v16/.suo differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1.sln b/deploy/cpp_dll/C#_dll/WindowsFormsApp1.sln
new file mode 100644
index 0000000000000000000000000000000000000000..536047309e1bc28b524f5f721bbeedbc1c04a5eb
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30204.135
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Debug|x64.ActiveCfg = Debug|x64
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Debug|x64.Build.0 = Debug|x64
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Release|x64.ActiveCfg = Release|x64
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F9C00A5F-6C78-41A8-959B-6977B6C1D15E}
+ EndGlobalSection
+EndGlobal
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/App.config b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/App.config
new file mode 100644
index 0000000000000000000000000000000000000000..56efbc7b5f15b5166cc89dae0406895b57de0b67
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.Designer.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..b0c296e3723563924d020e3bc364dac3397ed747
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.Designer.cs
@@ -0,0 +1,61 @@
+namespace WindowsFormsApp1
+{
+ partial class Form1
+ {
+ ///
+ /// 必需的设计器变量。
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// 清理所有正在使用的资源。
+ ///
+ /// 如果应释放托管资源,为 true;否则为 false。
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows 窗体设计器生成的代码
+
+ ///
+ /// 设计器支持所需的方法 - 不要修改
+ /// 使用代码编辑器修改此方法的内容。
+ ///
+ private void InitializeComponent()
+ {
+ this.button1 = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(129, 72);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(129, 74);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "button1";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // Form1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Controls.Add(this.button1);
+ this.Name = "Form1";
+ this.Text = "Form1";
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button button1;
+ }
+}
+
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4f952de678f4b932164cfbbfbb54e14b353ad83f
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Runtime.InteropServices;
+namespace WindowsFormsApp1
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+ [DllImport("detector.dll", EntryPoint = "Loadmodel", CharSet = CharSet.Ansi)]
+ public static extern void test();
+ private void button1_Click(object sender, EventArgs e)
+ {
+ test();
+ }
+ }
+}
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.resx b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.resx
new file mode 100644
index 0000000000000000000000000000000000000000..1af7de150c99c12dd67a509fe57c10d63e4eeb04
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Form1.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Program.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Program.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4ef037cc0656057b9d6aad4299728bb9abfb3c4c
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Program.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace WindowsFormsApp1
+{
+ static class Program
+ {
+ ///
+ /// 应用程序的主入口点。
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+}
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/AssemblyInfo.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000000000000000000000000000000000..0b5c000083d8e75ebaac6cd3f46afaf69294faf3
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("WindowsFormsApp1")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WindowsFormsApp1")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("39044b60-f2a8-4b9f-8e65-9f87baec83bd")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Resources.Designer.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Resources.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..fda36f79743d08a957316480a25a4876540da62b
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: 4.0.30319.42000
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace WindowsFormsApp1.Properties
+{
+
+
+ ///
+ /// 强类型资源类,用于查找本地化字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ 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()
+ {
+ }
+
+ ///
+ /// 返回此类使用的缓存 ResourceManager 实例。
+ ///
+ [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("WindowsFormsApp1.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 覆盖当前线程的 CurrentUICulture 属性
+ /// 使用此强类型的资源类的资源查找。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Resources.resx b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Resources.resx
new file mode 100644
index 0000000000000000000000000000000000000000..af7dbebbacef595e3089c01c05671016c21a8304
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Settings.Designer.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Settings.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..438df21381ac484a2b9663978736c524d8e8f3bf
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WindowsFormsApp1.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
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Settings.settings b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Settings.settings
new file mode 100644
index 0000000000000000000000000000000000000000..39645652af62950ebf3b28ec3a5400dcec30b1c4
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/WindowsFormsApp1.csproj b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/WindowsFormsApp1.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..ca8638487c961c2f25cdbdb481eabbdbe76cfd54
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/WindowsFormsApp1.csproj
@@ -0,0 +1,105 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {39044B60-F2A8-4B9F-8E65-9F87BAEC83BD}
+ WinExe
+ WindowsFormsApp1
+ WindowsFormsApp1
+ v4.7.2
+ 512
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ 7.3
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ 7.3
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ Form1.cs
+
+
+
+
+ Form1.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.exe b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.exe
new file mode 100644
index 0000000000000000000000000000000000000000..cd461533640c2f4a67b9e3ed81e2e2e3ced838ed
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.exe differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.exe.config b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.exe.config
new file mode 100644
index 0000000000000000000000000000000000000000..56efbc7b5f15b5166cc89dae0406895b57de0b67
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.exe.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.pdb b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.pdb
new file mode 100644
index 0000000000000000000000000000000000000000..83c7442aa2aeb6d5f9d15863438ad34051777886
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/bin/x64/Debug/WindowsFormsApp1.pdb differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
new file mode 100644
index 0000000000000000000000000000000000000000..3871b184d3f475a3c71d56db9f48c2a193080512
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
@@ -0,0 +1,4 @@
+//
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache
new file mode 100644
index 0000000000000000000000000000000000000000..e74e8158dd2d8e92134ef5c5918e556b8028445c
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000000000000000000000000000000000000..0fea49ca9c6d00f27bf3e78baa9247532717d26e
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache
new file mode 100644
index 0000000000000000000000000000000000000000..b9d4fdce2676c1ef993093dc0374e09865129e10
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
new file mode 100644
index 0000000000000000000000000000000000000000..3871b184d3f475a3c71d56db9f48c2a193080512
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs
@@ -0,0 +1,4 @@
+//
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 0000000000000000000000000000000000000000..42cabff7c8e1f2d796c567c91a8b115c539c6100
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.Form1.resources b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.Form1.resources
new file mode 100644
index 0000000000000000000000000000000000000000..6c05a9776bd7cbae976fdcec7e3a254e93018279
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.Form1.resources differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.Properties.Resources.resources b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.Properties.Resources.resources
new file mode 100644
index 0000000000000000000000000000000000000000..6c05a9776bd7cbae976fdcec7e3a254e93018279
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.Properties.Resources.resources differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache
new file mode 100644
index 0000000000000000000000000000000000000000..caaa81f121cb04592161198480ed44a40d9d676f
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache
@@ -0,0 +1 @@
+d63ae25ae22a16b1f83e8cb2d7c50f73cb438914
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000000000000000000000000000000000000..805e28b41917b333392f20dc7ba1b5232cab3010
--- /dev/null
+++ b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt
@@ -0,0 +1,10 @@
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\bin\x64\Debug\WindowsFormsApp1.exe.config
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\bin\x64\Debug\WindowsFormsApp1.exe
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\bin\x64\Debug\WindowsFormsApp1.pdb
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.csprojAssemblyReference.cache
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.Form1.resources
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.Properties.Resources.resources
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.csproj.GenerateResource.cache
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.csproj.CoreCompileInputs.cache
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.exe
+C:\Users\Zhiliang.Yu\Desktop\pp\WindowsFormsApp1\WindowsFormsApp1\obj\x64\Debug\WindowsFormsApp1.pdb
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.GenerateResource.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.GenerateResource.cache
new file mode 100644
index 0000000000000000000000000000000000000000..065408060364cadc8574afa464c255d21de45fc9
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csproj.GenerateResource.cache differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csprojAssemblyReference.cache b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csprojAssemblyReference.cache
new file mode 100644
index 0000000000000000000000000000000000000000..cabaf84b764635b1fdee28373784c021694b96c4
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.csprojAssemblyReference.cache differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.exe b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.exe
new file mode 100644
index 0000000000000000000000000000000000000000..cd461533640c2f4a67b9e3ed81e2e2e3ced838ed
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.exe differ
diff --git a/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.pdb b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.pdb
new file mode 100644
index 0000000000000000000000000000000000000000..83c7442aa2aeb6d5f9d15863438ad34051777886
Binary files /dev/null and b/deploy/cpp_dll/C#_dll/WindowsFormsApp1/obj/x64/Debug/WindowsFormsApp1.pdb differ
diff --git a/deploy/cpp_dll/CMakeLists.txt b/deploy/cpp_dll/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e8fa9e012f9fce0729cd93b31c2373614ad3e745
--- /dev/null
+++ b/deploy/cpp_dll/CMakeLists.txt
@@ -0,0 +1,302 @@
+cmake_minimum_required(VERSION 3.0)
+project(PaddleX CXX C)
+
+option(WITH_MKL "Compile demo with MKL/OpenBlas support,defaultuseMKL." ON)
+option(WITH_GPU "Compile demo with GPU/CPU, default use CPU." ON)
+option(WITH_STATIC_LIB "Compile demo with static/shared library, default use static." OFF)
+option(WITH_TENSORRT "Compile demo with TensorRT." OFF)
+option(WITH_ENCRYPTION "Compile demo with encryption tool." OFF)
+
+SET(TENSORRT_DIR "" CACHE PATH "Location of libraries")
+SET(PADDLE_DIR "" CACHE PATH "Location of libraries")
+SET(OPENCV_DIR "" CACHE PATH "Location of libraries")
+SET(ENCRYPTION_DIR"" CACHE PATH "Location of libraries")
+SET(CUDA_LIB "" CACHE PATH "Location of libraries")
+
+if (NOT WIN32)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/demo)
+else()
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/paddlex_inference)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/paddlex_inference)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/paddlex_inference)
+endif()
+
+if (NOT WIN32)
+ SET(YAML_BUILD_TYPE ON CACHE BOOL "yaml build shared library.")
+else()
+ SET(YAML_BUILD_TYPE OFF CACHE BOOL "yaml build shared library.")
+endif()
+include(cmake/yaml-cpp.cmake)
+
+include_directories("${CMAKE_SOURCE_DIR}/")
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/ext/yaml-cpp/src/ext-yaml-cpp/include")
+link_directories("${CMAKE_CURRENT_BINARY_DIR}/ext/yaml-cpp/lib")
+
+macro(safe_set_static_flag)
+ foreach(flag_var
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+ CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+ if(${flag_var} MATCHES "/MD")
+ string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+ endif(${flag_var} MATCHES "/MD")
+ endforeach(flag_var)
+endmacro()
+
+
+if (WITH_ENCRYPTION)
+add_definitions( -DWITH_ENCRYPTION=${WITH_ENCRYPTION})
+endif()
+
+if (WITH_MKL)
+ ADD_DEFINITIONS(-DUSE_MKL)
+endif()
+
+if (NOT DEFINED PADDLE_DIR OR ${PADDLE_DIR} STREQUAL "")
+ message(FATAL_ERROR "please set PADDLE_DIR with -DPADDLE_DIR=/path/paddle_influence_dir")
+endif()
+
+if (NOT DEFINED OPENCV_DIR OR ${OPENCV_DIR} STREQUAL "")
+ message(FATAL_ERROR "please set OPENCV_DIR with -DOPENCV_DIR=/path/opencv")
+endif()
+
+include_directories("${CMAKE_SOURCE_DIR}/")
+include_directories("${PADDLE_DIR}/")
+include_directories("${PADDLE_DIR}/third_party/install/protobuf/include")
+include_directories("${PADDLE_DIR}/third_party/install/glog/include")
+include_directories("${PADDLE_DIR}/third_party/install/gflags/include")
+include_directories("${PADDLE_DIR}/third_party/install/xxhash/include")
+if (EXISTS "${PADDLE_DIR}/third_party/install/snappy/include")
+ include_directories("${PADDLE_DIR}/third_party/install/snappy/include")
+endif()
+if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/include")
+ include_directories("${PADDLE_DIR}/third_party/install/snappystream/include")
+endif()
+include_directories("${PADDLE_DIR}/third_party/install/zlib/include")
+include_directories("${PADDLE_DIR}/third_party/boost")
+include_directories("${PADDLE_DIR}/third_party/eigen3")
+
+if (EXISTS "${PADDLE_DIR}/third_party/install/snappy/lib")
+ link_directories("${PADDLE_DIR}/third_party/install/snappy/lib")
+endif()
+if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/lib")
+ link_directories("${PADDLE_DIR}/third_party/install/snappystream/lib")
+endif()
+
+link_directories("${PADDLE_DIR}/third_party/install/zlib/lib")
+link_directories("${PADDLE_DIR}/third_party/install/protobuf/lib")
+link_directories("${PADDLE_DIR}/third_party/install/glog/lib")
+link_directories("${PADDLE_DIR}/third_party/install/gflags/lib")
+link_directories("${PADDLE_DIR}/third_party/install/xxhash/lib")
+link_directories("${PADDLE_DIR}/paddle/lib/")
+link_directories("${CMAKE_CURRENT_BINARY_DIR}")
+
+if (WIN32)
+ include_directories("${PADDLE_DIR}/paddle/fluid/inference")
+ include_directories("${PADDLE_DIR}/paddle/include")
+ link_directories("${PADDLE_DIR}/paddle/fluid/inference")
+ find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/build/ NO_DEFAULT_PATH)
+ unset(OpenCV_DIR CACHE)
+else ()
+ find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/share/OpenCV NO_DEFAULT_PATH)
+ include_directories("${PADDLE_DIR}/paddle/include")
+ link_directories("${PADDLE_DIR}/paddle/lib")
+endif ()
+include_directories(${OpenCV_INCLUDE_DIRS})
+
+if (WIN32)
+ add_definitions("/DGOOGLE_GLOG_DLL_DECL=")
+ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /bigobj /MTd")
+ set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /bigobj /MT")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj /MTd")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /bigobj /MT")
+ if (WITH_STATIC_LIB)
+ safe_set_static_flag()
+ add_definitions(-DSTATIC_LIB)
+ endif()
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -o2 -fopenmp -std=c++11")
+ set(CMAKE_STATIC_LIBRARY_PREFIX "")
+endif()
+
+if (WITH_GPU)
+ if (NOT DEFINED CUDA_LIB OR ${CUDA_LIB} STREQUAL "")
+ message(FATAL_ERROR "please set CUDA_LIB with -DCUDA_LIB=/path/cuda/lib64")
+ endif()
+ if (NOT WIN32)
+ if (NOT DEFINED CUDNN_LIB)
+ message(FATAL_ERROR "please set CUDNN_LIB with -DCUDNN_LIB=/path/cudnn/")
+ endif()
+ endif(NOT WIN32)
+endif()
+
+
+if (NOT WIN32)
+ if (WITH_TENSORRT AND WITH_GPU)
+ include_directories("${TENSORRT_DIR}/include")
+ link_directories("${TENSORRT_DIR}/lib")
+ endif()
+endif(NOT WIN32)
+
+if (NOT WIN32)
+ set(NGRAPH_PATH "${PADDLE_DIR}/third_party/install/ngraph")
+ if(EXISTS ${NGRAPH_PATH})
+ include(GNUInstallDirs)
+ include_directories("${NGRAPH_PATH}/include")
+ link_directories("${NGRAPH_PATH}/${CMAKE_INSTALL_LIBDIR}")
+ set(NGRAPH_LIB ${NGRAPH_PATH}/${CMAKE_INSTALL_LIBDIR}/libngraph${CMAKE_SHARED_LIBRARY_SUFFIX})
+ endif()
+endif()
+
+if(WITH_MKL)
+ include_directories("${PADDLE_DIR}/third_party/install/mklml/include")
+ if (WIN32)
+ set(MATH_LIB ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.lib
+ ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.lib)
+ else ()
+ set(MATH_LIB ${PADDLE_DIR}/third_party/install/mklml/lib/libmklml_intel${CMAKE_SHARED_LIBRARY_SUFFIX}
+ ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5${CMAKE_SHARED_LIBRARY_SUFFIX})
+ execute_process(COMMAND cp -r ${PADDLE_DIR}/third_party/install/mklml/lib/libmklml_intel${CMAKE_SHARED_LIBRARY_SUFFIX} /usr/lib)
+ endif ()
+ set(MKLDNN_PATH "${PADDLE_DIR}/third_party/install/mkldnn")
+ if(EXISTS ${MKLDNN_PATH})
+ include_directories("${MKLDNN_PATH}/include")
+ if (WIN32)
+ set(MKLDNN_LIB ${MKLDNN_PATH}/lib/mkldnn.lib)
+ else ()
+ set(MKLDNN_LIB ${MKLDNN_PATH}/lib/libmkldnn.so.0)
+ endif ()
+ endif()
+else()
+ set(MATH_LIB ${PADDLE_DIR}/third_party/install/openblas/lib/libopenblas${CMAKE_STATIC_LIBRARY_SUFFIX})
+endif()
+
+if (WIN32)
+ if(EXISTS "${PADDLE_DIR}/paddle/fluid/inference/libpaddle_fluid${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ set(DEPS
+ ${PADDLE_DIR}/paddle/fluid/inference/libpaddle_fluid${CMAKE_STATIC_LIBRARY_SUFFIX})
+ else()
+ set(DEPS
+ ${PADDLE_DIR}/paddle/lib/libpaddle_fluid${CMAKE_STATIC_LIBRARY_SUFFIX})
+ endif()
+endif()
+
+if(WITH_STATIC_LIB)
+ set(DEPS
+ ${PADDLE_DIR}/paddle/lib/libpaddle_fluid${CMAKE_STATIC_LIBRARY_SUFFIX})
+else()
+ set(DEPS
+ ${PADDLE_DIR}/paddle/lib/libpaddle_fluid${CMAKE_SHARED_LIBRARY_SUFFIX})
+endif()
+
+if (NOT WIN32)
+ set(DEPS ${DEPS}
+ ${MATH_LIB} ${MKLDNN_LIB}
+ glog gflags protobuf z xxhash yaml-cpp
+ )
+ if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/lib")
+ set(DEPS ${DEPS} snappystream)
+ endif()
+ if (EXISTS "${PADDLE_DIR}/third_party/install/snappy/lib")
+ set(DEPS ${DEPS} snappy)
+ endif()
+else()
+ set(DEPS ${DEPS}
+ ${MATH_LIB} ${MKLDNN_LIB}
+ glog gflags_static libprotobuf zlibstatic xxhash libyaml-cppmt)
+
+ set(DEPS ${DEPS} libcmt shlwapi)
+ if (EXISTS "${PADDLE_DIR}/third_party/install/snappy/lib")
+ set(DEPS ${DEPS} snappy)
+ endif()
+ if(EXISTS "${PADDLE_DIR}/third_party/install/snappystream/lib")
+ set(DEPS ${DEPS} snappystream)
+ endif()
+endif(NOT WIN32)
+
+if(WITH_GPU)
+ if(NOT WIN32)
+ if (WITH_TENSORRT)
+ set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/libnvinfer${CMAKE_SHARED_LIBRARY_SUFFIX})
+ set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/libnvinfer_plugin${CMAKE_SHARED_LIBRARY_SUFFIX})
+ endif()
+ set(DEPS ${DEPS} ${CUDA_LIB}/libcudart${CMAKE_SHARED_LIBRARY_SUFFIX})
+ set(DEPS ${DEPS} ${CUDNN_LIB}/libcudnn${CMAKE_SHARED_LIBRARY_SUFFIX})
+ else()
+ set(DEPS ${DEPS} ${CUDA_LIB}/cudart${CMAKE_STATIC_LIBRARY_SUFFIX} )
+ set(DEPS ${DEPS} ${CUDA_LIB}/cublas${CMAKE_STATIC_LIBRARY_SUFFIX} )
+ set(DEPS ${DEPS} ${CUDA_LIB}/cudnn${CMAKE_STATIC_LIBRARY_SUFFIX})
+ endif()
+endif()
+
+if(WITH_ENCRYPTION)
+ if(NOT WIN32)
+ include_directories("${ENCRYPTION_DIR}/include")
+ link_directories("${ENCRYPTION_DIR}/lib")
+ set(DEPS ${DEPS} ${ENCRYPTION_DIR}/lib/libpmodel-decrypt${CMAKE_SHARED_LIBRARY_SUFFIX})
+ else()
+ message(FATAL_ERROR "Encryption Tool don't support WINDOWS")
+ endif()
+endif()
+
+if (NOT WIN32)
+ set(EXTERNAL_LIB "-ldl -lrt -lgomp -lz -lm -lpthread")
+ set(DEPS ${DEPS} ${EXTERNAL_LIB})
+endif()
+
+set(DEPS ${DEPS} ${OpenCV_LIBS})
+add_library(paddlex_inference SHARED src/visualize src/transforms.cpp src/paddlex.cpp)
+ADD_DEPENDENCIES(paddlex_inference ext-yaml-cpp)
+target_link_libraries(paddlex_inference ${DEPS})
+
+add_executable(classifier demo/classifier.cpp src/transforms.cpp src/paddlex.cpp)
+ADD_DEPENDENCIES(classifier ext-yaml-cpp)
+target_link_libraries(classifier ${DEPS})
+
+add_library(detector SHARED demo/detector.cpp src/transforms.cpp src/paddlex.cpp src/visualize.cpp)
+ADD_DEPENDENCIES(detector ext-yaml-cpp)
+target_link_libraries(detector ${DEPS})
+
+add_executable(segmenter demo/segmenter.cpp src/transforms.cpp src/paddlex.cpp src/visualize.cpp)
+ADD_DEPENDENCIES(segmenter ext-yaml-cpp)
+target_link_libraries(segmenter ${DEPS})
+
+if (WIN32 AND WITH_MKL)
+ add_custom_command(TARGET classifier POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ./mklml.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ./libiomp5md.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mkldnn/lib/mkldnn.dll ./mkldnn.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ./release/mklml.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ./release/libiomp5md.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mkldnn/lib/mkldnn.dll ./release/mkldnn.dll
+ )
+ add_custom_command(TARGET detector POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ./mklml.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ./libiomp5md.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mkldnn/lib/mkldnn.dll ./mkldnn.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ./release/mklml.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ./release/libiomp5md.dll
+ )
+ add_custom_command(TARGET segmenter POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ./mklml.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ./libiomp5md.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mkldnn/lib/mkldnn.dll ./mkldnn.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ./release/mklml.dll
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ./release/libiomp5md.dll
+
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PADDLE_DIR}/third_party/install/mkldnn/lib/mkldnn.dll ./release/mkldnn.dll
+ )
+
+endif()
+
+file(COPY "${CMAKE_SOURCE_DIR}/include/paddlex/visualize.h"
+DESTINATION "${CMAKE_BINARY_DIR}/include/" )
+file(COPY "${CMAKE_SOURCE_DIR}/include/paddlex/config_parser.h"
+DESTINATION "${CMAKE_BINARY_DIR}/include/" )
+file(COPY "${CMAKE_SOURCE_DIR}/include/paddlex/transforms.h"
+DESTINATION "${CMAKE_BINARY_DIR}/include/" )
+file(COPY "${CMAKE_SOURCE_DIR}/include/paddlex/results.h"
+DESTINATION "${CMAKE_BINARY_DIR}/include/" )
+file(COPY "${CMAKE_SOURCE_DIR}/include/paddlex/paddlex.h"
+DESTINATION "${CMAKE_BINARY_DIR}/include/" )
diff --git a/deploy/cpp_dll/CMakeSettings.json b/deploy/cpp_dll/CMakeSettings.json
new file mode 100644
index 0000000000000000000000000000000000000000..4aa8fcc0e0a502f31828385223cf3da34ce90467
--- /dev/null
+++ b/deploy/cpp_dll/CMakeSettings.json
@@ -0,0 +1,47 @@
+{
+ "configurations": [
+ {
+ "name": "x64-Release",
+ "generator": "Ninja",
+ "configurationType": "RelWithDebInfo",
+ "inheritEnvironments": [ "msvc_x64_x64" ],
+ "buildRoot": "${projectDir}\\out\\build\\${name}",
+ "installRoot": "${projectDir}\\out\\install\\${name}",
+ "cmakeCommandArgs": "",
+ "buildCommandArgs": "-v",
+ "ctestCommandArgs": "",
+ "variables": [
+ {
+ "name": "OPENCV_DIR",
+ "value": "C:/projects/opencv",
+ "type": "PATH"
+ },
+ {
+ "name": "PADDLE_DIR",
+ "value": "C:/projects/fluid_install_dir_win_cpu_1.6/fluid_install_dir_win_cpu_1.6",
+ "type": "PATH"
+ },
+ {
+ "name": "CMAKE_BUILD_TYPE",
+ "value": "Release",
+ "type": "STRING"
+ },
+ {
+ "name": "WITH_STATIC_LIB",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "WITH_MKL",
+ "value": "True",
+ "type": "BOOL"
+ },
+ {
+ "name": "WITH_GPU",
+ "value": "False",
+ "type": "BOOL"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/deploy/cpp_dll/cmake/yaml-cpp.cmake b/deploy/cpp_dll/cmake/yaml-cpp.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..2a3dbd7abfd11895ccd505e74d2c31d64ba65cbe
--- /dev/null
+++ b/deploy/cpp_dll/cmake/yaml-cpp.cmake
@@ -0,0 +1,30 @@
+find_package(Git REQUIRED)
+
+include(ExternalProject)
+
+message("${CMAKE_BUILD_TYPE}")
+
+ExternalProject_Add(
+ ext-yaml-cpp
+ URL https://bj.bcebos.com/paddlex/deploy/deps/yaml-cpp.zip
+ URL_MD5 9542d6de397d1fbd649ed468cb5850e6
+ CMAKE_ARGS
+ -DYAML_CPP_BUILD_TESTS=OFF
+ -DYAML_CPP_BUILD_TOOLS=OFF
+ -DYAML_CPP_INSTALL=OFF
+ -DYAML_CPP_BUILD_CONTRIB=OFF
+ -DMSVC_SHARED_RT=OFF
+ -DBUILD_SHARED_LIBS=${YAML_BUILD_TYPE}
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+ -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+ -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
+ -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/ext/yaml-cpp/lib
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/ext/yaml-cpp/lib
+ PREFIX "${CMAKE_BINARY_DIR}/ext/yaml-cpp"
+ # Disable install step
+ INSTALL_COMMAND ""
+ LOG_DOWNLOAD ON
+ LOG_BUILD 1
+)
+
diff --git a/deploy/cpp_dll/demo/classifier.cpp b/deploy/cpp_dll/demo/classifier.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..45df7ec9f1f8b146256825ea864ded8ca87a7842
--- /dev/null
+++ b/deploy/cpp_dll/demo/classifier.cpp
@@ -0,0 +1,75 @@
+// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include "include/paddlex/paddlex.h"
+
+DEFINE_string(model_dir, "", "Path of inference model");
+DEFINE_bool(use_gpu, false, "Infering with GPU or CPU");
+DEFINE_bool(use_trt, false, "Infering with TensorRT");
+DEFINE_int32(gpu_id, 0, "GPU card id");
+DEFINE_string(key, "", "key of encryption");
+DEFINE_string(image, "", "Path of test image file");
+DEFINE_string(image_list, "", "Path of test image list file");
+
+int main(int argc, char** argv) {
+ // Parsing command-line
+ google::ParseCommandLineFlags(&argc, &argv, true);
+
+ if (FLAGS_model_dir == "") {
+ std::cerr << "--model_dir need to be defined" << std::endl;
+ return -1;
+ }
+ if (FLAGS_image == "" & FLAGS_image_list == "") {
+ std::cerr << "--image or --image_list need to be defined" << std::endl;
+ return -1;
+ }
+
+ // 加载模型
+ PaddleX::Model model;
+ model.Init(FLAGS_model_dir, FLAGS_use_gpu, FLAGS_use_trt, FLAGS_gpu_id, FLAGS_key);
+
+ // 进行预测
+ if (FLAGS_image_list != "") {
+ std::ifstream inf(FLAGS_image_list);
+ if (!inf) {
+ std::cerr << "Fail to open file " << FLAGS_image_list << std::endl;
+ return -1;
+ }
+ std::string image_path;
+ while (getline(inf, image_path)) {
+ PaddleX::ClsResult result;
+ cv::Mat im = cv::imread(image_path, 1);
+ model.predict(im, &result);
+ std::cout << "Predict label: " << result.category
+ << ", label_id:" << result.category_id
+ << ", score: " << result.score << std::endl;
+ }
+ } else {
+ PaddleX::ClsResult result;
+ cv::Mat im = cv::imread(FLAGS_image, 1);
+ model.predict(im, &result);
+ std::cout << "Predict label: " << result.category
+ << ", label_id:" << result.category_id
+ << ", score: " << result.score << std::endl;
+ }
+
+ return 0;
+}
diff --git a/deploy/cpp_dll/demo/detector.cpp b/deploy/cpp_dll/demo/detector.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c3fe617d3ce03b5f264cc3ac73c0bdf0aeed1510
--- /dev/null
+++ b/deploy/cpp_dll/demo/detector.cpp
@@ -0,0 +1,79 @@
+// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include "include/paddlex/paddlex.h"
+#include "include/paddlex/visualize.h"
+
+namespace PaddleX {
+std::string image;
+void PredictImage(std::string image, PaddleX::DetResult result);
+
+void Loadmodel() {
+ std::string model_dir = "E:\\0608\\inference_model";
+ std::string key = "";
+ std::string image_list = "";
+ std::string save_dir = "output";
+ int gpu_id = 0;
+ bool use_trt = 0;
+ bool use_gpu = 1;
+
+ // Load model and create a object detector
+
+ PaddleX::DetResult result;
+ PredictImage(image, result);
+}
+
+void PredictImage(std::string image, PaddleX::DetResult result) {
+ image = "E:\\0608\\pic\\test.jpg";
+ cv::Mat im = cv::imread(image, 1);
+
+ // PaddleX::DetResult* result;
+ std::string model_dir = "E:\\0608\\inference_model";
+ std::string key = "";
+ std::string image_list = "";
+
+ int gpu_id = 0;
+ bool use_trt = 0;
+ bool use_gpu = 1;
+ PaddleX::Model model;
+ model.Init(model_dir, use_gpu, use_trt, gpu_id, key);
+ model.predict(im, &result);
+ for (int i = 0; i < result.boxes.size(); ++i) {
+ std::cout << ", predict label: " << result.boxes[i].category
+ << ", label_id:" << result.boxes[i].category_id
+ << ", score: " << result.boxes[i].score
+ << ", box(xmin, ymin, w, h):(" << result.boxes[i].coordinate[0]
+ << ", " << result.boxes[i].coordinate[1] << ", "
+ << result.boxes[i].coordinate[2] << ", "
+ << result.boxes[i].coordinate[3] << ")" << std::endl;
+ }
+
+ // 可视化
+ auto colormap = PaddleX::GenerateColorMap(model.labels.size());
+ cv::Mat vis_img = PaddleX::Visualize(im, result, model.labels, colormap, 0.5);
+ std::string save_dir = "output";
+ std::string save_path = PaddleX::generate_save_path(save_dir, image);
+
+ cv::imwrite(save_path, vis_img);
+ // result->clear();
+ std::cout << "Visualized output saved as " << save_path << std::endl;
+}
+} // namespace PaddleX
\ No newline at end of file
diff --git a/deploy/cpp_dll/demo/segmenter.cpp b/deploy/cpp_dll/demo/segmenter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..687bb40bf821a2e408088df00133bf57f918d316
--- /dev/null
+++ b/deploy/cpp_dll/demo/segmenter.cpp
@@ -0,0 +1,87 @@
+// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include "include/paddlex/paddlex.h"
+#include "include/paddlex/visualize.h"
+
+DEFINE_string(model_dir, "", "Path of inference model");
+DEFINE_bool(use_gpu, false, "Infering with GPU or CPU");
+DEFINE_bool(use_trt, false, "Infering with TensorRT");
+DEFINE_int32(gpu_id, 0, "GPU card id");
+DEFINE_string(key, "", "key of encryption");
+DEFINE_string(image, "", "Path of test image file");
+DEFINE_string(image_list, "", "Path of test image list file");
+DEFINE_string(save_dir, "output", "Path to save visualized image");
+
+int main(int argc, char** argv) {
+ // 解析命令行参数
+ google::ParseCommandLineFlags(&argc, &argv, true);
+
+ if (FLAGS_model_dir == "") {
+ std::cerr << "--model_dir need to be defined" << std::endl;
+ return -1;
+ }
+ if (FLAGS_image == "" & FLAGS_image_list == "") {
+ std::cerr << "--image or --image_list need to be defined" << std::endl;
+ return -1;
+ }
+
+ // 加载模型
+ PaddleX::Model model;
+ model.Init(FLAGS_model_dir, FLAGS_use_gpu, FLAGS_use_trt, FLAGS_gpu_id, FLAGS_key);
+
+ auto colormap = PaddleX::GenerateColorMap(model.labels.size());
+ // 进行预测
+ if (FLAGS_image_list != "") {
+ std::ifstream inf(FLAGS_image_list);
+ if (!inf) {
+ std::cerr << "Fail to open file " << FLAGS_image_list << std::endl;
+ return -1;
+ }
+ std::string image_path;
+ while (getline(inf, image_path)) {
+ PaddleX::SegResult result;
+ cv::Mat im = cv::imread(image_path, 1);
+ model.predict(im, &result);
+ // 可视化
+ cv::Mat vis_img =
+ PaddleX::Visualize(im, result, model.labels, colormap);
+ std::string save_path =
+ PaddleX::generate_save_path(FLAGS_save_dir, image_path);
+ cv::imwrite(save_path, vis_img);
+ result.clear();
+ std::cout << "Visualized output saved as " << save_path << std::endl;
+ }
+ } else {
+ PaddleX::SegResult result;
+ cv::Mat im = cv::imread(FLAGS_image, 1);
+ model.predict(im, &result);
+ // 可视化
+ cv::Mat vis_img = PaddleX::Visualize(im, result, model.labels, colormap);
+ std::string save_path =
+ PaddleX::generate_save_path(FLAGS_save_dir, FLAGS_image);
+ cv::imwrite(save_path, vis_img);
+ result.clear();
+ std::cout << "Visualized output saved as " << save_path << std::endl;
+ }
+
+ return 0;
+}
diff --git a/deploy/cpp_dll/include/paddlex/config_parser.h b/deploy/cpp_dll/include/paddlex/config_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..7262945e92e55caa0e9297137900c885a6e5f4d4
--- /dev/null
+++ b/deploy/cpp_dll/include/paddlex/config_parser.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include
+#include