This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 演示系统示例
## 概述
所有示例通过 Python 接口实现下位机推理,前处理(数据标准化/归一化、通道变换)和反量化都已经加入网络中, 下位机推理结果返回PC端做后处理, 结果保存在模型工程目录下。提供源码地址、权重文件、nbg文件、测试图片。
- 依赖安装
```bash
pip install -r requirements.txt
```
## deeplab_mobilnet_v3
语义分割模型,源码地址为:<https://github.com/bubbliiiing/deeplabv3-plus-pytorch.git>
- 输入、输出信息
```text
INPUT:0
DATA_FORMAT:UINT8
NUM_OF_DIMENSION:4
SIZES_OF_DIMENSION:1536 512 1 1 0 0
QUANT_FORMAT:NONE
OUTPUT:0
DATA_FORMAT:FP32
NUM_OF_DIMENSION:4
SIZES_OF_DIMENSION:512 512 21 1 0 0
QUANT_FORMAT:NONE
```
- 后处理流程
- 概率转换
- 预测类别生成
- 尺寸还原
- 标签映射
- 执行
```bash
python demo_deeplabv3.py
```
- 结果保存在test_src/models/deeplab_mobilnet_v3/result.jpg

## yolov5s-seg
实例分割模型,源码地址:<https://github.com/ultralytics/yolov5.git>
- 输入、输出信息
```text
INPUT:0
DATA_FORMAT:UINT8
NUM_OF_DIMENSION:4
SIZES_OF_DIMENSION:1920 640 1 1 0 0
QUANT_FORMAT:NONE
OUTPUT:0
DATA_FORMAT:FP32
NUM_OF_DIMENSION:3
SIZES_OF_DIMENSION:117 25200 1 0 0 0
QUANT_FORMAT:NONE
OUTPUT:1
DATA_FORMAT:FP32
NUM_OF_DIMENSION:4
SIZES_OF_DIMENSION:160 160 32 1 0 0
QUANT_FORMAT:NONE
```
- 后处理流程
- NMS
- 遍历检测预测
- 颜色和掩码可视化
- 掩码叠加
- 绘制检测框和文本标签
- 执行
```bash
python demo_yolov5s_seg.py
```
- 结果保存在/yolov5s-seg/result.jpg

## resnet18
分类模型,源码地址:<https://github.com/ultralytics/yolov5.git>
- 输入、输出信息
```text
INPUT:0
DATA_FORMAT:UINT8
NUM_OF_DIMENSION:4
SIZES_OF_DIMENSION:672 224 1 1 0 0
QUANT_FORMAT:NONE
OUTPUT:0
DATA_FORMAT:FP32
NUM_OF_DIMENSION:2
SIZES_OF_DIMENSION:1000 1 0 0 0 0
QUANT_FORMAT:NONE
```
- 后处理流程
- softmax
- topk
- 执行
```bash
python demo_resnet18.py
```
- 结果保存在/resnet18/result.jpg

> *作者 {{liangliangou}}*