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

有没有可以识别水平左右两段文本的方法 #321

Closed
cdisk opened this issue Mar 14, 2024 · 2 comments
Closed

有没有可以识别水平左右两段文本的方法 #321

cdisk opened this issue Mar 14, 2024 · 2 comments

Comments

@cdisk
Copy link

cdisk commented Mar 14, 2024

我有一张包含左右两段文本的图片,
tu1

但是识别结果是左一句、右一句的,
而不是左边识别完了再是右边的,
比如这样的结果:

{
    "results": [
        {
            "position": [
                [ 2822.0, 285.0 ],
                [ 3458.0, 273.0 ],
                [ 3460.0, 366.0 ],
                [ 2824.0, 378.0 ]
            ],
            "score": 0.7576537728309631,
            "text": "广告平面设计周记"
        },
        {
            "position": [
                [ 718.0, 334.0 ],
                [ 1485.0, 328.0 ],
                [ 1486.0, 410.0 ],
                [ 719.0, 416.0 ]
            ],
            "score": 0.9162117838859558,
            "text": "消防应急预案演练方案"
        },
        {
            "position": [
                [ 296.0, 476.0 ],
                [ 641.0, 476.0 ],
                [ 641.0, 536.0 ],
                [ 296.0, 536.0 ]
            ],
            "score": 0.8414948582649231,
            "text": "、消防演习目的"
        },
        {
            "position": [
                [ 2434.0, 531.0 ],
                [ 2807.0, 531.0 ],
                [ 2807.0, 591.0 ],
                [ 2434.0, 591.0 ]
            ],
            "score": 0.8757268786430359,
            "text": "广告平面设计周记一"
        },
        {
            "position": [
                [ 356.0, 574.0 ],
                [ 1852.0, 563.0 ],
                [ 1853.0, 640.0 ],
                [ 357.0, 651.0 ]
            ],
            "score": 0.7912859320640564,
            "text": "为了贯彻落实公司火灾事故的防范措施,消除火灾安全隐患,最大限度减少损失"
        },
        {
            "position": [
                [ 2439.0, 640.0 ],
                [ 2576.0, 640.0 ],
                [ 2576.0, 700.0 ],
                [ 2439.0, 700.0 ]
            ],
            "score": 0.5020459890365601,
            "text": "周记1:"
        },

请教大神有没有什么办法可以让输出结果,先输出左边的文本,再输出右边的文本。

@breezedeus
Copy link
Owner

位置都返回了,你按照位置重排序一下就好了

@cdisk
Copy link
Author

cdisk commented Apr 3, 2024

这排序该怎么弄呢,比如这样的图片,
image

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

No branches or pull requests

2 participants