Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

English | 简体中文

YOLOv7 Quantification Model Python Deployment Example

This directory provides examples that infer.py fast finishes the deployment of YOLOv7 quantification models on CPU/GPU.

Prepare the deployment

FastDeploy Environment Preparation

Prepare the quantification model

    1. Users can directly deploy quantized models provided by FastDeploy.
    1. Or users can use the One-click auto-compression tool provided by FastDeploy to automatically conduct quantification model for deployment.

Example: quantized YOLOv7 model

# Download the example code for deployment
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd examples/vision/detection/yolov7/quantize/python

# Download yolov7 quantification model files and test images provided by FastDeploy
wget https://bj.bcebos.com/paddlehub/fastdeploy/yolov7_quant.tar
tar -xvf yolov7_quant.tar
wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg

# Use ONNX Runtime quantification model on CPU
python infer.py --model yolov7_quant --image 000000014439.jpg --device cpu --backend ort
#  Use TensorRT quantification model on GPU
python infer.py --model yolov7_quant --image 000000014439.jpg --device gpu --backend trt
# Use Paddle-TensorRT quantification model on GPU
python infer.py --model yolov7_quant --image 000000014439.jpg --device gpu --backend pptrt