Merge pull request #847 from WenmuZhou/fix_cls_android_demo

set cls image_shape to 3,48,192
This commit is contained in:
dyning 2020-09-27 10:26:27 +08:00 committed by GitHub
commit 43874ba967
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@
#include <iostream>
#include <vector>
const std::vector<int> CLS_IMAGE_SHAPE = {3, 32, 100};
const std::vector<int> CLS_IMAGE_SHAPE = {3, 48, 192};
cv::Mat cls_resize_img(const cv::Mat &img) {
int imgC = CLS_IMAGE_SHAPE[0];

View File

@ -98,7 +98,7 @@ private:
* @param origin
* @return
*/
cv::Mat infer_cls(const cv::Mat &origin, float thresh = 0.5);
cv::Mat infer_cls(const cv::Mat &origin, float thresh = 0.9);
/**
* Postprocess or sencod model to extract text

View File

@ -17,7 +17,7 @@
#include <memory>
#include <string>
const std::vector<int> rec_image_shape{3, 32, 100};
const std::vector<int> rec_image_shape{3, 48, 192};
cv::Mat ClsResizeImg(cv::Mat img) {
int imgC, imgH, imgW;

View File

@ -107,7 +107,7 @@ cv::Mat DetResizeImg(const cv::Mat img, int max_size_len,
}
cv::Mat RunClsModel(cv::Mat img, std::shared_ptr<PaddlePredictor> predictor_cls,
const float thresh = 0.5) {
const float thresh = 0.9) {
std::vector<float> mean = {0.5f, 0.5f, 0.5f};
std::vector<float> scale = {1 / 0.5f, 1 / 0.5f, 1 / 0.5f};