Files
FastDeploy/examples/vision/perception/paddle3d/smoke/python/README_CN.md
T
yeliang2258 a509dd8ec1 [Model] Add Paddle3D smoke model (#1766)
* add smoke model

* add 3d vis

* update code

* update doc

* mv paddle3d from detection to perception

* update result for velocity

* update code for CI

* add set input data for TRT backend

* add serving support for smoke model

* update code

* update code

* update code

---------

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
2023-04-14 16:30:56 +08:00

2.2 KiB
Executable File
Raw Blame History

English | 简体中文

Smoke Python 部署示例

在部署前,需确认以下两个步骤

本目录下提供 infer.py 快速完成 Smoke 在 CPU/GPU上部署的示例。执行如下脚本即可完成

#下载部署示例代码
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd examples/vision/vision/paddle3d/smoke/python

wget https://bj.bcebos.com/fastdeploy/models/smoke.tar.gz
tar -xf smoke.tar.gz
wget https://bj.bcebos.com/fastdeploy/models/smoke_test.png

# CPU推理
python infer.py --model smoke --image smoke_test.png --device cpu
# GPU推理
python infer.py --model smoke --image smoke_test.png --device gpu

运行完成可视化结果如下图所示

Smoke Python接口

fastdeploy.vision.detection.Smoke(model_file, params_file, config_file, runtime_option=None, model_format=ModelFormat.PADDLE)

Smoke模型加载和初始化。

参数

  • model_file(str): 模型文件路径
  • params_file(str): 参数文件路径
  • config_file(str): 配置文件路径
  • runtime_option(RuntimeOption): 后端推理配置,默认为None,即采用默认配置
  • model_format(ModelFormat): 模型格式,默认为Paddle格式

predict 函数

Smoke.predict(image_data)

模型预测结口,输入图像直接输出检测结果。

参数

  • image_data(np.ndarray): 输入数据,注意需为HWCBGR格式

返回

返回fastdeploy.vision.PerceptionResult结构体,结构体说明参考文档视觉模型预测结果

其它文档