mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-12-24 13:28:13 +08:00
Delete redundant Chinese comments (#275)
This commit is contained in:
@@ -45,8 +45,8 @@ Recognizer::Recognizer(const std::string& model_file,
|
||||
const ModelFormat& model_format) {
|
||||
if (model_format == ModelFormat::ONNX) {
|
||||
valid_cpu_backends = {Backend::ORT,
|
||||
Backend::OPENVINO}; // 指定可用的CPU后端
|
||||
valid_gpu_backends = {Backend::ORT, Backend::TRT}; // 指定可用的GPU后端
|
||||
Backend::OPENVINO};
|
||||
valid_gpu_backends = {Backend::ORT, Backend::TRT};
|
||||
} else {
|
||||
valid_cpu_backends = {Backend::PDINFER, Backend::ORT, Backend::OPENVINO};
|
||||
valid_gpu_backends = {Backend::PDINFER, Backend::ORT, Backend::TRT};
|
||||
@@ -56,7 +56,6 @@ Recognizer::Recognizer(const std::string& model_file,
|
||||
runtime_option.model_format = model_format;
|
||||
runtime_option.model_file = model_file;
|
||||
runtime_option.params_file = params_file;
|
||||
// Recognizer在使用CPU推理,并把PaddleInference作为推理后端时,需要删除以下2个pass//
|
||||
runtime_option.DeletePaddleBackendPass("matmul_transpose_reshape_fuse_pass");
|
||||
runtime_option.DeletePaddleBackendPass(
|
||||
"matmul_transpose_reshape_mkldnn_fuse_pass");
|
||||
@@ -111,7 +110,6 @@ void OcrRecognizerResizeImage(Mat* mat, const float& wh_ratio,
|
||||
Pad::Run(mat, 0, 0, 0, int(imgW - mat->Width()), value);
|
||||
}
|
||||
|
||||
//预处理
|
||||
bool Recognizer::Preprocess(Mat* mat, FDTensor* output,
|
||||
const std::vector<int>& rec_image_shape) {
|
||||
int imgH = rec_image_shape[1];
|
||||
@@ -134,7 +132,6 @@ bool Recognizer::Preprocess(Mat* mat, FDTensor* output,
|
||||
return true;
|
||||
}
|
||||
|
||||
//后处理
|
||||
bool Recognizer::Postprocess(FDTensor& infer_result,
|
||||
std::tuple<std::string, float>* rec_result) {
|
||||
std::vector<int64_t> output_shape = infer_result.shape;
|
||||
@@ -174,7 +171,6 @@ bool Recognizer::Postprocess(FDTensor& infer_result,
|
||||
return true;
|
||||
}
|
||||
|
||||
//预测
|
||||
bool Recognizer::Predict(cv::Mat* img,
|
||||
std::tuple<std::string, float>* rec_result) {
|
||||
Mat mat(*img);
|
||||
|
||||
Reference in New Issue
Block a user