mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
62760a4eb69de6635e2fc7d89fe58250b4e7ce0e
* first commit for yolov7 * pybind for yolov7 * CPP README.md * CPP README.md * modified yolov7.cc * README.md * python file modify * delete license in fastdeploy/ * repush the conflict part * README.md modified * README.md modified * file path modified * file path modified * file path modified * file path modified * file path modified * README modified * README modified * move some helpers to private * add examples for yolov7 * api.md modified * api.md modified * api.md modified * YOLOv7 * yolov7 release link * yolov7 release link * yolov7 release link * copyright * change some helpers to private * change variables to const and fix documents. * gitignore * Transfer some funtions to private member of class * Transfer some funtions to private member of class * Merge from develop (#9) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> * first commit for yolor * for merge * Develop (#11) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> * Yolor (#16) * Develop (#11) (#12) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> * Develop (#13) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> * documents * documents * documents * documents * documents * documents * documents * documents * documents * documents * documents * documents * Develop (#14) * Fix compile problem in different python version (#26) * fix some usage problem in linux * Fix compile problem Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> * Add PaddleDetetion/PPYOLOE model support (#22) * add ppdet/ppyoloe * Add demo code and documents * add convert processor to vision (#27) * update .gitignore * Added checking for cmake include dir * fixed missing trt_backend option bug when init from trt * remove un-need data layout and add pre-check for dtype * changed RGB2BRG to BGR2RGB in ppcls model * add model_zoo yolov6 c++/python demo * fixed CMakeLists.txt typos * update yolov6 cpp/README.md * add yolox c++/pybind and model_zoo demo * move some helpers to private * fixed CMakeLists.txt typos * add normalize with alpha and beta * add version notes for yolov5/yolov6/yolox * add copyright to yolov5.cc * revert normalize * fixed some bugs in yolox * fixed examples/CMakeLists.txt to avoid conflicts * add convert processor to vision * format examples/CMakeLists summary * Fix bug while the inference result is empty with YOLOv5 (#29) * Add multi-label function for yolov5 * Update README.md Update doc * Update fastdeploy_runtime.cc fix variable option.trt_max_shape wrong name * Update runtime_option.md Update resnet model dynamic shape setting name from images to x * Fix bug when inference result boxes are empty * Delete detection.py Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: Jason <928090362@qq.com> * add is_dynamic for YOLO series (#22) * modify api docs * modify api docs Co-authored-by: Jason <jiangjiajun@baidu.com> Co-authored-by: root <root@bjyz-sys-gpu-kongming3.bjyz.baidu.com> Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com> Co-authored-by: huangjianhui <852142024@qq.com> Co-authored-by: Jason <928090362@qq.com>
⚡️FastDeploy
⚡️FastDeploy是一款简单易用的推理部署工具箱。覆盖业界主流优质预训练模型并提供开箱即用的开发体验,包括图像分类、目标检测、图像分割、人脸检测、人体关键点识别、文字识别等多任务,满足开发者多场景,多硬件、多平台的快速部署需求。
发版历史
- [v0.2.0] 2022.08.18 全面开源服务端部署代码,支持40+视觉模型在CPU/GPU,以及通过GPU TensorRT加速部署
服务端模型
| 任务场景 | 模型 | CPU | NVIDIA GPU | TensorRT |
|---|---|---|---|---|
| 图像分类 | PaddleClas/ResNet50 | √ | √ | √ |
| PaddleClas/PPLCNet | √ | √ | √ | |
| PaddleClas/EfficientNet | √ | √ | √ | |
| PaddleClas/GhostNet | √ | √ | √ | |
| PaddleClas/MobileNetV1 | √ | √ | √ | |
| PaddleClas/MobileNetV2 | √ | √ | √ | |
| PaddleClas/ShuffleNetV2 | √ | √ | √ | |
| 目标检测 | PaddleDetection/PPYOLOE | √ | √ | √ |
| PaddleDetection/PicoDet | √ | √ | √ | |
| PaddleDetection/YOLOX | √ | √ | √ | |
| PaddleDetection/YOLOv3 | √ | √ | √ | |
| PaddleDetection/PPYOLO | √ | √ | - | |
| PaddleDetection/PPYOLOv2 | √ | √ | - | |
| PaddleDetection/FasterRCNN | √ | √ | - | |
| WongKinYiu/YOLOv7 | √ | √ | √ |
快速开始
安装FastDeploy Python
用户根据开发环境选择安装版本,更多安装环境参考安装文档.
pip install https://bj.bcebos.com/paddlehub/fastdeploy/wheels/fastdeploy_python-0.2.0-cp38-cp38-manylinux1_x86_64.whl
准备目标检测模型和测试图片
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
加载模型预测
import fastdeploy.vision as vis
import cv2
model = vis.detection.PPYOLOE("ppyoloe_crn_l_300e_coco/model.pdmodel",
"ppyoloe_crn_l_300e_coco/model.pdiparams",
"ppyoloe_crn_l_300e_coco/infer_cfg.yml")
im = cv2.imread("000000014439.jpg")
result = model.predict(im.copy())
print(result)
vis_im = fd.vision.vis_detection(im, result, score_threshold=0.5)
cv2.imwrite("vis_image.jpg", vis_im)
预测完成,可视化结果保存至vis_image.jpg,同时输出检测结果如下
DetectionResult: [xmin, ymin, xmax, ymax, score, label_id]
415.047363,89.311523, 506.009613, 283.863129, 0.950423, 0
163.665710,81.914894, 198.585342, 166.760880, 0.896433, 0
581.788635,113.027596, 612.623474, 198.521713, 0.842597, 0
267.217224,89.777321, 298.796051, 169.361496, 0.837951, 0
104.465599,45.482410, 127.688835, 93.533875, 0.773348, 0
...
更多服务端部署示例
FastDeploy提供了大量部署示例供开发者参考,支持模型在CPU、GPU以及TensorRT的部署
📱轻量化SDK快速实现端侧AI推理部署
| 任务场景 | 模型 | 大小(MB) | 边缘端 | 移动端 | 移动端 |
|---|---|---|---|---|---|
| ---- | --- | --- | Linux | Android | iOS |
| ----- | ---- | --- | ARM CPU | ARM CPU | ARM CPU |
| Classfication | PP-LCNet | 11.9 | ✅ | ✅ | ✅ |
| PP-LCNetv2 | 26.6 | ✅ | ✅ | ✅ | |
| EfficientNet | 31.4 | ✅ | ✅ | ✅ | |
| GhostNet | 20.8 | ✅ | ✅ | ✅ | |
| MobileNetV1 | 17 | ✅ | ✅ | ✅ | |
| MobileNetV2 | 14.2 | ✅ | ✅ | ✅ | |
| MobileNetV3 | 22 | ✅ | ✅ | ✅ | |
| ShuffleNetV2 | 9.2 | ✅ | ✅ | ✅ | |
| SqueezeNetV1.1 | 5 | ✅ | ✅ | ✅ | |
| Inceptionv3 | 95.5 | ✅ | ✅ | ✅ | |
| PP-HGNet | 59 | ✅ | ✅ | ✅ | |
| SwinTransformer_224_win7 | 352.7 | ✅ | ✅ | ✅ | |
| Detection | PP-PicoDet_s_320_coco | 4.1 | ✅ | ✅ | ✅ |
| PP-PicoDet_s_320_lcnet | 4.9 | ✅ | ✅ | ✅ | |
| CenterNet | 4.8 | ✅ | ✅ | ✅ | |
| YOLOv3_MobileNetV3 | 94.6 | ✅ | ✅ | ✅ | |
| PP-YOLO_tiny_650e_coco | 4.4 | ✅ | ✅ | ✅ | |
| SSD_MobileNetV1_300_120e_voc | 23.3 | ✅ | ✅ | ✅ | |
| PP-YOLO_ResNet50vd | 188.5 | ✅ | ✅ | ✅ | |
| PP-YOLOv2_ResNet50vd | 218.7 | ✅ | ✅ | ✅ | |
| PP-YOLO_crn_l_300e_coco | 209.1 | ✅ | ✅ | ✅ | |
| YOLOv5s | 29.3 | ✅ | ✅ | ✅ | |
| Face Detection | BlazeFace | 1.5 | ✅ | ✅ | ✅ |
| Face Localisation | RetinaFace | 1.7 | ✅ | ❌ | ❌ |
| Keypoint Detection | PP-TinyPose | 5.5 | ✅ | ✅ | ✅ |
| Segmentation | PP-LiteSeg(STDC1) | 32.2 | ✅ | ✅ | ✅ |
| PP-HumanSeg-Lite | 0.556 | ✅ | ✅ | ✅ | |
| HRNet-w18 | 38.7 | ✅ | ✅ | ✅ | |
| PP-HumanSeg-Server | 107.2 | ✅ | ✅ | ✅ | |
| Unet | 53.7 | ❌ | ✅ | ❌ | |
| OCR | PP-OCRv1 | 2.3+4.4 | ✅ | ✅ | ✅ |
| PP-OCRv2 | 2.3+4.4 | ✅ | ✅ | ✅ | |
| PP-OCRv3 | 2.4+10.6 | ✅ | ✅ | ✅ | |
| PP-OCRv3-tiny | 2.4+10.7 | ✅ | ✅ | ✅ |
边缘侧部署
- ARM Linux 系统
移动端部署
自定义模型部署
社区交流
- 加入社区👬: 微信扫描二维码后,填写问卷加入交流群,与开发者共同讨论推理部署痛点问题
Acknowledge
本项目中SDK生成和下载使用了EasyEdge中的免费开放能力,再次表示感谢。
License
FastDeploy遵循Apache-2.0开源协议。
Description
⚡️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.
androidgraphcoreinteljetsonkunlunobject-detectiononnxonnxruntimeopenvinopicodetrockchipservingstable-diffusiontensorrtuieyolov5yolov8
Readme
Apache-2.0
410 MiB
Languages
Python
54.3%
C++
24.1%
Cuda
20.6%
Shell
0.8%
C
0.1%
