mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-16 21:51:31 +08:00
[Docs] Pick paddleclas fastdeploy docs from PaddleClas (#1654)
* Adjust folders structures in paddleclas * remove useless files * Update sophgo * improve readme
This commit is contained in:
@@ -1,33 +1,39 @@
|
||||
English | [简体中文](README_CN.md)
|
||||
# PaddleClas Python Deployment Example
|
||||
# PaddleClas Python部署示例
|
||||
本目录下提供`infer.py`快速完成 ResNet50_vd 在SOPHGO TPU上部署的示例.
|
||||
|
||||
Before deployment, the following step need to be confirmed:
|
||||
|
||||
- 1. Hardware and software environment meets the requirements. Please refer to [FastDeploy Environment Requirement](../../../../../../docs/en/build_and_install/sophgo.md).
|
||||
## 1. 部署环境准备
|
||||
|
||||
`infer.py` in this directory provides a quick example of deployment of the ResNet50_vd model on SOPHGO TPU. Please run the following script:
|
||||
在部署前,需自行编译基于算能硬件的FastDeploy python wheel包并安装,参考文档[算能硬件部署环境](https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/cn/build_and_install#算能硬件部署环境)
|
||||
|
||||
## 2.运行部署示例
|
||||
```bash
|
||||
# Download the sample deployment code.
|
||||
# 下载部署示例代码
|
||||
git clone https://github.com/PaddlePaddle/FastDeploy.git
|
||||
cd FastDeploy/examples/vision/classification/paddleclas/sophgo/python
|
||||
cd FastDeploy/examples/vision/classification/paddleclas/sophgo/python
|
||||
|
||||
# Download images.
|
||||
# 如果您希望从PaddleClas下载示例代码,请运行
|
||||
git clone https://github.com/PaddlePaddle/PaddleClas.git
|
||||
# 注意:如果当前分支找不到下面的fastdeploy测试代码,请切换到develop分支
|
||||
git checkout develop
|
||||
cd PaddleClas/deploy/fastdeploy/sophgo/python
|
||||
|
||||
# 下载图片
|
||||
wget https://gitee.com/paddlepaddle/PaddleClas/raw/release/2.4/deploy/images/ImageNet/ILSVRC2012_val_00000010.jpeg
|
||||
|
||||
# Inference. Need to manually set the model, configuration file and image path used for inference.
|
||||
# 推理转换好的模型
|
||||
# 手动设置推理使用的模型、配置文件和图片路径
|
||||
python3 infer.py --auto False --model_file ./bmodel/resnet50_1684x_f32.bmodel --config_file ResNet50_vd_infer/inference_cls.yaml --image ILSVRC2012_val_00000010.jpeg
|
||||
|
||||
# Automatic completion of downloading data - model compilation - inference, no need to set up model, configuration file and image paths.
|
||||
# 自动完成下载数据-模型编译-推理,不需要设置模型、配置文件和图片路径
|
||||
python3 infer.py --auto True --model '' --config_file '' --image ''
|
||||
|
||||
# The returned result.
|
||||
# 运行完成后返回结果如下所示
|
||||
ClassifyResult(
|
||||
label_ids: 153,
|
||||
scores: 0.684570,
|
||||
)
|
||||
```
|
||||
|
||||
## Other Documents
|
||||
- [ResNet50_vd C++ Deployment](../cpp)
|
||||
- [Converting ResNet50_vd SOPHGO model](../README.md)
|
||||
## 4. 其它文档
|
||||
- [ResNet50_vd C++部署](../python)
|
||||
- [转换ResNet50_vd SOPHGO模型文档](../README.md)
|
||||
|
Reference in New Issue
Block a user