Skip to content

Commit

Permalink
fix index bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WenmuZhou committed Feb 5, 2021
1 parent 6fc43d4 commit af1ac7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy/cpp_infer/src/ocr_rec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void CRNNRecognizer::Run(std::vector<std::vector<std::vector<int>>> boxes,
float(*std::max_element(&predict_batch[n * predict_shape[2]],
&predict_batch[(n + 1) * predict_shape[2]]));

if (argmax_idx > 0 && (!(i > 0 && argmax_idx == last_index))) {
if (argmax_idx > 0 && (!(n > 0 && argmax_idx == last_index))) {
score += max_value;
count += 1;
str_res.push_back(label_list_[argmax_idx]);
Expand Down
2 changes: 1 addition & 1 deletion deploy/lite/ocr_db_crnn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void RunRecModel(std::vector<std::vector<std::vector<int>>> boxes, cv::Mat img,
max_value =
float(*std::max_element(&predict_batch[n * predict_shape[2]],
&predict_batch[(n + 1) * predict_shape[2]]));
if (argmax_idx > 0 && (!(i > 0 && argmax_idx == last_index))) {
if (argmax_idx > 0 && (!(n > 0 && argmax_idx == last_index))) {
score += max_value;
count += 1;
str_res += charactor_dict[argmax_idx];
Expand Down

0 comments on commit af1ac7c

Please sign in to comment.