Skip to content

Commit

Permalink
[Docs] Pick paddleclas fastdeploy docs from PaddleClas (#1654)
Browse files Browse the repository at this point in the history
* Adjust folders structures in paddleclas

* remove useless files

* Update sophgo

* improve readme
  • Loading branch information
yunyaoXYY authored Mar 23, 2023
1 parent ab65557 commit c91e99b
Show file tree
Hide file tree
Showing 90 changed files with 2,024 additions and 2,603 deletions.
168 changes: 99 additions & 69 deletions examples/vision/classification/paddleclas/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,69 +1,99 @@
English | [简体中文](README_CN.md)

# PaddleClas Model Deployment

## Model Description

- [PaddleClas Release/2.4](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.4)

Now FastDeploy supports the deployment of the following models

- [PP-LCNet Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/PP-LCNet.md)
- [PP-LCNetV2 Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/PP-LCNetV2.md)
- [EfficientNet Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/EfficientNet_and_ResNeXt101_wsl.md)
- [GhostNet Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/Mobile.md)
- [MobileNet Models(including v1,v2,v3)](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/Mobile.md)
- [ShuffleNet Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/Mobile.md)
- [SqueezeNet Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/Others.md)
- [Inception Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/Inception.md)
- [PP-HGNet Models](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/PP-HGNet.md)
- [ResNet Models(including vd series)](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/models/ResNet_and_vd.md)

## Prepare PaddleClas Deployment Model

For PaddleClas model export, refer to [Model Export](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/docs/zh_CN/inference_deployment/export_model.md#2-%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E5%AF%BC%E5%87%BA).

Attention:The model exported by PaddleClas contains two files, including `inference.pdmodel` and `inference.pdiparams`. However, it is necessary to prepare the generic [inference_cls.yaml](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.4/deploy/configs/inference_cls.yaml) file provided by PaddleClas to meet the requirements of deployment. FastDeploy will obtain from the yaml file the preprocessing information required during inference. FastDeploy will get the preprocessing information needed by the model from the yaml file. Developers can directly download this file. But they need to modify the configuration parameters in the yaml file based on personalized needs. Refer to the configuration information in the infer section of the PaddleClas model training [config.](https://github.com/PaddlePaddle/PaddleClas/tree/release/2.4/ppcls/configs/ImageNet)


## Download Pre-trained Model

For developers' testing, some models exported by PaddleClas (including the inference_cls.yaml file) are provided below. Developers can download them directly.

| Model | Parameter File Size |Input Shape | Top1 | Top5 |
|:---------------------------------------------------------------- |:----- |:----- | :----- | :----- |
| [PPLCNet_x1_0](https://bj.bcebos.com/paddlehub/fastdeploy/PPLCNet_x1_0_infer.tgz) | 12MB | 224x224 |71.32% | 90.03% |
| [PPLCNetV2_base](https://bj.bcebos.com/paddlehub/fastdeploy/PPLCNetV2_base_infer.tgz) | 26MB | 224x224 |77.04% | 93.27% |
| [EfficientNetB7](https://bj.bcebos.com/paddlehub/fastdeploy/EfficientNetB7_infer.tgz) | 255MB | 600x600 | 84.3% | 96.9% |
| [EfficientNetB0](https://bj.bcebos.com/paddlehub/fastdeploy/EfficientNetB0_infer.tgz)| 19MB | 224x224 | 77.38% | 93.31% |
| [EfficientNetB0_small](https://bj.bcebos.com/paddlehub/fastdeploy/EfficientNetB0_small_infer.tgz)| 18MB | 224x224 | 75.8% | 92.58% |
| [GhostNet_x1_3](https://bj.bcebos.com/paddlehub/fastdeploy/GhostNet_x1_3_infer.tgz) | 27MB | 224x224 | 75.79% | 92.54% |
| [GhostNet_x1_3_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/GhostNet_x1_3_ssld_infer.tgz) | 29MB | 224x224 | 79.3% | 94.49% |
| [GhostNet_x0_5](https://bj.bcebos.com/paddlehub/fastdeploy/GhostNet_x0_5_infer.tgz) | 10MB | 224x224 | 66.8% | 86.9% |
| [MobileNetV1_x0_25](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV1_x0_25_infer.tgz) | 1.9MB | 224x224 | 51.4% | 75.5% |
| [MobileNetV1_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV1_ssld_infer.tgz) | 17MB | 224x224 | 77.9% | 93.9% |
| [MobileNetV2_x0_25](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV2_x0_25_infer.tgz) | 5.9MB | 224x224 | 53.2% | 76.5% |
| [MobileNetV2](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV2_infer.tgz) | 13MB | 224x224 | 72.15% | 90.65% |
| [MobileNetV2_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV2_ssld_infer.tgz) | 14MB | 224x224 | 76.74% | 93.39% |
| [MobileNetV3_small_x1_0](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV3_small_x1_0_infer.tgz) | 11MB | 224x224 | 68.24% | 88.06% |
| [MobileNetV3_small_x0_35_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV3_small_x0_35_ssld_infer.tgz) | 6.4MB | 224x224 | 55.55% | 77.71% |
| [MobileNetV3_large_x1_0_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/MobileNetV3_large_x1_0_ssld_infer.tgz) | 22MB | 224x224 | 78.96% | 94.48% |
| [ShuffleNetV2_x0_25](https://bj.bcebos.com/paddlehub/fastdeploy/ShuffleNetV2_x0_25_infer.tgz) | 2.4MB | 224x224 | 49.9% | 73.79% |
| [ShuffleNetV2_x2_0](https://bj.bcebos.com/paddlehub/fastdeploy/ShuffleNetV2_x2_0_infer.tgz) | 29MB | 224x224 | 73.15% | 91.2% |
| [SqueezeNet1_1](https://bj.bcebos.com/paddlehub/fastdeploy/SqueezeNet1_1_infer.tgz) | 4.8MB | 224x224 | 60.1% | 81.9% |
| [InceptionV3](https://bj.bcebos.com/paddlehub/fastdeploy/InceptionV3_infer.tgz) | 92MB | 299x299 | 79.14% | 94.59% |
| [PPHGNet_tiny_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/PPHGNet_tiny_ssld_infer.tgz) | 57MB | 224x224 | 81.95% | 96.12% |
| [PPHGNet_small](https://bj.bcebos.com/paddlehub/fastdeploy/PPHGNet_small_infer.tgz) | 87MB | 224x224 | 81.51% | 95.82% |
| [PPHGNet_base_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/PPHGNet_base_ssld_infer.tgz) | 274MB | 224x224 | 85.0% | 97.35% |
| [ResNet50_vd](https://bj.bcebos.com/paddlehub/fastdeploy/ResNet50_vd_infer.tgz) | 98MB | 224x224 | 79.12% | 94.44% |
| [ResNet50](https://bj.bcebos.com/paddlehub/fastdeploy/ResNet50_infer.tgz) | 91MB | 224x224 | 76.5% | 93% |
| [ResNeXt50_32x4d](https://bj.bcebos.com/paddlehub/fastdeploy/ResNeXt50_32x4d_infer.tgz) | 89MB | 224x224 | 77.75% | 93.82% |
| [DenseNet121](https://bj.bcebos.com/paddlehub/fastdeploy/DenseNet121_infer.tgz) | 29MB | 224x224 | 75.66% | 92.58% |
| [PULC_person_exists](https://bj.bcebos.com/paddlehub/fastdeploy/person_exists_infer.tgz) | 6MB | 224x224 | | |
| [ViT_large_patch16_224](https://bj.bcebos.com/paddlehub/fastdeploy/ViT_large_patch16_224_infer.tgz) | 1.1GB | 224x224 | 83.23% | 96.50%|

## Detailed Deployment Documents

- [Python Deployment](python)
- [C++ Deployment](cpp)
- [Serving Deployment](serving)
# PaddleClas高性能全场景模型部署方案—FastDeploy

## 目录
- [FastDeploy介绍](#FastDeploy介绍)
- [图像分类模型部署](#图像分类模型部署)
- [常见问题](#常见问题)

## 1. FastDeploy介绍
<div id="FastDeploy介绍"></div>

**[⚡️FastDeploy](https://github.com/PaddlePaddle/FastDeploy)**是一款**全场景****易用灵活****极致高效**的AI推理部署工具,支持**云边端**部署。使用FastDeploy可以简单高效的在X86 CPU、NVIDIA GPU、飞腾CPU、ARM CPU、Intel GPU、Graphcore IPU、昆仑、昇腾、瑞芯微、晶晨、算能等10+款硬件上对PaddleClas模型进行快速部署,并且支持Paddle Inference、Paddle Lite、TensorRT、OpenVINO、ONNXRuntime、RKNPU2、SOPHGO等多种推理后端。

<div align="center">

<img src="https://user-images.githubusercontent.com/31974251/224941235-d5ea4ed0-7626-4c62-8bbd-8e4fad1e72ad.png" >

</div>

## 2. 图像分类模型部署
<div id="图像分类模型部署"></div>

### 2.1 硬件支持列表

|硬件类型|该硬件是否支持|使用指南|Python|C++|
|:---:|:---:|:---:|:---:|:---:|
|X86 CPU||[链接](./cpu-gpu)|||
|NVIDIA GPU||[链接](./cpu-gpu)|||
|飞腾CPU||[链接](./cpu-gpu)|||
|ARM CPU||[链接](./cpu-gpu)|||
|Intel GPU(集成显卡)||[链接](./cpu-gpu)|||
|Intel GPU(独立显卡)||[链接](./cpu-gpu)|||
|Graphcore IPU||[链接](./graphcore)|||
|昆仑||[链接](./kunlunxin)|||
|昇腾||[链接](./ascend)|||
|瑞芯微||[链接](./rockchip)|||
|晶晨||[链接](./amlogic)|--|||
|算能||[链接](./sophgo)|||


### 2.2. 详细使用文档
- X86 CPU
- [部署模型准备](./cpu-gpu)
- [Python部署示例](./cpu-gpu/python/)
- [C++部署示例](./cpu-gpu/cpp/)
- NVIDIA GPU
- [部署模型准备](./cpu-gpu)
- [Python部署示例](./cpu-gpu/python/)
- [C++部署示例](./cpu-gpu/cpp/)
- 飞腾CPU
- [部署模型准备](./cpu-gpu)
- [Python部署示例](./cpu-gpu/python/)
- [C++部署示例](./cpu-gpu/cpp/)
- ARM CPU
- [部署模型准备](./cpu-gpu)
- [Python部署示例](./cpu-gpu/python/)
- [C++部署示例](./cpu-gpu/cpp/)
- Intel GPU
- [部署模型准备](./cpu-gpu)
- [Python部署示例](./cpu-gpu/python/)
- [C++部署示例](./cpu-gpu/cpp/)
- Graphcore IPU
- [部署模型准备](./graphcore)
- [Python部署示例](./graphcore/python/)
- [C++部署示例](./graphcore/cpp/)
- 昆仑 XPU
- [部署模型准备](./kunlunxin)
- [Python部署示例](./kunlunxin/python/)
- [C++部署示例](./kunlunxin/cpp/)
- 昇腾 Ascend
- [部署模型准备](./ascend)
- [Python部署示例](./ascend/python/)
- [C++部署示例](./ascend/cpp/)
- 瑞芯微 Rockchip
- [部署模型准备](./rockchip/)
- [Python部署示例](./rockchip/rknpu2/)
- [C++部署示例](./rockchip/rknpu2/)
- 晶晨 Amlogic
- [部署模型准备](./amlogic/a311d/)
- [C++部署示例](./amlogic/a311d/cpp/)
- 算能 Sophgo
- [部署模型准备](./sophgo/)
- [Python部署示例](./sophgo/python/)
- [C++部署示例](./sophgo/cpp/)

### 2.3 更多部署方式

- [Android ARM CPU部署](./android)
- [服务化Serving部署](./serving)
- [web部署](./web)
- [模型自动化压缩工具](./quantize)


## 4. 常见问题
<div id="常见问题"></div>

遇到问题可查看常见问题集合,搜索FastDeploy issue,*或给FastDeploy提交[issue](https://github.com/PaddlePaddle/FastDeploy/issues)*:

[常见问题集合](https://github.com/PaddlePaddle/FastDeploy/tree/develop/docs/cn/faq)
[FastDeploy issues](https://github.com/PaddlePaddle/FastDeploy/issues)
12 changes: 0 additions & 12 deletions examples/vision/classification/paddleclas/a311d/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions examples/vision/classification/paddleclas/a311d/README_CN.md

This file was deleted.

57 changes: 0 additions & 57 deletions examples/vision/classification/paddleclas/a311d/cpp/README.md

This file was deleted.

57 changes: 0 additions & 57 deletions examples/vision/classification/paddleclas/a311d/cpp/README_CN.md

This file was deleted.

25 changes: 25 additions & 0 deletions examples/vision/classification/paddleclas/amlogic/a311d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PaddleClas 模型在晶晨NPU上的部署方案-FastDeploy

## 1. 说明

晶晨A311D是一款先进的AI应用处理器。PaddleClas支持通过FastDeploy在A311D上基于Paddle-Lite部署相关PaddleClas模型。**注意**:需要注意的是,芯原(verisilicon)作为 IP 设计厂商,本身并不提供实体SoC产品,而是授权其 IP 给芯片厂商,如:晶晨(Amlogic),瑞芯微(Rockchip)等。因此本文是适用于被芯原授权了 NPU IP 的芯片产品。只要芯片产品没有大副修改芯原的底层库,则该芯片就可以使用本文档作为 Paddle Lite 推理部署的参考和教程。在本文中,晶晨 SoC 中的 NPU 和 瑞芯微 SoC 中的 NPU 统称为芯原 NPU。目前支持如下芯片的部署:
- Amlogic A311D
- Amlogic C308X
- Amlogic S905D3

本示例基于晶晨A311D来介绍如何使用FastDeploy部署PaddleClas的量化模型。

## 2. 使用预导出的模型列表

FastDeploy提供预先量化好的模型进行部署. 更多模型, 欢迎用户参考[FastDeploy 一键模型自动化压缩工具](https://github.com/PaddlePaddle/FastDeploy/tree/develop/tools/common_tools/auto_compression) 来实现模型量化, 并完成部署.


| 模型 | 量化方式 |
|:---------------| :----- |
| [ResNet50_vd](https://bj.bcebos.com/paddlehub/fastdeploy/resnet50_vd_ptq.tar) | 离线量化 |
| [MobileNetV1_ssld](https://bj.bcebos.com/paddlehub/fastdeploy/mobilenetv1_ssld_ptq.tar) | 离线量化 |

## 3. 详细部署示例

目前,A311D上只支持C++的部署。
- [C++部署](cpp)
Loading

0 comments on commit c91e99b

Please sign in to comment.