Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

PP-OCRv4在线体验版使用离线推理的效果不一致 #12114

Closed
linssonSUSUSU opened this issue May 14, 2024 · 8 comments
Closed

PP-OCRv4在线体验版使用离线推理的效果不一致 #12114

linssonSUSUSU opened this issue May 14, 2024 · 8 comments
Assignees

Comments

@linssonSUSUSU
Copy link

无法获取在线体验版的使用的模型版本,分别尝试了det模型的ch_PP-OCRv4 infer版和server_infer版,以及rec模型的infer版和server_infer版,发现效果均差于线上体验版。
例如识别图片:
香菇粉

  • 线上版结果:
    Black Sesame Mushroom Powder 黑芝麻香菇粉 ESTLADY
    -离线版结果:
    ('Black', 0.9862731099128723)
    ('Desame', 0.8805373311042786)
    ('Mushroom Powder', 0.9594960808753967)
    ('黑芝麻香菇粉', 0.9991157054901123)
    对比结果离线版错将Sesame识别为Desame,漏掉了NESTLADY
@TingquanGao
Copy link
Collaborator

在线体验版是AIStudio平台的在线体验吗?

@gudufengzhongyipilang
Copy link

我也遇到了同样的情况,体验版地址:https://aistudio.baidu.com/community/app/91660

@gudufengzhongyipilang
Copy link

我也遇到了同样的情况,体验版地址:https://aistudio.baidu.com/community/app/91660

@TingquanGao

@linssonSUSUSU
Copy link
Author

在线体验版是AIStudio平台的在线体验吗?

是的是的,https://aistudio.baidu.com/community/app/91660

@UserWangZz
Copy link
Collaborator

目前定位到的问题可能是线上上传图片后,图片被压缩导致的。
线上使用det_server和rec_server模型
我们使用server模型和mobile模型进行测试结果如下
mobile模型:
[2024/05/23 08:32:38] ppocr DEBUG: Black, 0.986
[2024/05/23 08:32:38] ppocr DEBUG: Desame, 0.881
[2024/05/23 08:32:38] ppocr DEBUG: Mushroom Powder, 0.959
[2024/05/23 08:32:38] ppocr DEBUG: 黑芝麻香菇粉, 0.999
server模型
[2024/05/23 08:38:03] ppocr DEBUG: Black, 0.995
[2024/05/23 08:38:03] ppocr DEBUG: Mushroom Powder, 0.971
[2024/05/23 08:38:03] ppocr DEBUG: 黑芝麻香菇粉, 0.997
[2024/05/23 08:38:03] ppocr DEBUG: ESTLADY, 0.946
对图片进行裁切后,使用server模型推理:
[2024/05/23 08:47:58] ppocr DEBUG: Black, 0.992
[2024/05/23 08:47:58] ppocr DEBUG: S, 0.976
[2024/05/23 08:47:58] ppocr DEBUG: esame, 0.995
[2024/05/23 08:47:58] ppocr DEBUG: Mushroom Powder, 0.964
[2024/05/23 08:47:58] ppocr DEBUG: 黑芝麻香菇粉, 0.996
[2024/05/23 08:47:58] ppocr DEBUG: ESTLADY, 0.985

@gudufengzhongyipilang
Copy link

我与原题主的测试图片不相同,但遇到的问题类型是相同的:某一行文字漏检。对于我来说线上版本的检测结果很理想,但离线模型就会出现漏检;补充说明下:我是通过pip install paddleocr安装,检测代码为

from paddleocr import PaddleOCR 
res = PaddleOCR(use_angle_cls=True, lang="ch").ocr(img_arr, cls=True)[0]
print(res )

期间,我查阅了其他issue,使用了多种trick,比如调参:det_db_threshdet_db_score_mode->slowdet_limit_side_len之类,或者对待测图片做padding等方式;整体检测结果有提升但仍达不到线上的效果。

从您 @UserWangZz 的检测结果上来看 离线server模型下也出现了漏检Sesame单词的情况,确实逊色于线上的结果。您一开始说的:线上上传图片后,图片被压缩导致该问题;但是直觉上来说,图片被压缩应该效果会更差 (`・ω・´)

通过您的实验,我的疑问是:
1、是否由于线上版本参数设置和离线模型的参数设置有异,导致它们的结果不相同
2、线上版本是否对被测图像有其他处理
3、从您的实验看,对图片进行裁切后效果提升显著,可以具体说说是怎样进行裁切处理的吗

@UserWangZz
Copy link
Collaborator

我与原题主的测试图片不相同,但遇到的问题类型是相同的:某一行文字漏检。对于我来说线上版本的检测结果很理想,但离线模型就会出现漏检;补充说明下:我是通过pip install paddleocr安装,检测代码为

from paddleocr import PaddleOCR 
res = PaddleOCR(use_angle_cls=True, lang="ch").ocr(img_arr, cls=True)[0]
print(res )

期间,我查阅了其他issue,使用了多种trick,比如调参:det_db_threshdet_db_score_mode->slowdet_limit_side_len之类,或者对待测图片做padding等方式;整体检测结果有提升但仍达不到线上的效果。

从您 @UserWangZz 的检测结果上来看 离线server模型下也出现了漏检Sesame单词的情况,确实逊色于线上的结果。您一开始说的:线上上传图片后,图片被压缩导致该问题;但是直觉上来说,图片被压缩应该效果会更差 (`・ω・´)

通过您的实验,我的疑问是: 1、是否由于线上版本参数设置和离线模型的参数设置有异,导致它们的结果不相同 2、线上版本是否对被测图像有其他处理 3、从您的实验看,对图片进行裁切后效果提升显著,可以具体说说是怎样进行裁切处理的吗

Q1: 线上和离线模型参数一致
Q2:线上没有对图片进行其他的预处理
线上和离线模型参数设置,推理模型等均一致
Q3:对图片仅简单裁切,相当于改变了图像的输入大小
下面是实验三的输入图片:
text2

@gudufengzhongyipilang
Copy link

好的明了了~
实在不行我就买智能云上ocr的api用吧ヽ(ー_ー)ノ

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators May 25, 2024
@SWHL SWHL converted this issue into discussion #12262 May 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants