Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix index variable in for loop in paddlestructure.cpp #10810

Conversation

JIANG3330
Copy link

PaddleStructure::rebuild_table函数中structure_boxes的索引用错了,可能导致dis和iou无法正确计算。
原代码段:

    for (int j = 0; j < structure_boxes.size(); j++) {
      if (structure_boxes[i].size() == 8) {
        structure_box = Utility::xyxyxyxy2xyxy(structure_boxes[j]);
      } else {
        structure_box = structure_boxes[j];
      }
      dis_list[j][0] = this->dis(ocr_box, structure_box);
      dis_list[j][1] = 1 - Utility::iou(ocr_box, structure_box);
      dis_list[j][2] = j;
    }

应改为:

    for (int j = 0; j < structure_boxes.size(); j++) {
      if (structure_boxes[j].size() == 8) {
        structure_box = Utility::xyxyxyxy2xyxy(structure_boxes[j]);
      } else {
        structure_box = structure_boxes[j];
      }
      dis_list[j][0] = this->dis(ocr_box, structure_box);
      dis_list[j][1] = 1 - Utility::iou(ocr_box, structure_box);
      dis_list[j][2] = j;
    }

structure_boxes的索引用错了,导致dis和iou可能无法正确计算
@paddle-bot
Copy link

paddle-bot bot commented Sep 2, 2023

Thanks for your contribution!

Copy link
Collaborator

@andyjiang1116 andyjiang1116 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JIANG3330 感谢修复,麻烦将这个bug同步修复到dygraph分支吧

@andyjiang1116 andyjiang1116 merged commit 19ad3d9 into PaddlePaddle:release/2.7 Sep 21, 2023
jzhang533 pushed a commit to jzhang533/PaddleOCR that referenced this pull request Mar 28, 2024
structure_boxes的索引用错了,导致dis和iou可能无法正确计算
gknor-edrone pushed a commit to edrone/PaddleOCR that referenced this pull request Sep 9, 2024
structure_boxes的索引用错了,导致dis和iou可能无法正确计算
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants