mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 09:07:10 +08:00
[Tutorial Doc] add tutorial for how to use c and c sharp api (#1392)
* add tutorialfor how to use c and c sharp api * update english doc * update doc * update doc * update doc * update doc * update doc
This commit is contained in:
@@ -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.
|
This directory is the implementation of FastDeploy C SDK, which provides solutions for scenarios where users need C API.
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# C API实现
|
# C API指南
|
||||||
|
|
||||||
该目录下为FastDeploy C SDK的接口实现,为用户需要C API的场景提供解决方案。
|
该目录下为FastDeploy C SDK的接口实现,为用户需要C API的场景提供解决方案。
|
||||||
|
|
||||||
|
@@ -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.
|
This directory is the implementation of FastDeploy C# SDK, which provides solutions for scenarios where users need C# API.
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# C# API实现
|
# C# API指南
|
||||||
|
|
||||||
该目录下为FastDeploy C# SDK的接口实现,为用户需要C# API的场景提供解决方案。
|
该目录下为FastDeploy C# SDK的接口实现,为用户需要C# API的场景提供解决方案。
|
||||||
|
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
| ENABLE_OPENVINO_BACKEND | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成OpenVINO后端 |
|
| ENABLE_OPENVINO_BACKEND | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成OpenVINO后端 |
|
||||||
| ENABLE_VISION | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成视觉模型的部署模块 |
|
| ENABLE_VISION | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成视觉模型的部署模块 |
|
||||||
| ENABLE_TEXT | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
|
| ENABLE_TEXT | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
|
||||||
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
|
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
|
||||||
| ENABLE_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
|
| WITH_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
|
||||||
|
|
||||||
第三方库依赖指定(不设定如下参数,会自动下载预编译库)
|
第三方库依赖指定(不设定如下参数,会自动下载预编译库)
|
||||||
| 选项 | 说明 |
|
| 选项 | 说明 |
|
||||||
@@ -70,7 +70,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 ^
|
|||||||
-DENABLE_VISION=ON ^
|
-DENABLE_VISION=ON ^
|
||||||
-DENABLE_TEXT=ON ^
|
-DENABLE_TEXT=ON ^
|
||||||
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
|
-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 fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
|
||||||
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
||||||
```
|
```
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
| ENABLE_TEXT | Linux(x64)/Windows(x64) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
|
| ENABLE_TEXT | Linux(x64)/Windows(x64) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
|
||||||
| CUDA_DIRECTORY | Linux(x64)/Windows(x64) | 默认/usr/local/cuda,要求CUDA>=11.2 |
|
| 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 |
|
| 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 |
|
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
|
||||||
| ENABLE_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
|
| WITH_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
|
||||||
|
|
||||||
第三方库依赖指定(不设定如下参数,会自动下载预编译库)
|
第三方库依赖指定(不设定如下参数,会自动下载预编译库)
|
||||||
| 选项 | 说明 |
|
| 选项 | 说明 |
|
||||||
@@ -88,7 +88,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 ^
|
|||||||
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" ^
|
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" ^
|
||||||
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" ^
|
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" ^
|
||||||
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
|
-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 fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
|
||||||
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
||||||
```
|
```
|
||||||
|
@@ -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_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_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_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 |
|
| WITH_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_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).
|
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 |
|
| Option | Description |
|
||||||
@@ -70,7 +70,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 \
|
|||||||
-DENABLE_OPENVINO_BACKEND=ON \
|
-DENABLE_OPENVINO_BACKEND=ON \
|
||||||
-DENABLE_VISION=ON \
|
-DENABLE_VISION=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
|
-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 fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
|
||||||
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
||||||
```
|
```
|
||||||
|
@@ -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 |
|
| 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 |
|
| 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 |
|
| 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 |
|
| WITH_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_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).
|
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 |
|
| Option | Description |
|
||||||
@@ -87,7 +87,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 \
|
|||||||
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" \
|
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" \
|
||||||
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" \
|
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" \
|
||||||
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
|
-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 fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
|
||||||
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
|
||||||
```
|
```
|
||||||
|
@@ -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)
|
- Intel independent graphics card/integrated graphics card deployment [see intel_gpu](intel_gpu)
|
||||||
- Model multithreaded call [see multi_thread](multi_thread)
|
- Model multithreaded call [see multi_thread](multi_thread)
|
||||||
- Image decoding, including hardward decoding, e.g. nvJPEG [image_decoder](image_decoder)
|
- 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)
|
||||||
|
@@ -8,3 +8,4 @@
|
|||||||
- Intel独立显卡/集成显卡部署 [见intel_gpu](intel_gpu)
|
- Intel独立显卡/集成显卡部署 [见intel_gpu](intel_gpu)
|
||||||
- 模型多线程调用 [见multi_thread](multi_thread)
|
- 模型多线程调用 [见multi_thread](multi_thread)
|
||||||
- 图片解码(含nvJPEG硬解码) [见image_decoder](image_decoder)
|
- 图片解码(含nvJPEG硬解码) [见image_decoder](image_decoder)
|
||||||
|
- 使用C或C# API进行模型部署 [见use_c_csharp_sdk](use_c_sharp_sdk)
|
||||||
|
8
tutorials/use_c_csharp_sdk/README.md
Normal file
8
tutorials/use_c_csharp_sdk/README.md
Normal file
@@ -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
tutorials/use_c_csharp_sdk/README_CN.md
Normal file
10
tutorials/use_c_csharp_sdk/README_CN.md
Normal file
@@ -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)
|
Reference in New Issue
Block a user