FastDeploy 开源项目教程

FastDeploy 开源项目教程

FastDeploy ⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support. 项目地址: https://gitcode.com/gh_mirrors/fa/FastDeploy

1. 项目介绍

FastDeploy 是一个易于使用且高性能的深度学习模型部署工具包,适用于云、移动和边缘设备。它支持多种主流场景和150多个SOTA模型,提供端到端的优化、多平台和多框架支持。FastDeploy 旨在满足开发者在多场景、多硬件和多平台上的工业部署需求。

2. 项目快速启动

2.1 安装 FastDeploy

2.1.1 安装前提条件
  • CUDA >= 11.2
  • cuDNN >= 8.0
  • Python >= 3.6
  • 操作系统:Linux x86_64/macOS/Windows 10
2.1.2 安装 FastDeploy SDK(CPU 和 GPU 支持)
pip install fastdeploy-gpu-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html
2.1.3 Conda 安装(推荐)
conda config --add channels conda-forge && conda install cudatoolkit=11.2 cudnn=8.2
2.1.4 安装 FastDeploy SDK(仅 CPU 支持)
pip install fastdeploy-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html

2.2 Python 快速启动示例

2.2.1 准备模型和图片
wget https://bj.bcebos.com/paddlehub/fastdeploy/ppyoloe_crn_l_300e_coco.tgz
tar xvf ppyoloe_crn_l_300e_coco.tgz
wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg
2.2.2 测试推理结果
import cv2
import fastdeploy.vision as vision

im = cv2.imread("000000014439.jpg")
model = vision.detection.PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel", 
                                 "ppyoloe_crn_l_300e_coco/model.pdiparams", 
                                 "ppyoloe_crn_l_300e_coco/infer_cfg.yml")
result = model.predict(im)
print(result)

vis_im = vision.vis_detection(im, result, score_threshold=0.5)
cv2.imwrite("vis_image.jpg", vis_im)

2.3 C++ 快速启动示例

2.3.1 准备模型和图片
wget https://bj.bcebos.com/paddlehub/fastdeploy/ppyoloe_crn_l_300e_coco.tgz
tar xvf ppyoloe_crn_l_300e_coco.tgz
wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg
2.3.2 测试推理结果
#include "fastdeploy/vision.h"

int main(int argc, char* argv[]) {
    namespace vision = fastdeploy::vision;
    auto im = cv::imread("000000014439.jpg");
    auto model = vision::detection::PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel", 
                                            "ppyoloe_crn_l_300e_coco/model.pdiparams", 
                                            "ppyoloe_crn_l_300e_coco/infer_cfg.yml");
    vision::DetectionResult res;
    model.Predict(&im, &res);
    auto vis_im = vision::VisDetection(im, res, 0.5);
    cv::imwrite("vis_image.jpg", vis_im);
    return 0;
}

3. 应用案例和最佳实践

3.1 图像分类

FastDeploy 支持多种图像分类模型的部署,包括 ResNet、MobileNet 等。开发者可以通过简单的配置文件和代码实现高性能的图像分类服务。

3.2 目标检测

FastDeploy 提供了对 YOLOv5、PP-YOLOE+ 等目标检测模型的支持。开发者可以快速部署这些模型,并在实际应用中进行目标检测任务。

3.3 自然语言处理

FastDeploy 支持多种 NLP 模型的部署,如 BERT、GPT 等。开发者可以通过 FastDeploy 快速实现文本分类、情感分析等任务。

4. 典型生态项目

4.1 PaddlePaddle

FastDeploy 是 PaddlePaddle 生态系统的一部分,提供了对 PaddlePaddle 模型的无缝支持。开发者可以利用 PaddlePaddle 的丰富模型库和 FastDeploy 的高性能部署能力,快速构建和部署深度学习应用。

4.2 VisualDL

VisualDL 是 PaddlePaddle 的可视化工具,FastDeploy 结合 VisualDL 提供了可视化的部署服务。开发者可以通过 VisualDL 界面管理和监控模型的部署状态,进行性能分析和优化。

4.3 PaddleDetection

PaddleDetection 是 PaddlePaddle 的目标检测工具包,FastDeploy 提供了对 PaddleDetection 中多种目标检测模型的支持。开发者可以利用 FastDeploy 快速部署这些模型,并在实际应用中进行目标检测任务。

FastDeploy ⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support. 项目地址: https://gitcode.com/gh_mirrors/fa/FastDeploy

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

庞锦宇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值