diff --git a/examples/vision/detection/yolov5/quantize/cpp/README.md b/examples/vision/detection/yolov5/quantize/cpp/README.md index 2555cee21..90334c7ba 100644 --- a/examples/vision/detection/yolov5/quantize/cpp/README.md +++ b/examples/vision/detection/yolov5/quantize/cpp/README.md @@ -28,7 +28,7 @@ tar -xvf yolov5s_quant.tar wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg -# 在CPU上使用Paddle-Inference推理量化模型 +# 在CPU上使用ONNX Runtime推理量化模型 ./infer_demo yolov5s_quant 000000014439.jpg 0 # 在GPU上使用TensorRT推理量化模型 ./infer_demo yolov5s_quant 000000014439.jpg 1 diff --git a/examples/vision/detection/yolov5/quantize/cpp/infer.cc b/examples/vision/detection/yolov5/quantize/cpp/infer.cc index 54e9d6dc1..e429b2aad 100644 --- a/examples/vision/detection/yolov5/quantize/cpp/infer.cc +++ b/examples/vision/detection/yolov5/quantize/cpp/infer.cc @@ -64,7 +64,7 @@ int main(int argc, char* argv[]) { if (flag == 0) { option.UseCpu(); - option.UsePaddleBackend(); + option.UseOrtBackend(); } else if (flag == 1) { option.UseGpu(); option.UseTrtBackend(); diff --git a/examples/vision/detection/yolov5/quantize/python/README.md b/examples/vision/detection/yolov5/quantize/python/README.md index 28086d8b5..c63ef712c 100644 --- a/examples/vision/detection/yolov5/quantize/python/README.md +++ b/examples/vision/detection/yolov5/quantize/python/README.md @@ -22,8 +22,8 @@ wget https://bj.bcebos.com/paddlehub/fastdeploy/yolov5s_quant.tar tar -xvf yolov5s_quant.tar wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg -# 在CPU上使用Paddle-Inference推理量化模型 -python infer.py --model yolov5s_quant --image 000000014439.jpg --device cpu --backend paddle +# 在CPU上使用ONNX Runtime推理量化模型 +python infer.py --model yolov5s_quant --image 000000014439.jpg --device cpu --backend ort # 在GPU上使用TensorRT推理量化模型 python infer.py --model yolov5s_quant --image 000000014439.jpg --device gpu --backend trt # 在GPU上使用Paddle-TensorRT推理量化模型 diff --git a/examples/vision/detection/yolov5/quantize/python/infer.py b/examples/vision/detection/yolov5/quantize/python/infer.py index 2e420c360..da502fe93 100644 --- a/examples/vision/detection/yolov5/quantize/python/infer.py +++ b/examples/vision/detection/yolov5/quantize/python/infer.py @@ -54,12 +54,6 @@ def build_option(args): option.enable_paddle_to_trt() elif args.backend.lower() == "ort": option.use_ort_backend() - elif args.backend.lower() == "paddle": - option.use_paddle_backend() - elif args.backend.lower() == "openvino": - assert args.device.lower( - ) == "cpu", "OpenVINO backend require inference on device CPU." - option.use_openvino_backend() return option diff --git a/examples/vision/detection/yolov6/quantize/cpp/README.md b/examples/vision/detection/yolov6/quantize/cpp/README.md index 5859b7de1..ee11f315d 100644 --- a/examples/vision/detection/yolov6/quantize/cpp/README.md +++ b/examples/vision/detection/yolov6/quantize/cpp/README.md @@ -28,7 +28,7 @@ tar -xvf yolov6s_qat_model.tar wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg -# 在CPU上使用Paddle-Inference推理量化模型 +# 在CPU上使用ONNX Runtime推理量化模型 ./infer_demo yolov6s_qat_model 000000014439.jpg 0 # 在GPU上使用TensorRT推理量化模型 ./infer_demo yolov6s_qat_model 000000014439.jpg 1 diff --git a/examples/vision/detection/yolov6/quantize/cpp/infer.cc b/examples/vision/detection/yolov6/quantize/cpp/infer.cc index 64f4d9f22..b40200962 100644 --- a/examples/vision/detection/yolov6/quantize/cpp/infer.cc +++ b/examples/vision/detection/yolov6/quantize/cpp/infer.cc @@ -64,7 +64,7 @@ int main(int argc, char* argv[]) { if (flag == 0) { option.UseCpu(); - option.UsePaddleBackend(); + option.UseOrtBackend(); } else if (flag == 1) { option.UseGpu(); option.UseTrtBackend(); diff --git a/examples/vision/detection/yolov6/quantize/python/README.md b/examples/vision/detection/yolov6/quantize/python/README.md index 889fe2f11..169a0a946 100644 --- a/examples/vision/detection/yolov6/quantize/python/README.md +++ b/examples/vision/detection/yolov6/quantize/python/README.md @@ -21,8 +21,8 @@ wget https://bj.bcebos.com/paddlehub/fastdeploy/yolov6s_qat_model.tar tar -xvf yolov6s_qat_model.tar wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg -# 在CPU上使用Paddle-Inference推理量化模型 -python infer.py --model yolov6s_qat_model --image 000000014439.jpg --device cpu --backend paddle +# 在CPU上使用ONNX Runtime推理量化模型 +python infer.py --model yolov6s_qat_model --image 000000014439.jpg --device cpu --backend ort # 在GPU上使用TensorRT推理量化模型 python infer.py --model yolov6s_qat_model --image 000000014439.jpg --device gpu --backend trt # 在GPU上使用Paddle-TensorRT推理量化模型 diff --git a/examples/vision/detection/yolov6/quantize/python/infer.py b/examples/vision/detection/yolov6/quantize/python/infer.py index d34c7cd59..da9fa3d97 100644 --- a/examples/vision/detection/yolov6/quantize/python/infer.py +++ b/examples/vision/detection/yolov6/quantize/python/infer.py @@ -54,12 +54,6 @@ def build_option(args): option.enable_paddle_to_trt() elif args.backend.lower() == "ort": option.use_ort_backend() - elif args.backend.lower() == "paddle": - option.use_paddle_backend() - elif args.backend.lower() == "openvino": - assert args.device.lower( - ) == "cpu", "OpenVINO backend require inference on device CPU." - option.use_openvino_backend() return option diff --git a/examples/vision/detection/yolov7/quantize/cpp/README.md b/examples/vision/detection/yolov7/quantize/cpp/README.md index bf676253a..17eb9eb0f 100644 --- a/examples/vision/detection/yolov7/quantize/cpp/README.md +++ b/examples/vision/detection/yolov7/quantize/cpp/README.md @@ -28,7 +28,7 @@ tar -xvf yolov7_quant.tar wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg -# 在CPU上使用Paddle-Inference推理量化模型 +# 在CPU上使用ONNX Runtime推理量化模型 ./infer_demo yolov7_quant 000000014439.jpg 0 # 在GPU上使用TensorRT推理量化模型 ./infer_demo yolov7_quant 000000014439.jpg 1 diff --git a/examples/vision/detection/yolov7/quantize/cpp/infer.cc b/examples/vision/detection/yolov7/quantize/cpp/infer.cc index 8a656adee..0eda80b6c 100644 --- a/examples/vision/detection/yolov7/quantize/cpp/infer.cc +++ b/examples/vision/detection/yolov7/quantize/cpp/infer.cc @@ -64,7 +64,7 @@ int main(int argc, char* argv[]) { if (flag == 0) { option.UseCpu(); - option.UsePaddleBackend(); + option.UseOrtBackend(); } else if (flag == 1) { option.UseGpu(); option.UseTrtBackend(); diff --git a/examples/vision/detection/yolov7/quantize/python/README.md b/examples/vision/detection/yolov7/quantize/python/README.md index e82dc4615..4389d44c1 100644 --- a/examples/vision/detection/yolov7/quantize/python/README.md +++ b/examples/vision/detection/yolov7/quantize/python/README.md @@ -21,8 +21,8 @@ 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 -# 在CPU上使用Paddle-Inference推理量化模型 -python infer.py --model yolov7_quant --image 000000014439.jpg --device cpu --backend paddle +# 在CPU上使用ONNX Runtime推理量化模型 +python infer.py --model yolov7_quant --image 000000014439.jpg --device cpu --backend ort # 在GPU上使用TensorRT推理量化模型 python infer.py --model yolov7_quant --image 000000014439.jpg --device gpu --backend trt # 在GPU上使用Paddle-TensorRT推理量化模型 diff --git a/examples/vision/detection/yolov7/quantize/python/infer.py b/examples/vision/detection/yolov7/quantize/python/infer.py index 4790a4d94..de84e4061 100644 --- a/examples/vision/detection/yolov7/quantize/python/infer.py +++ b/examples/vision/detection/yolov7/quantize/python/infer.py @@ -54,12 +54,6 @@ def build_option(args): option.enable_paddle_to_trt() elif args.backend.lower() == "ort": option.use_ort_backend() - elif args.backend.lower() == "paddle": - option.use_paddle_backend() - elif args.backend.lower() == "openvino": - assert args.device.lower( - ) == "cpu", "OpenVINO backend require inference on device CPU." - option.use_openvino_backend() return option diff --git a/python/fastdeploy/vision/detection/contrib/yolov5.py b/python/fastdeploy/vision/detection/contrib/yolov5.py index b8113f3b8..7d87d6e42 100644 --- a/python/fastdeploy/vision/detection/contrib/yolov5.py +++ b/python/fastdeploy/vision/detection/contrib/yolov5.py @@ -151,7 +151,6 @@ class YOLOv5(FastDeployModel): # 初始化后的option保存在self._runtime_option super(YOLOv5, self).__init__(runtime_option) - assert model_format == ModelFormat.ONNX, "YOLOv5 only support model format of ModelFormat.ONNX now." self._model = C.vision.detection.YOLOv5( model_file, params_file, self._runtime_option, model_format) # 通过self.initialized判断整个模型的初始化是否成功 diff --git a/python/fastdeploy/vision/detection/contrib/yolov7.py b/python/fastdeploy/vision/detection/contrib/yolov7.py index 510b72ed6..1e4ddf7f6 100644 --- a/python/fastdeploy/vision/detection/contrib/yolov7.py +++ b/python/fastdeploy/vision/detection/contrib/yolov7.py @@ -137,7 +137,6 @@ class YOLOv7(FastDeployModel): # 初始化后的option保存在self._runtime_option super(YOLOv7, self).__init__(runtime_option) - assert model_format == ModelFormat.ONNX, "YOLOv7 only support model format of ModelFormat.ONNX now." self._model = C.vision.detection.YOLOv7( model_file, params_file, self._runtime_option, model_format) # 通过self.initialized判断整个模型的初始化是否成功