Giter Club home page Giter Club logo

Comments (11)

hiroi-sora avatar hiroi-sora commented on July 17, 2024 1

嗯,目前OCR引擎的cv::imread只能读入与系统地区对应编码的路径。而你的系统地区编码是 西欧cp1252 ,这套编码本身不含中文,所以引擎无法在这种系统环境下读取中文路径。

开启windows的UTF-8全球语言支持应该可以解决这个问题,允许读入 含超出cp1252编码的字符 的路径。
image

未来我也许会继续优化引擎,改用 cv::imdecode 等方式载入图片,从根源上解决这个问题,允许原生cp1252等多种系统语言设置。

from umi-ocr.

andongya95 avatar andongya95 commented on July 17, 2024

@hiroi-sora
您可以把之前的issue先close了 我们转到这个来解决

from umi-ocr.

hiroi-sora avatar hiroi-sora commented on July 17, 2024

请试试:打开cmd,

cd /d PaddleOCR-json所在文件夹
PaddleOCR_json.exe

输出 OCR init completed.则正常,按ctrl+c终止它。接下来检查下是否配置文件的问题:

PaddleOCR_json.exe --config_path=PaddleOCR_json_config_简体中文.txt

如果这个也没问题,那就把调用 callingOCR.py
ocr = CallingOCR('填入PaddleOCR_json.exe的路径') 改成:
ocr = CallingOCR('填入PaddleOCR_json.exe的路径' , 'PaddleOCR_json_config_简体中文.txt')

from umi-ocr.

andongya95 avatar andongya95 commented on July 17, 2024

@hiroi-sora 请问有没有可能是因为我用的系统语言是英文 所以没有读取config成功?我在cmd里粘贴config后得到的是
image
PaddleOCR_json.exe --config_path=PaddleOCR_json_config_简体中 文.txt [ERROR] config path not exist! config_dir: PaddleOCR_json_config_????.txt [ERROR] Use det, need {--det_model_dir}. OCR exit.
‘中’ ‘文’ 之间有空格 我不确定是为什么但是我试了几次都是这样

from umi-ocr.

hiroi-sora avatar hiroi-sora commented on July 17, 2024

是的,路径错误,导致配置文件txt未注入。tools.cpp#L208 。估计跟系统语言有关。

尝试:将 PaddleOCR_json_config_简体中文.txt 文件名中的汉字去除,比如改成 PaddleOCR_json_config_zh-CN.txt
cmd运行 PaddleOCR_json.exe --config_path=PaddleOCR_json_config_zh-CN.txt

如果这个OK,则:
打开上一层文件夹的 Umi-OCR_config.json ,将其中 ocrConfig 下的 "path" 也改成这个。
打开Umi-OCR,看看能否正常工作

from umi-ocr.

andongya95 avatar andongya95 commented on July 17, 2024

@hiroi-sora 现在可以正常工作了,谢谢大大!

from umi-ocr.

hiroi-sora avatar hiroi-sora commented on July 17, 2024

那么,Umi-OCR导入中文路径的图片能识别出结果吗?

from umi-ocr.

andongya95 avatar andongya95 commented on July 17, 2024

@hiroi-sora 哈哈哈 确实不可以
拖拽无法读取文件
通过浏览读取后可以进行任务,但是输出结果是

任务开始时间:2022-09-08 22:23:42


≦ 中文测试.png ≧
识别失败,错误码:200
错误信息:Image path not exist. Path:"...\Umi-OCR.v1.2.6\ÖÐÎIJâÊÔ.png"


---
任务结束时间:2022-09-08 22:23:43

from umi-ocr.

hiroi-sora avatar hiroi-sora commented on July 17, 2024

试下测试版

https://wwn.lanzoul.com/b037embad
密码:1111

下载exe,替换掉原来的

from umi-ocr.

andongya95 avatar andongya95 commented on July 17, 2024

有新的报错
image

其他问题还是一样 错误信息变成了

≦ 中文测试.png ≧
识别失败,错误码:200
错误信息:Image path not exist. Path:"C:\\...\\Umi-OCR.v1.2.6\\????.png"

from umi-ocr.

hiroi-sora avatar hiroi-sora commented on July 17, 2024

楼主你好,经过修改引擎,这个问题应该已经从根源上解决了。

测试环境为cp1252西欧语言,未开启UTF-8全球语言支持。如下图,左为旧版引擎,无法识别中文路径。右为新版,可以识别。

chcp 中文路径OKK2!
chcp 中文路径OKK!

(但含emoji表情的路径依然无法识别,软件的拖入功能也用不了,只能通过浏览按钮导入图片。)

可以下载这个exe文件,替换原来的。PaddleOCR_json v1.2.1 alpha 1.zip 。或者在楼上的蓝奏云链接下载。

from umi-ocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.