Skip to content

Commit

Permalink
[Tutorial Doc] add tutorial for how to use c and c sharp api (PaddleP…
Browse files Browse the repository at this point in the history
…addle#1392)

* add tutorialfor how to use c and c sharp api

* update english doc

* update doc

* update doc

* update doc

* update doc

* update doc
  • Loading branch information
rainyfly authored Feb 28, 2023
1 parent c8bcada commit 4ee783b
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion c_api/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# C API implementation
# C API tutorial

This directory is the implementation of FastDeploy C SDK, which provides solutions for scenarios where users need C API.

Expand Down
2 changes: 1 addition & 1 deletion c_api/README_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# C API实现
# C API指南

该目录下为FastDeploy C SDK的接口实现,为用户需要C API的场景提供解决方案。

Expand Down
2 changes: 1 addition & 1 deletion csharp/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# C# API implementation
# C# API tutorial

This directory is the implementation of FastDeploy C# SDK, which provides solutions for scenarios where users need C# API.

Expand Down
2 changes: 1 addition & 1 deletion csharp/README_CN.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# C# API实现
# C# API指南

该目录下为FastDeploy C# SDK的接口实现,为用户需要C# API的场景提供解决方案。

Expand Down
6 changes: 3 additions & 3 deletions docs/cn/build_and_install/cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
| ENABLE_OPENVINO_BACKEND | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成OpenVINO后端 |
| ENABLE_VISION | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成视觉模型的部署模块 |
| ENABLE_TEXT | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
| ENABLE_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
| WITH_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |

第三方库依赖指定(不设定如下参数,会自动下载预编译库)
| 选项 | 说明 |
Expand Down Expand Up @@ -70,7 +70,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 ^
-DENABLE_VISION=ON ^
-DENABLE_TEXT=ON ^
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
```
Expand Down
6 changes: 3 additions & 3 deletions docs/cn/build_and_install/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
| ENABLE_TEXT | Linux(x64)/Windows(x64) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
| CUDA_DIRECTORY | Linux(x64)/Windows(x64) | 默认/usr/local/cuda,要求CUDA>=11.2 |
| TRT_DIRECTORY | Linux(x64)/Windows(x64) | 默认为空,要求TensorRT>=8.4, 指定路径如/Download/TensorRT-8.5 |
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
| ENABLE_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
| WITH_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |

第三方库依赖指定(不设定如下参数,会自动下载预编译库)
| 选项 | 说明 |
Expand Down Expand Up @@ -88,7 +88,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 ^
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" ^
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" ^
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
```
Expand Down
6 changes: 3 additions & 3 deletions docs/en/build_and_install/cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Please do not modify other cmake paramters exclude the following options.
| ENABLE_OPENVINO_BACKEND | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate OpenVINO backend |
| ENABLE_VISION | Linux(x64/aarch64)/Windows(x64)/Mac OSX(arm64/x86) | Default OFF, whether to intergrate vision models |
| ENABLE_TEXT | Linux(x64/aarch64)/Windows(x64)/Mac OSX(arm64/x86) | Default OFF, whether to intergrate text models |
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
| ENABLE_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
| WITH_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |

The configuration for third libraries(Optional, if the following option is not defined, the prebuilt third libraries will download automaticly while building FastDeploy).
| Option | Description |
Expand Down Expand Up @@ -70,7 +70,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 \
-DENABLE_OPENVINO_BACKEND=ON \
-DENABLE_VISION=ON \
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
```
Expand Down
6 changes: 3 additions & 3 deletions docs/en/build_and_install/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Please do not modify other cmake paramters exclude the following options.
| ENABLE_TEXT | Linux(x64/Windows(x64) | Default OFF, whether to intergrate text models |
| CUDA_DIRECTORY | Linux(x64/Windows(x64) | Default /usr/local/cuda,require CUDA>=11.2 |
| TRT_DIRECTORY | Linux(x64/Windows(x64) | Default empty,require TensorRT>=8.4, e.g. /Download/TensorRT-8.5 |
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
| ENABLE_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
| WITH_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |

The configuration for third libraries(Optional, if the following option is not defined, the prebuilt third libraries will download automaticly while building FastDeploy).
| Option | Description |
Expand Down Expand Up @@ -87,7 +87,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 \
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" \
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" \
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
```
Expand Down
1 change: 1 addition & 0 deletions tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ This directory provides some tutorials for FastDeploy. For other model deploymen
- Intel independent graphics card/integrated graphics card deployment [see intel_gpu](intel_gpu)
- Model multithreaded call [see multi_thread](multi_thread)
- Image decoding, including hardward decoding, e.g. nvJPEG [image_decoder](image_decoder)
- Deploy models with C or C# API [use_c_csharp_sdk](use_c_sharp_sdk)
1 change: 1 addition & 0 deletions tutorials/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
- Intel独立显卡/集成显卡部署 [见intel_gpu](intel_gpu)
- 模型多线程调用 [见multi_thread](multi_thread)
- 图片解码(含nvJPEG硬解码) [见image_decoder](image_decoder)
- 使用C或C# API进行模型部署 [见use_c_csharp_sdk](use_c_sharp_sdk)
8 changes: 8 additions & 0 deletions tutorials/use_c_csharp_sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
English | [中文](README_CN.md)

# Model Deployment with C or C# API

Fastdeploy provideds C and C# API to support deployment with multiple programming languages, and this feature is included since version 1.0.4. C API is compiled and included in fastdeploy dynamic library by default. If you want to compile fastdeploy with C and C# API manually, compile it with options -DWITH_CAPI=ON and -DWITH_CSHARPAPI=ON. For more information about how to use C and C# API to deploy models, please refer to

- [C API tutorial](../../c_api/README.md)
- [C# API tutorial](../../csharp/README.md)
10 changes: 10 additions & 0 deletions tutorials/use_c_csharp_sdk/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[English](README.md) | 中文


# 使用C或C# API进行模型部署

FastDeploy提供了C API以及C# API满足多语言部署的需求,这一特性从FastDeploy v1.0.4版本开始进行了支持。默认情况下,C API被编译进入了fastdeploy的动态库。
如果希望手动编译FastDeploy,并且集成C和C# API进去,只需要打开编译开关-DWITH_CAPI=ON, -DWITH_CSHARPAPI=ON。关于如何安装和使用C和C# API,可以参考下列文档:

- [C API指南](../../c_api/README_CN.md)
- [C# API指南](../../csharp/README_CN.md)

0 comments on commit 4ee783b

Please sign in to comment.