Skip to content

Commit

Permalink
[Bug Fix] fixed ocr visualize error (#2090)
Browse files Browse the repository at this point in the history
  • Loading branch information
DefTruth committed Jul 7, 2023
1 parent ad1f46f commit 4c1e80b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fastdeploy/vision/visualize/ocr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ namespace vision {
cv::Mat VisOcr(const cv::Mat& im, const OCRResult& ocr_result,
const float score_threshold) {
auto vis_im = im.clone();
bool have_score =
(ocr_result.boxes.size() == ocr_result.rec_scores.size());

for (int n = 0; n < ocr_result.boxes.size(); n++) {
if (ocr_result.rec_scores[n] < score_threshold) {
continue;
if (have_score) {
if (ocr_result.rec_scores[n] < score_threshold) {
continue;
}
}
cv::Point rook_points[4];

Expand Down

0 comments on commit 4c1e80b

Please sign in to comment.