Skip to content

Commit e05319f

Browse files
committed
add cvcuda; Tensor2Vector
1 parent 3dc2bbb commit e05319f

File tree

7 files changed

+79
-5
lines changed

7 files changed

+79
-5
lines changed

docs/backend-reference/cvcuda.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
id: CVCUDA
3+
title: CVCUDA-related Backends
4+
type: reference
5+
displayed_sidebar: api
6+
7+
---
8+
9+
<!-- [The following compilation option](../installation.mdx#compilation-options) need to be enabled to use the following backends.
10+
11+
`version>=0.3.3b2`
12+
13+
```bash
14+
BUILD_PPLCV=1 pip install -e .
15+
```
16+
## Overview
17+
18+
| Name| Main Initialization Parameters |Runtime Parameters[Type] | Input[Type] | Output[Type] | Note|
19+
| --- | --- | --- | --- | --- | --- |
20+
|[PPLResizeTensor]|resize_h,resize_w | resize_h[int],resize_w[int]|data[Tensor]|result[Tensor]||
21+
|[PPLWarpAffineTensor]|target_h,target_w|target_h[int],target_w[int],affine_matrix[vector\<float\>]|data[Tensor]|result[Tensor]|affine_matrix.size() == 6|
22+
|[PPLCopyMakeBorderTensor]||top[int],bottom[int],left[int],right[int]|data[Tensor]|result[Tensor]|| -->
23+
24+

docs/backend-reference/torch.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ displayed_sidebar: api
1616
| [PillowResizeTensor](#pillowresizetensor) | resize_h,resize_w | data[at::Tensor] | result[at::Tensor] | CV_8UC3 |
1717
| [ResizePadTensor](#resizepadtensor) | max_h,max_w,pad_value | data[at::Tensor] | - result[at::Tensor]<br />- inverse_trans<br />[std::function<std::pair<float, float>(float x, float y)>] | |
1818
| [TensorrtTensor](#tensorrttensor) | `model`,`instance_num`,<br />`max`,`precision`,<br />`mean`,`std`,`model::cache` | | | TensorRT inference engine |
19-
| [Tensor2Mat](#tensor2mat) | | data[at::Tensor] | result[cv::Mat] | |
19+
| [Tensor2Mat](#tensor2mat) | | data[at::Tensor] | result[cv::Mat] |
20+
| [Tensor2Vector](#tensor2vector) | | data[at::Tensor] | result[std::vector] | |
2021
| [SyncTensor](#synctensor) | `SyncTensor::backend` | data[at::Tensor] | result[at::Tensor] | CUDA Stream Synchronization Facility |
2122
| [Torch](#torch) | `device_id` `Torch::backend` | data[at::Tensor] | result[at::Tensor] | |
2223
| [SaveTensor](#savetensor) | save_dir | data[at::Tensor] | result[at::Tensor] | |
@@ -63,6 +64,15 @@ Please insert stream management operations:
6364
otherwise `Tensor2Mat` will use the default CUDA stream.
6465
:::
6566

67+
## Tensor2Vector
68+
- Convert `at::Tensor` to `std::vector` while keeping the data type unchanged (>=v0.4.1, currently only supports float)
69+
- Input shape: hw3 or 13hw
70+
- Similar to [SyncTensor](#SyncTensor), it will synchronize the current stream.
71+
:::caution
72+
Please insert stream management operations:
73+
`Sequential[Tensor2Vector,SyncTensor]` or `SyncTensor[Tensor2Vector`,
74+
otherwise `Tensor2Vector` will use the default CUDA stream.
75+
:::
6676

6777

6878
## SyncTensor

docs/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Base images compiled in this way have smaller sizes than NGC PyTorch images. Ple
162162
| Option | Default | Description |
163163
|--------------------|:-------:|:---------------------------------------------------------------------------------------:|
164164
| DEBUG | 0 | Whether to compile in debug mode |
165-
| WITH_OPENCV | 1 | Whether to compile the C++ backend that depends on OpenCV;It's invalid now, don't change it. |
165+
|WITH_CVCUDA| 0| Whether to compile the C++ backend that depends on CVCUDA(>=0.4.0)|
166166
| BUILD_PPLCV | 0 | Whether to compile the C++ backend that depends on ppl.cv(>=0.3.3b2)|
167167
| IPIPE_KEY(optinal) | None | str(length>=8). If using encryption and decryption functions, this key needs to be set. |
168168

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
id: CVCUDA
3+
title: CVCUDA相关后端
4+
type: reference
5+
displayed_sidebar: api
6+
7+
---
8+
<!--
9+
# Ppl.cv相关后端
10+
11+
`version>=0.3.3b2`
12+
13+
需要编译时启动[相关选项](../installation.mdx#compilation-options)
14+
15+
```bash
16+
BUILD_PPLCV=1 pip install -e .
17+
```
18+
## 速览
19+
20+
| 名称| 主要初始化参数 |运行时参数[类型] | 输入[类型] | 输出[类型] | 备注|
21+
| --- | --- | --- | --- | --- | --- |
22+
|[PPLResizeTensor]|resize_h,resize_w | resize_h[int],resize_w[int]|data[Tensor]|result[Tensor]||
23+
|[PPLWarpAffineTensor]|target_h,target_w|target_h[int],target_w[int],affine_matrix[vector\<float\>]|data[Tensor]|result[Tensor]|affine_matrix.size() == 6|
24+
|[PPLCopyMakeBorderTensor]||top[int],bottom[int],left[int],right[int]|data[Tensor]|result[Tensor]||
25+
26+
-->

i18n/zh/docusaurus-plugin-content-docs/current/backend-reference/torch.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ displayed_sidebar: api
2020
| [ResizePadTensor](#resizepadtensor) | max_h,max_w,pad_value | data[at::Tensor] | - result[at::Tensor]<br />- inverse_trans<br />[std::function<std::pair<float, float>(float x, float y)>] | |
2121
| [TensorrtTensor](#tensorrttensor) | `model`,`instance_num`,<br />`max`,`precision`,<br />`mean`,`std`,`model::cache` | | | tensorrt推理引擎 |
2222
| [Tensor2Mat](#tensor2mat) | | data[at::Tensor] | result[cv::Mat] | |
23+
| [Tensor2Vector](#tensor2vector) | | data[at::Tensor] | result[std::vector] | |
2324
| [SyncTensor](#synctensor) | `SyncTensor::backend` | data[at::Tensor] | result[at::Tensor] | CUDA流同步设施 |
2425
| [Torch](#torch) | `device_id` `Torch::backend` | data[at::Tensor] | result[at::Tensor] | |
2526
| [SaveTensor](#savetensor) | save_dir | data[at::Tensor] | result[at::Tensor] | |
@@ -68,6 +69,16 @@ displayed_sidebar: api
6869
否则`Tensor2Mat`将使用默认cuda流。
6970
:::
7071

72+
## Tensor2Vector
73+
-`at::Tensor`转为`std::vector`,保持数据类型不变(>=v0.4.1, 目前仅仅支持float)
74+
- 输入形状hw3或者13hw
75+
- 类似于[SyncTensor](#SyncTensor), 会同步当前流
76+
:::caution
77+
请插入流管理操作:
78+
`Sequential[Tensor2Vector,SyncTensor]` 或者`SyncTensor[Tensor2Vector]`
79+
否则`Tensor2Vector`将使用默认cuda流。
80+
:::
81+
7182
## SyncTensor
7283

7384
- SyncTensor::backend: default=Identity

i18n/zh/docusaurus-plugin-content-docs/current/installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ print(input["result"].shape) # 失败则此键值一定不存在,即使输入
153153
| 选项 | 默认值 | 说明 |
154154
|--------------------|:------:|:--------------------------------------------:|
155155
| DEBUG | 0 | 是否编译为调试模式 |
156-
| WITH_OPENCV | 1 | 是否编译依赖opencv的c++后端;暂时失效了,不要改动它 |
156+
| WITH_CVCUDA | 0 | 是否编译依赖CVCUDA的c++后端(`version>=0.4.0`) |
157157
| BUILD_PPLCV | 0 | 是否编译依赖ppl.cv的c++后端 (`version>=0.3.3b2`) |
158158
| IPIPE_KEY(optinal) || str(length>=8),使用加解密功能时,需要设置此密钥 |
159159

sidebars.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ const sidebars = {
2121
// But you can create a sidebar manually
2222
main: [
2323
"welcome",
24+
"introduction",
25+
"installation",
2426
{
2527
type: "category",
2628
label: "Quick Start",
2729
items: [
28-
"installation",
30+
2931
"quick_start_new_user",
3032
//"quick_start_professional",
3133
{
@@ -49,7 +51,7 @@ const sidebars = {
4951
},
5052
},
5153

52-
"introduction",
54+
5355
{
5456
type: "category",
5557
label: "2. Preliminary",
@@ -165,6 +167,7 @@ const sidebars = {
165167
"backend-reference/opencv",
166168
"backend-reference/torch",
167169
"backend-reference/Ppl.cv",
170+
"backend-reference/CVCUDA",
168171
"backend-reference/log"],
169172
},
170173

0 commit comments

Comments
 (0)