Skip to content

模型检测的结果,怎么返回 key_cls 参数? #207

@lemonit-eric-mao

Description

@lemonit-eric-mao

背景说明

使用标注数据的工具标注的 Label.txt 有个参数 key_cls 是用来记录分类的,如图

Image 数据如下:

小图片/小02.png [{"transcription": "Table 2", "points": [[1, 2], [35, 2], [35, 14], [1, 14]], "difficult": false, "key_cls": "标题1"}, {"transcription": "Traralgon Ck", "points": [[2, 65], [74, 65], [74, 75], [2, 75]], "difficult": false, "key_cls": "名称"}, {"transcription": "Redhill", "points": [[2, 77], [74, 77], [74, 87], [2, 87]], "difficult": false, "key_cls": "名称"}, {"transcription": "Pine Ck", "points": [[2, 89], [74, 89], [74, 99], [2, 99]], "difficult": false, "key_cls": "名称"}, {"transcription": "Stewarts Ck 5", "points": [[2, 101], [74, 101], [74, 111], [2, 111]], "difficult": false, "key_cls": "名称"}, {"transcription": "Glendhu 2", "points": [[2, 113], [74, 113], [74, 123], [2, 123]], "difficult": false, "key_cls": "名称"}, {"transcription": "Cathedral Peak 2", "points": [[2, 125], [74, 125], [74, 135], [2, 135]], "difficult": false, "key_cls": "名称"}, {"transcription": "Cathedral Peak 3", "points": [[2, 135], [74, 135], [74, 145], [2, 145]], "difficult": false, "key_cls": "名称"}, {"transcription": "Lambrechtsbos A", "points": [[2, 148], [74, 148], [74, 158], [2, 158]], "difficult": false, "key_cls": "名称"}, {"transcription": "Lambrechtsbos B", "points": [[2, 159], [74, 159], [74, 169], [2, 169]], "difficult": false, "key_cls": "名称"}, {"transcription": "Biesievlei", "points": [[2, 171], [74, 171], [74, 181], [2, 181]], "difficult": false, "key_cls": "名称"}]


问题

示例代码

from paddleocr import PaddleOCR

ocr = PaddleOCR(
    use_doc_orientation_classify=False, # 通过 use_doc_orientation_classify 参数指定不使用文档方向分类模型
    use_doc_unwarping=False, # 通过 use_doc_unwarping 参数指定不使用文本图像矫正模型
    use_textline_orientation=False, # 通过 use_textline_orientation 参数指定不使用文本行方向分类模型
)
result = ocr.predict("./general_ocr_002.png")
for res in result:
    res.print()
    res.save_to_img("output")
    res.save_to_json("output")

那么使用 PP-OCRv5_server_det 进行检测时, 要如何也把 key_cls 参数给返回来?要怎么操?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions