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

批量识别下,输出异常问题 #284

Closed
AlvinPPP opened this issue Dec 29, 2023 · 6 comments
Closed

批量识别下,输出异常问题 #284

AlvinPPP opened this issue Dec 29, 2023 · 6 comments

Comments

@AlvinPPP
Copy link

image
使用3张图片进行批量测试,旧版的csv虽然乱码,但可以经txt转下编码规则能还原;
最新的2.0.1版,输出结果只有第1行的标题了,没有内容,所以是个1kb文件。
image

@hiroi-sora
Copy link
Owner

我这边测试是正常的啊。你试试在命令行打开Umi,或者运行 UmiOCR-data\RUN_CLI.bat ,看看批量输出的时候有没有什么报错?

@AlvinPPP
Copy link
Author

image
按你提示的,我运行了UmiOCR-data\RUN_CLI.bat,这段输出有异常,不过我也不晓得“mbcs”编码是啥;
但既然你测试是正常的,那属于我电脑的问题?就普普通通win10。

@hiroi-sora
Copy link
Owner

不,看起来是某些文字无法被正确编码,不是系统问题。你把测试图片发上来我看看

@AlvinPPP
Copy link
Author

3ba14705d5e7fdc2e9975a79256b616

因为测试对象是发票,涉及到一些隐私;我使用[忽略区域]功能排查一下,上图这个区域被忽略时,其他部分可以正常输出结果。
我将其单独截取出来,放入批量处理,同样也是无法输出结果的。
我也好奇更具体是哪一小段出问题,于是继续忽略区域来起个;最后发现下面这个截图部分放入批量识别时也无法输出结果;但奇怪的是,在完整图片中,我单独忽略这一小块的区域时,又没法像第一段描述那样输出结果。(可能是我切得不精准?)
最终

总之,单独看图片,没觉得有啥问题,txt之类的格式也正常。你参考下看看。

@hiroi-sora
Copy link
Owner

hiroi-sora commented Dec 29, 2023

你提供的图片很有用,经测试发现是符号¥的问题。

正常情况下符号是可以正常编码的。但是Rapid引擎会神奇地输出¥符号。它们俩看上去很像:¥ ¥,但编码不同(\xefbfa5 \xc2a5)。会导致csv出错。

如果用Paddle引擎则不会有这个问题。txt采用utf-8编码,也不会出现问题。只有csv不行。

知道问题就好办了,我已经更新了补丁,你可以通过下述方式修正程序:

  1. 这里 拷贝所有内容。

  2. 用记事本打开 UmiOCR-data\py_src\ocr\output\output_csv.py ,清空,将上述内容粘贴进去。

更新这个补丁后,输出csv将能够应对各种特殊字符。

@AlvinPPP
Copy link
Author

已按新的output_csv测试,此问题得以修复。

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