mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
[Bug Fix] Fix PPOCR bug when cls model is not used (#695)
* Imporve OCR Readme * Improve OCR Readme * Improve OCR Readme * Improve OCR Readme * Improve OCR Readme * Add Initialize function to PP-OCR * Add Initialize function to PP-OCR * Add Initialize function to PP-OCR * Make all the model links come from PaddleOCR * Improve OCR readme * Improve OCR readme * Improve OCR readme * Improve OCR readme * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add Readme for vision results * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add check for label file in postprocess of Rec model * Add comments to create API docs * Improve OCR comments * Rename OCR and add comments * Make sure previous python example works * Make sure previous python example works * Fix Rec model bug * Fix Rec model bug * Fix rec model bug * Add SetTrtMaxBatchSize function for TensorRT * Add SetTrtMaxBatchSize Pybind * Add set_trt_max_batch_size python function * Set TRT dynamic shape in PPOCR examples * Set TRT dynamic shape in PPOCR examples * Set TRT dynamic shape in PPOCR examples * Fix PPOCRv2 python example * Fix PPOCR dynamic input shape bug * Remove useless code * Fix PPOCR bug Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -93,6 +93,7 @@ bool PPOCRv2::BatchPredict(const std::vector<cv::Mat>& images,
|
||||
std::vector<std::string>* text_ptr = &ocr_result.text;
|
||||
std::vector<float>* rec_scores_ptr = &ocr_result.rec_scores;
|
||||
|
||||
if (nullptr != classifier_){
|
||||
if (!classifier_->BatchPredict(image_list, cls_labels_ptr, cls_scores_ptr)) {
|
||||
FDERROR << "There's error while recognizing image in PPOCR." << std::endl;
|
||||
return false;
|
||||
@@ -103,6 +104,7 @@ bool PPOCRv2::BatchPredict(const std::vector<cv::Mat>& images,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!recognizer_->BatchPredict(image_list, text_ptr, rec_scores_ptr)) {
|
||||
FDERROR << "There's error while recognizing image in PPOCR." << std::endl;
|
||||
|
Reference in New Issue
Block a user