Files
FastDeploy/examples/vision/perception/paddle3d/petr/python
CoolCola e3b285c762 [Model] Support Paddle3D PETR v2 model (#1863)
* Support PETR v2

* make petrv2 precision equal with the origin repo

* delete extra func

* modify review problem

* delete visualize

* Update README_CN.md

* Update README.md

* Update README_CN.md

* fix build problem

* delete external variable and function

---------

Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
2023-05-19 10:45:36 +08:00
..

English | 简体中文

Petr Python Deployment Example

Before deployment, the following two steps need to be confirmed

This directory provides an example of infer.py to quickly complete the deployment of Petr on CPU/GPU. Execute the following script to complete

#Download deployment sample code
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd examples/vision/vision/paddle3d/petr/python

wget https://bj.bcebos.com/fastdeploy/models/petr.tar.gz
tar -xf petr.tar.gz
wget https://bj.bcebos.com/fastdeploy/models/petr_test.png

# CPU reasoning
python infer.py --model petr --image petr_test.png --device cpu
# GPU inference
python infer.py --model petr --image petr_test.png --device gpu

Petr Python interface

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

Petr model loading and initialization.

parameter

  • model_file(str): model file path
  • params_file(str): parameter file path
  • config_file(str): configuration file path
  • runtime_option(RuntimeOption): Backend reasoning configuration, the default is None, that is, the default configuration is used
  • model_format(ModelFormat): model format, the default is Paddle format

predict function

Petr. predict(image_data)

Model prediction interface, the input image directly outputs the detection result.

parameters

  • image_data(np.ndarray): input data, note that it must be in HWC, BGR format

Back

Return the fastdeploy.vision.PerceptionResult structure, structure description reference document Vision Model Prediction Results

Other documents