diff --git a/deploy/cpp_infer/include/ocr_cls.h b/deploy/cpp_infer/include/ocr_cls.h index 35aec95912943fba4031eccf8b016865a4ea8b56..41494085a797c7a4490942741e6e888033c0be00 100644 --- a/deploy/cpp_infer/include/ocr_cls.h +++ b/deploy/cpp_infer/include/ocr_cls.h @@ -40,7 +40,7 @@ public: const int &gpu_id, const int &gpu_mem, const int &cpu_math_library_num_threads, const bool &use_mkldnn, const double &cls_thresh, - const bool &use_tensorrt, const &bool use_fp16) { + const bool &use_tensorrt, const bool &use_fp16) { this->use_gpu_ = use_gpu; this->gpu_id_ = gpu_id; this->gpu_mem_ = gpu_mem; diff --git a/deploy/cpp_infer/include/ocr_det.h b/deploy/cpp_infer/include/ocr_det.h index 9a1de2795bc372d07dba49f5924b2a112fb5ac3e..bab9c95fa4a3f1cb160ccbf9ca4587fa4c2ba16a 100644 --- a/deploy/cpp_infer/include/ocr_det.h +++ b/deploy/cpp_infer/include/ocr_det.h @@ -44,9 +44,8 @@ public: const bool &use_mkldnn, const int &max_side_len, const double &det_db_thresh, const double &det_db_box_thresh, - const double &det_db_unclip_ratio, - const bool &visualize const bool &use_tensorrt, - const bool &use_fp16) { + const double &det_db_unclip_ratio, const bool &visualize, + const bool &use_tensorrt, const bool &use_fp16) { this->use_gpu_ = use_gpu; this->gpu_id_ = gpu_id; this->gpu_mem_ = gpu_mem; diff --git a/deploy/cpp_infer/src/main.cpp b/deploy/cpp_infer/src/main.cpp index ecf0c27bb258d2b856fe7749a15bcb9de0e05dae..f40e5edfcc2c19e0a61894bed11aef636317e056 100644 --- a/deploy/cpp_infer/src/main.cpp +++ b/deploy/cpp_infer/src/main.cpp @@ -77,11 +77,11 @@ int main(int argc, char **argv) { auto end = std::chrono::system_clock::now(); auto duration = std::chrono::duration_cast(end - start); - std::cout << "花费了" + std::cout << "Cost" << double(duration.count()) * std::chrono::microseconds::period::num / std::chrono::microseconds::period::den - << "秒" << std::endl; + << "s" << std::endl; return 0; } diff --git a/deploy/cpp_infer/src/ocr_cls.cpp b/deploy/cpp_infer/src/ocr_cls.cpp index faa75ff49c83f56d4321cc97a2a908104617339b..3aeda2ed0c286d1ec5e816e15ac5500f53c9a3a2 100644 --- a/deploy/cpp_infer/src/ocr_cls.cpp +++ b/deploy/cpp_infer/src/ocr_cls.cpp @@ -88,7 +88,7 @@ void Classifier::LoadModel(const std::string &model_dir) { if (this->use_mkldnn_) { config.EnableMKLDNN(); } - config.SetCpuMathLibraryNumThreads(this->cpu_math_library_num_threads_) + config.SetCpuMathLibraryNumThreads(this->cpu_math_library_num_threads_); } // false for zero copy tensor diff --git a/deploy/cpp_infer/src/ocr_rec.cpp b/deploy/cpp_infer/src/ocr_rec.cpp index 0199d7510bfe19e731abcd467d49abb99225a0a0..27cfe4c95009c6454514a43e304a23503fe5fa9a 100644 --- a/deploy/cpp_infer/src/ocr_rec.cpp +++ b/deploy/cpp_infer/src/ocr_rec.cpp @@ -76,7 +76,7 @@ void CRNNRecognizer::Run(std::vector>> boxes, float(*std::max_element(&predict_batch[n * predict_shape[2]], &predict_batch[(n + 1) * predict_shape[2]])); - if (argmax_idx > 0 && (not(i > 0 && argmax_idx == last_index))) { + if (argmax_idx > 0 && (!(i > 0 && argmax_idx == last_index))) { score += max_value; count += 1; str_res.push_back(label_list_[argmax_idx]); @@ -183,4 +183,4 @@ cv::Mat CRNNRecognizer::GetRotateCropImage(const cv::Mat &srcimage, } } -} // namespace PaddleOCR \ No newline at end of file +} // namespace PaddleOCR