1 Star 0 Fork 35

CpDec/FastDeploy

forked from PaddlePaddle/FastDeploy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

FastDeploy 工具包

FastDeploy提供了一系列高效易用的工具优化部署体验, 提升推理性能.

一键模型自动化压缩工具

FastDeploy基于PaddleSlim的Auto Compression Toolkit(ACT), 给用户提供了一键模型自动化压缩的工具, 用户可以轻松地通过一行命令对模型进行自动化压缩, 并在FastDeploy上部署压缩后的模型, 提升推理速度. 本文档将以FastDeploy一键模型自动化压缩工具为例, 介绍如何安装此工具, 并提供相应的使用文档.

环境准备

1.用户参考PaddlePaddle官网, 安装develop版本

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

2.安装PaddleSlim develop版本

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

3.安装fastdeploy-tools工具包

# 通过pip安装fastdeploy-tools. 此工具包目前支持模型一键自动化压缩和模型转换的功能.
# FastDeploy的python包已包含此工具, 不需重复安装.
pip install fastdeploy-tools==0.0.1

一键模型自动化压缩工具的使用

按照以上步骤成功安装后,即可使用FastDeploy一键模型自动化压缩工具, 示例如下.

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

详细使用文档请参考FastDeploy一键模型自动化压缩工具

模型转换工具

FastDeploy 基于 X2Paddle 为用户提供了模型转换的工具, 用户可以轻松地通过一行命令将外部框架模型快速迁移至飞桨框架,目前支持 ONNX、TensorFlow 以及 Caffe,支持大部分主流的CV和NLP的模型转换。

环境准备

  1. PaddlePaddle 安装,可参考如下文档快速安装
https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/linux-pip.html
  1. X2Paddle 安装

如需使用稳定版本,可通过pip方式安装X2Paddle:

pip install x2paddle

如需体验最新功能,可使用源码安装方式:

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

使用方式

按照以上步骤成功安装后,即可使用 FastDeploy 一键转换工具, 示例如下:

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

更多详细内容可参考X2Paddle

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/martinfields/FastDeploy.git
git@gitee.com:martinfields/FastDeploy.git
martinfields
FastDeploy
FastDeploy
develop

搜索帮助