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

检测用的训练数据中,使各行尽量保持正确的顺序有意义吗? #12131

Closed
void285 opened this issue May 16, 2024 · 6 comments
Closed
Assignees

Comments

@void285
Copy link

void285 commented May 16, 2024

您好。我刚开始学习,还没开始训练,有一个关于行序的疑惑,希望得到帮助。

我要识别的图像上的文本大部分为竖排的,但有些页面上这些竖排文本组成的局部区域之间是横排,还有部分页面存在一些特殊情况,总之,最终的行序不会是简单的先上下后左右。

要训练一个检测模型识别此类页面,在准备训练数据阶段,除了让图片上各行的坐标、文本尽量准确,保持行的阅读顺序是否有必要?训练检测模型用的数据中的行序,是否会影响得到的检测模型输出的行序?

从别的issues中,我注意到了PaddleOCR/tools/infer/predict_system.py 中的 sorted_boxes(dt_boxes) 函数会根据各行坐标,以及先上下后左右的算法对行序进行重排;那么,行序是先被检测模型直接左右,而后由sorted_boxes微调;还是检测模型输出随机行序,而后完全由sorted_boxes根据先上下、后左右的原则重排?

(待准备的数据,要确保阅读顺序准确,需要付出不少功夫,所以想搞清楚这点)

@UserWangZz
Copy link
Collaborator

考虑顺序一方面是为了后续任务的处理,还有一方面在KIE任务中需要对文本位置进行编码,因此对检测框的顺序进行了排序

@void285
Copy link
Author

void285 commented May 20, 2024

考虑顺序一方面是为了后续任务的处理,还有一方面在KIE任务中需要对文本位置进行编码,因此对检测框的顺序进行了排序

谢谢,如果不考虑后续任务处理,也不做KIE任务,只想在推理时,让行序尽量按预期排列,那么在准备训练数据时,花力气纠正行序有意义吗?

@UserWangZz
Copy link
Collaborator

这种情况可以不考虑标注框顺序

@void285
Copy link
Author

void285 commented May 20, 2024

谢谢。那么就是说,训练数据中行的特定排序,对推理阶段输出的行序无影响,要得到尽量正确的行序,只能按需定制sorted_boxes(dt_boxes)了?

@UserWangZz
Copy link
Collaborator

是的

@void285
Copy link
Author

void285 commented May 21, 2024

了解了,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants