Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/aicore/dx-m1/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ sidebar_position: 15

## DX-M1 SDK

- [dx_com_M1_v1.60.1](https://dl.radxa.com/aicore/dx_m1/dx_com_M1_v1.60.1.tar.gz)
- [DX_Tron_v0.0.8](https://dl.radxa.com/aicore/dx_m1/sdk/DX_Tron_v0.0.8.zip)
**DX-COM**

- [dx_com_M1_v2.1.0](https://dl.radxa.com/aicore/dx_m1/sdk/dx_com_M1_v2.1.0.tar.gz)

**DX-Tron**

- [**Linux:** DXTron-2.0.0.AppImage](https://dl.radxa.com/aicore/dx_m1/sdk/DXTron-2.0.0.AppImage)
- [**Windows:** DXTron Setup 2.0.0.exe](https://dl.radxa.com/aicore/dx_m1/sdk/DXTron%20Setup%202.0.0.exe)

## 参考文档

Expand Down
461 changes: 200 additions & 261 deletions docs/aicore/dx-m1/dx-sdk/dx-app.md

Large diffs are not rendered by default.

171 changes: 170 additions & 1 deletion docs/aicore/dx-m1/dx-sdk/dx-com.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sudo apt-get install -y --no-install-recommends libgl1-mesa-glx libglib2.0-0 mak
<NewCodeBlock tip="X86 PC" type="PC">

```bash
tar -xvf dx_com_M1_v1.60.1.tar.gz
tar -xvf dx_com_M1_v2.1.0.tar.gz
```

</NewCodeBlock>
Expand Down Expand Up @@ -287,6 +287,124 @@ DXQ-P3、DXQ-P4、DXQ-P5 虽然参数相同,但使用的是**不同的微调
| DXQ-P4 | 非常慢 | 高 |
| DXQ-P5 | 非常慢 | 高 |

### PPU 后处理加速

PPU (Post-Processing Unit) 是为目标检测模型提供硬件加速的后处理功能。如目标模型是 YOLO 系列的模型架构,可以在模型编译配置文件中加入 PPU 配置参数。

#### 支持 PPU 类型

支持 PPU 的目标检测模型架构有两种

- **Type 0 (Anchor-Based YOLO)**

专为使用锚框的模型而设计,例如 YOLOv3、YOLOv4、 YOLOv5 和 YOLOv7。

- **Type 1 (Anchor-Free YOLO)**

专为无锚模型设计,例如 YOLOX。

#### 判断可使用 PPU 的 ONNX 模型节点

<Tabs queryString="backend">

<TabItem value="Type 0">


从模型输出反向确认,找到 `Conv` 输出形状为 [1, num_anchors*(5+num_classes), H, W] 的输出头。这些 Conv 之后通常会进行`reshape`、`permute`和其他后处理操作。

这里以 [yolo5s.onnx](https://github.com/ultralytics/yolov5/releases/download/v6.0/yolov5s.onnx) 为例子, yolov5s 的 num_anchors 为 3, num_classes 为 80, 这里要找的是 [1, 255, H, W] 特征的 Conv 节点,
从模型输出反向寻找,可以确定这三个 `Conv` 节点位置,分别为 `Conv_196`、 `Conv_308`、 `Conv_420`, 将这个三个 `Conv` 节点名称配置到模型编译配置文件中的 PPU 部分。

<div style={{textAlign: 'center'}}>
<img src="/img/aicore-dx-m1/ppu-type0.webp"/>
Yolov5s PPU Conv node
</div>

```json
'''
"ppu": {
"type":0,
"conf_thres":0.25,
"activation": "Sigmoid",
"num_classes": 80,
"layer": {
"Conv_196": {
"num_anchors": 3
},
"Conv_308": {
"num_anchors": 3
},
"Conv_420": {
"num_anchors": 3
}
}
},
'''
```

</TabItem>

<TabItem value="Type 1">

从模型输出反向确认,针对每个检测大小,找到三种类型的 `Conv` 节点。分别为 `bbox`, `obj_conf`, `cls_conf`

- `bbox` 输出边界框回归值的卷积层 [1,4,H,W]

- `obj_conf` 输出目标置信度分数的卷积层 [1,1,H,W]

- `cls_conf` 输出类别预测分数的卷积层 [1,80,HW]

这里以 [YOLOXS-1.onnx](https://sdk.deepx.ai/modelzoo/onnx/YOLOXS-1.onnx) 为例子, YOLOXS 有三种 scale, 这里要找的是 `bbox`, `obj_conf`, `cls_conf` 一共九个 `Conv` 节点,
从模型输出反向寻找,可以确定这9个 `Conv` 节点位置,分别为以下 9 个 `Conv` 节点, 将这 9 个节点名称配置到模型编译配置文件中的 PPU 部分。

<div style={{textAlign: 'center'}}>
<img src="/img/aicore-dx-m1/ppu-type1.webp"/>
Yolov5s PPU Conv node
</div>

```json
'''
"ppu": {
"type":1,
"conf_thres":0.25,
"num_classes": 80,
"layer": [
{
"bbox": "Conv_261",
"obj_conf": "Conv_262",
"cls_conf": "Conv_254"
},
{
"bbox": "Conv_282",
"obj_conf": "Conv_283",
"cls_conf": "Conv_275"
},
{
"bbox": "Conv_303",
"obj_conf": "Conv_304",
"cls_conf": "Conv_296"
}
]
},
'''
```

</TabItem>

</Tabs>

#### 参数说明

| 参数名 | 类型 | 说明 |
| ---------------- | ------ | --------------------------------------------------------------------------------- |
| `type` | int | 模型类型标识。设置为 `1` 表示 **Anchor-Free YOLO 模型** |
| `conf_thres` | float | 检测结果过滤的置信度阈值。<br/>**注意:该值在模型编译阶段固定,运行时不可修改。** |
| `num_classes` | int | 模型支持的检测类别数量 |
| `layer` | list | 检测层配置列表,每个元素对应一个检测头,包含以下字段: |
| `layer.bbox` | string | 输出**边界框坐标(Bounding Box)**的层名称 |
| `layer.obj_conf` | string | 输出**目标置信度(Object Confidence)**的层名称 |
| `layer.cls_conf` | string | 输出**分类置信度(Class Confidence)**的层名称 |

### 执行模型编译

当完成模型配置文件后使用以下命令进行模型编译
Expand All @@ -305,6 +423,10 @@ dx_com -m <MODEL_PATH> -c <CONFIG_PATH> -o <OUTPUT_DIR>

#### 编译例子

:::tip
dx-com 下的 `sample` 目录下有多个模型的编译配置文件例子
:::

<NewCodeBlock tip="X86 PC" type="PC">

```bash
Expand All @@ -328,3 +450,50 @@ $./dx_com/dx_com \
:::

编译成功后 dxnn 格式模型保存在 output/mobilenetv1 文件夹中。

## DX-COM 文档构建

:::tip
更多关于 DX-COM 的使用方法,请构建详细文档查阅
:::

### 克隆 DX-ALL-SUITE 仓库

:::tip
请按照 [DX-ALL-SUITE](./dx-sdk-introduction#dx-all-suite) 克隆指定版本的 DX-ALL-SUITE 仓库
:::

### 安装 MkDocs

<NewCodeBlock tip="Host" type="device">

```bash
pip install mkdocs mkdocs-material mkdocs-video pymdown-extensions mkdocs-with-pdf markdown-grid-tables
```

</NewCodeBlock>

### 构建文档

<NewCodeBlock tip="Host" type="device">

```bash
cd dx-all-suite/dx-compiler
mkdocs build
```

</NewCodeBlock>

构建完成后会在当前目录下生成 `DEEPX_DX-COM_UM_v2.1.0_Nov_2025.pdf`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated PDF filename DEEPX_DX-COM_UM_v2.1.0_Nov_2025.pdf references November 2025, which is a future date. This appears to be a typo and should likely be corrected to the current year.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this filename is correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated PDF filename includes Nov_2025 which appears to be a future date. This might be a typo or placeholder that should be updated to the current year.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is correct

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated PDF filename shows a future date: DEEPX_DX-COM_UM_v2.1.0_Nov_2025.pdf. This appears to be incorrect as it references the year 2025. Please update this to the current year or remove the specific date if it's meant to be a placeholder.


### 启动文档服务

可以使用浏览器访问网页文档

<NewCodeBlock tip="Host" type="device">

```bash
mkdocs serve
```

</NewCodeBlock>
73 changes: 50 additions & 23 deletions docs/aicore/dx-m1/dx-sdk/dx-model-zoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 7

## DX Model Link

链接: [**DX Model Zoo**](https://developer.deepx.ai/wp-content/modelzoo/model_zoo_fin.html)
链接: [**DX Model Zoo**](https://developer.deepx.ai/wp-content/modelzoo/modelzoo_v2.0.0.html)

<div style={{textAlign: 'center'}}>
<img src="/img/aicore-dx-m1/dx-model-zoo.webp"/>
Expand All @@ -18,6 +18,10 @@ sidebar_position: 7

## 安装方法

:::info
DX-Model-Zoo 仅支持在 X86 Ubuntu 20.04 LTS or 22.04 LTS 上使用
:::

### 克隆 DX-ALL-SUITE 仓库

:::tip
Expand All @@ -26,20 +30,22 @@ sidebar_position: 7

### 安装 DXMZ (Deepx Model Zoo)

#### 手动安装

进入 `dx-all-suite/dx-modelzoo` 目录

<NewCodeBlock tip="Host" type="device">
<NewCodeBlock tip="X86 Ubuntu PC" type="PC">

```bash
cd dx-all-suite/dx-modelzoo
./setup.sh
./install.sh
```

</NewCodeBlock>

安装完成后会在当前路径下生成 `./venv-dx-modelzoo-local` 虚拟环境,

<NewCodeBlock tip="Host" type="device">
<NewCodeBlock tip="X86 Ubuntu PC" type="PC">

```bash
source ./venv-dx-modelzoo-local/bin/activate
Expand All @@ -59,24 +65,14 @@ dxmz models

描述: 用于列出 Deepx Model Zoo 上的模型列表

<NewCodeBlock tip="Host" type="device">
<NewCodeBlock tip="X86 Ubuntu PC" type="PC">

```bash
dxmz models
```

</NewCodeBlock>

```bash
(venv-dx-modelzoo-local) rock@rock-5b-plus:~/ssd/deepx/dx_rt_SDK_v2.9.5/dx-all-suite/dx-modelzoo$ dxmz models
/mnt/ssd/deepx/dx_rt_SDK_v2.9.5/dx-all-suite/dx-modelzoo/venv-dx-modelzoo-local/lib/python3.11/site-packages/pydantic_settings/main.py:426: UserWarning: Config key `pyproject_toml_table_header` is set in model_config but will be ignored because no PyprojectTomlConfigSettingsSource source is configured. To use this config key, add a PyprojectTomlConfigSettingsSource source to the settings sources via the settings_customise_sources hook.
self._settings_warn_unused_config_keys(sources, self.model_config)
/mnt/ssd/deepx/dx_rt_SDK_v2.9.5/dx-all-suite/dx-modelzoo/venv-dx-modelzoo-local/lib/python3.11/site-packages/pydantic_settings/main.py:426: UserWarning: Config key `toml_file` is set in model_config but will be ignored because no TomlConfigSettingsSource source is configured. To use this config key, add a TomlConfigSettingsSource source to the settings sources via the settings_customise_sources hook.
self._settings_warn_unused_config_keys(sources, self.model_config)
Available Model List:
['AlexNet', 'BiSeNetV1', 'BiSeNetV2', 'DeepLabV3PlusDRN', 'DeepLabV3PlusMobileNetV2', 'DeepLabV3PlusMobilenet', 'DeepLabV3PlusResNet101', 'DeepLabV3PlusResNet50', 'DeepLabV3PlusResnet', 'DenseNet121', 'DenseNet161', 'DnCNN_15', 'DnCNN_25', 'DnCNN_50', 'EfficientNetB2', 'EfficientNetV2S', 'HarDNet39DS', 'MobileNetV1', 'MobileNetV2', 'MobileNetV3Large', 'MobileNetV3Small', 'OSNet0_25', 'OSNet0_5', 'RegNetX400MF', 'RegNetX800MF', 'RegNetY200MF', 'RegNetY400MF', 'RegNetY800MF', 'RepVGGA1', 'ResNeXt26_32x4d', 'ResNeXt50_32x4d', 'ResNet101', 'ResNet152', 'ResNet18', 'ResNet34', 'ResNet50', 'SSDMV1', 'SSDMV2Lite', 'SqueezeNet1_0', 'SqueezeNet1_1', 'VGG11', 'VGG11BN', 'VGG13', 'VGG13BN', 'VGG19BN', 'WideResNet101_2', 'WideResNet50_2', 'YOLOv5m_Face', 'YOLOv5s_Face', 'YOLOv7_Face', 'YOLOv7_TTA_Face', 'YOLOv7_W6_Face', 'YOLOv7_W6_TTA_Face', 'YOLOv7s_Face', 'YoloV3', 'YoloV5L', 'YoloV5M', 'YoloV5N', 'YoloV5S', 'YoloV7', 'YoloV7E6', 'YoloV7Tiny', 'YoloV8L', 'YoloV8M', 'YoloV8N', 'YoloV8S', 'YoloV8X', 'YoloV9C', 'YoloV9S', 'YoloV9T', 'YoloXS']
```

### 模型准确率评估

命令:
Expand All @@ -100,12 +96,43 @@ dxmz eval <Model Name> --dxnn <dxnn file path> --data_dir <dataset root dir path
dxmz eval ResNet18 --dxnn ./ResNet18.dxnn --data_dir ./datasets/ILSVRC2012/val
```

## 数据集下载
## DX-Model-Zoo 文档构建

:::tip
更多关于 DX-Model-Zoo 的使用方法,请构建详细文档查阅
:::

### 安装 MkDocs

<NewCodeBlock tip="X86 Ubuntu PC" type="PC">

```bash
pip install mkdocs mkdocs-material mkdocs-video pymdown-extensions mkdocs-with-pdf markdown-grid-tables
```

</NewCodeBlock>

- [**ImageNet**](http://www.image-net.org/challenges/LSVRC/2012/nnoupb/ILSVRC2012_img_val.tar)
- [**COCO2017**](http://images.cocodataset.org/zips/val2017.zip)
- [**PascalVOC - VOC2007**](http://host.robots.ox.ac.uk/pascal/VOC/voc2007/index.html)
- [**PascalVOC - VOC2012**](http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit)
- [**Cityscapes**](https://www.cityscapes-dataset.com/)
- [**WiderFace**](http://shuoyang1213.me/WIDERFACE/)
- [**BSD68**](https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/)
### 构建文档

<NewCodeBlock tip="X86 Ubuntu PC" type="PC">

```bash
cd docs
mkdocs build
```

</NewCodeBlock>

构建完成后会在 `output_web` 生成 `dx-modelzoo_v0.1.0.pdf`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document mentions generating a PDF file named dx-modelzoo_v0.1.0.pdf (line 126), but the PR is upgrading to SDK v2.1.0. Should the PDF version number be updated to match the SDK version for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is correct


### 启动文档服务

可以使用浏览器访问网页文档

<NewCodeBlock tip="X86 Ubuntu PC" type="PC">

```bash
mkdocs serve
```

</NewCodeBlock>
Loading
Loading