Skip to content

Commit 4ee783b

Browse files
authored
[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
1 parent c8bcada commit 4ee783b

File tree

12 files changed

+36
-16
lines changed

12 files changed

+36
-16
lines changed

c_api/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# C API implementation
1+
# C API tutorial
22

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

c_api/README_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# C API实现
1+
# C API指南
22

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

csharp/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# C# API implementation
1+
# C# API tutorial
22

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

csharp/README_CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# C# API实现
1+
# C# API指南
22

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

docs/cn/build_and_install/cpu.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
| ENABLE_OPENVINO_BACKEND | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成OpenVINO后端 |
1313
| ENABLE_VISION | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成视觉模型的部署模块 |
1414
| ENABLE_TEXT | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
15-
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
16-
| ENABLE_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
15+
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
16+
| WITH_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
1717

1818
第三方库依赖指定(不设定如下参数,会自动下载预编译库)
1919
| 选项 | 说明 |
@@ -70,7 +70,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 ^
7070
-DENABLE_VISION=ON ^
7171
-DENABLE_TEXT=ON ^
7272
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
73-
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
73+
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
7474
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
7575
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
7676
```

docs/cn/build_and_install/gpu.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
| ENABLE_TEXT | Linux(x64)/Windows(x64) | 默认OFF,是否编译集成文本NLP模型的部署模块 |
1717
| CUDA_DIRECTORY | Linux(x64)/Windows(x64) | 默认/usr/local/cuda,要求CUDA>=11.2 |
1818
| TRT_DIRECTORY | Linux(x64)/Windows(x64) | 默认为空,要求TensorRT>=8.4, 指定路径如/Download/TensorRT-8.5 |
19-
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
20-
| ENABLE_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
19+
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | 默认OFF,是否编译集成C API |
20+
| WITH_CSHARPAPI | Windows(x64) | 默认OFF,是否编译集成C# API |
2121

2222
第三方库依赖指定(不设定如下参数,会自动下载预编译库)
2323
| 选项 | 说明 |
@@ -88,7 +88,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 ^
8888
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" ^
8989
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" ^
9090
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
91-
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
91+
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
9292
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
9393
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
9494
```

docs/en/build_and_install/cpu.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Please do not modify other cmake paramters exclude the following options.
1313
| ENABLE_OPENVINO_BACKEND | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate OpenVINO backend |
1414
| ENABLE_VISION | Linux(x64/aarch64)/Windows(x64)/Mac OSX(arm64/x86) | Default OFF, whether to intergrate vision models |
1515
| ENABLE_TEXT | Linux(x64/aarch64)/Windows(x64)/Mac OSX(arm64/x86) | Default OFF, whether to intergrate text models |
16-
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
17-
| ENABLE_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |
16+
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
17+
| WITH_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |
1818

1919
The configuration for third libraries(Optional, if the following option is not defined, the prebuilt third libraries will download automaticly while building FastDeploy).
2020
| Option | Description |
@@ -70,7 +70,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 \
7070
-DENABLE_OPENVINO_BACKEND=ON \
7171
-DENABLE_VISION=ON \
7272
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
73-
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
73+
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
7474
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
7575
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
7676
```

docs/en/build_and_install/gpu.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ Please do not modify other cmake paramters exclude the following options.
1616
| ENABLE_TEXT | Linux(x64/Windows(x64) | Default OFF, whether to intergrate text models |
1717
| CUDA_DIRECTORY | Linux(x64/Windows(x64) | Default /usr/local/cuda,require CUDA>=11.2 |
1818
| TRT_DIRECTORY | Linux(x64/Windows(x64) | Default empty,require TensorRT>=8.4, e.g. /Download/TensorRT-8.5 |
19-
| ENABLE_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
20-
| ENABLE_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |
19+
| WITH_CAPI | Linux(x64)/Windows(x64)/Mac OSX(x86) | Default OFF, whether to intergrate C API |
20+
| WITH_CSHARPAPI | Windows(x64) | Default OFF, whether to intergrate C# API |
2121

2222
The configuration for third libraries(Optional, if the following option is not defined, the prebuilt third libraries will download automaticly while building FastDeploy).
2323
| Option | Description |
@@ -87,7 +87,7 @@ cmake .. -G "Visual Studio 16 2019" -A x64 \
8787
-DTRT_DIRECTORY="D:\Paddle\TensorRT-8.4.1.5" \
8888
-DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2" \
8989
-DCMAKE_INSTALL_PREFIX="D:\Paddle\compiled_fastdeploy"
90-
% nuget restore (please execute it when ENABLE_CSHARPAPI to prepare dependencies in C#)
90+
% nuget restore (please execute it when WITH_CSHARPAPI=ON to prepare dependencies in C#)
9191
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
9292
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
9393
```

tutorials/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ This directory provides some tutorials for FastDeploy. For other model deploymen
77
- Intel independent graphics card/integrated graphics card deployment [see intel_gpu](intel_gpu)
88
- Model multithreaded call [see multi_thread](multi_thread)
99
- Image decoding, including hardward decoding, e.g. nvJPEG [image_decoder](image_decoder)
10+
- Deploy models with C or C# API [use_c_csharp_sdk](use_c_sharp_sdk)

tutorials/README_CN.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
- Intel独立显卡/集成显卡部署 [见intel_gpu](intel_gpu)
99
- 模型多线程调用 [见multi_thread](multi_thread)
1010
- 图片解码(含nvJPEG硬解码) [见image_decoder](image_decoder)
11+
- 使用C或C# API进行模型部署 [见use_c_csharp_sdk](use_c_sharp_sdk)

tutorials/use_c_csharp_sdk/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
English | [中文](README_CN.md)
2+
3+
# Model Deployment with C or C# API
4+
5+
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
6+
7+
- [C API tutorial](../../c_api/README.md)
8+
- [C# API tutorial](../../csharp/README.md)
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[English](README.md) | 中文
2+
3+
4+
# 使用C或C# API进行模型部署
5+
6+
FastDeploy提供了C API以及C# API满足多语言部署的需求,这一特性从FastDeploy v1.0.4版本开始进行了支持。默认情况下,C API被编译进入了fastdeploy的动态库。
7+
如果希望手动编译FastDeploy,并且集成C和C# API进去,只需要打开编译开关-DWITH_CAPI=ON, -DWITH_CSHARPAPI=ON。关于如何安装和使用C和C# API,可以参考下列文档:
8+
9+
- [C API指南](../../c_api/README_CN.md)
10+
- [C# API指南](../../csharp/README_CN.md)

0 commit comments

Comments
 (0)