mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-09-24 23:33:08 +08:00
rec return result
This commit is contained in:
@@ -46,8 +46,7 @@ public:
|
||||
const double &det_db_box_thresh,
|
||||
const double &det_db_unclip_ratio,
|
||||
const bool &use_polygon_score, const bool &use_dilation,
|
||||
const bool &visualize, const bool &use_tensorrt,
|
||||
const std::string &precision) {
|
||||
const bool &use_tensorrt, const std::string &precision) {
|
||||
this->use_gpu_ = use_gpu;
|
||||
this->gpu_id_ = gpu_id;
|
||||
this->gpu_mem_ = gpu_mem;
|
||||
@@ -62,7 +61,6 @@ public:
|
||||
this->use_polygon_score_ = use_polygon_score;
|
||||
this->use_dilation_ = use_dilation;
|
||||
|
||||
this->visualize_ = visualize;
|
||||
this->use_tensorrt_ = use_tensorrt;
|
||||
this->precision_ = precision;
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ public:
|
||||
const int &gpu_id, const int &gpu_mem,
|
||||
const int &cpu_math_library_num_threads,
|
||||
const bool &use_mkldnn, const string &label_path,
|
||||
const bool &use_tensorrt, const std::string &precision,
|
||||
const bool &use_tensorrt,
|
||||
const std::string &precision,
|
||||
const int &rec_batch_num) {
|
||||
this->use_gpu_ = use_gpu;
|
||||
this->gpu_id_ = gpu_id;
|
||||
@@ -66,7 +67,8 @@ public:
|
||||
// Load Paddle inference model
|
||||
void LoadModel(const std::string &model_dir);
|
||||
|
||||
void Run(std::vector<cv::Mat> img_list, std::vector<double> *times);
|
||||
void Run(std::vector<cv::Mat> img_list, std::vector<std::string> &rec_texts,
|
||||
std::vector<float> &rec_text_scores, std::vector<double> *times);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Predictor> predictor_;
|
||||
@@ -85,7 +87,7 @@ private:
|
||||
bool use_tensorrt_ = false;
|
||||
std::string precision_ = "fp32";
|
||||
int rec_batch_num_ = 6;
|
||||
|
||||
|
||||
// pre-process
|
||||
CrnnResizeImg resize_op_;
|
||||
Normalize normalize_op_;
|
||||
|
||||
@@ -38,7 +38,8 @@ public:
|
||||
|
||||
static void
|
||||
VisualizeBboxes(const cv::Mat &srcimg,
|
||||
const std::vector<std::vector<std::vector<int>>> &boxes);
|
||||
const std::vector<std::vector<std::vector<int>>> &boxes,
|
||||
const std::string &save_path);
|
||||
|
||||
template <class ForwardIterator>
|
||||
inline static size_t argmax(ForwardIterator first, ForwardIterator last) {
|
||||
@@ -47,12 +48,13 @@ public:
|
||||
|
||||
static void GetAllFiles(const char *dir_name,
|
||||
std::vector<std::string> &all_inputs);
|
||||
|
||||
static cv::Mat GetRotateCropImage(const cv::Mat &srcimage,
|
||||
std::vector<std::vector<int>> box);
|
||||
|
||||
static std::vector<int> argsort(const std::vector<float>& array);
|
||||
|
||||
static cv::Mat GetRotateCropImage(const cv::Mat &srcimage,
|
||||
std::vector<std::vector<int>> box);
|
||||
|
||||
static std::vector<int> argsort(const std::vector<float> &array);
|
||||
|
||||
static std::string basename(const std::string &filename);
|
||||
};
|
||||
|
||||
} // namespace PaddleOCR
|
||||
Reference in New Issue
Block a user