Files
FastDeploy/tools
Zheng_Bicheng 218f33f8b1 [RKNPU2] Add Quantized PPHumanSeg (#905)
* 更新rknpu2 backend核心代码

* 更新模型导出核心代码

* 删除无用的config文件

* 新增配置文件以及修改文档

* 模型转换以及文档

* 更新文档

* 更新与配置文件

* 更新PPHumanSeg全量化

* 更新文档

* 更新文档

* 更新文档
2022-12-19 20:07:32 +08:00
..
2022-12-13 11:53:36 +08:00

FastDeploy Toolkit

FastDeploy provides a series of efficient and easy-to-use tools to optimize the deployment experience and improve inference performance.

One-Click Model Auto Compression Tool

Based on PaddleSlim's Auto Compression Toolkit (ACT), FastDeploy provides users with a one-click model automation compression tool that allows users to easily compress the model with a single command. This document will take FastDeploy's one-click model automation compression tool as an example, introduce how to install the tool, and provide the corresponding documentation for usage.

Environmental Preparation

1.Install PaddlePaddle 2.4 version

https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html

2.Install PaddleSlim 2.4 version

pip install paddleslim==2.4.0

3.Install fastdeploy-tools package

# Installing fastdeploy-tools via pip
# This tool is included in the python installer of FastDeploy, so you don't need to install it again.
pip install fastdeploy-tools==0.0.1

The Usage of One-Click Model Auto Compression Tool

After the above steps are successfully installed, you can use FastDeploy one-click model automation compression tool, as shown in the following example.

fastdeploy compress --config_path=./configs/detection/yolov5s_quant.yaml --method='PTQ' --save_dir='./yolov5s_ptq_model/'

For detailed documentation, please refer to FastDeploy One-Click Model Auto Compression Tool

Model Conversion Tool

Based on X2Paddle, FastDeploy provides users with a model conversion tool. Users can easily migrate external framework models to the Paddle framework with one line of commands. Currently, ONNX, TensorFlow and Caffe are supported, and most mainstream CV and NLP model conversions are supported.

Environmental Preparation

  1. Install PaddlePaddle, refer to the following documents for quick installation
https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html
  1. Install X2Paddle

To use the stable version, install X2Paddle via pip:

pip install x2paddle

To experience the latest features, you can use the source installation method:

git clone https://github.com/PaddlePaddle/X2Paddle.git
cd X2Paddle
python setup.py install

How to use

After successful installation according to the above steps, you can use the FastDeploy one-click conversion tool. The example is as follows:

fastdeploy convert --framework onnx --model yolov5s.onnx --save_dir pd_model

For more details, please refer toX2Paddle