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

看起来不支持识别大写字母 #231

Open
hjdhnx opened this issue Oct 10, 2024 · 4 comments
Open

看起来不支持识别大写字母 #231

hjdhnx opened this issue Oct 10, 2024 · 4 comments

Comments

@hjdhnx
Copy link

hjdhnx commented Oct 10, 2024

我用大写字母的图片进行识别,预期是D,识别结果却是小写的d

from ddddocr import DdddOcr
import unittest

ocr = DdddOcr(show_ad=False, beta=True)


class TestOcr(unittest.TestCase):
    def test_ocr_d(self):
        with open('test.png', 'rb') as f:
            ocr.set_ranges(2)
            text1 = ocr.classification(f.read())
            ret = text1[:1]
            self.assertEqual(ret, 'D')


if __name__ == '__main__':
    unittest.main()

测试图片如图:
test

@xia0028
Copy link

xia0028 commented Oct 12, 2024

我也是,数字7识别为/

@hjdhnx
Copy link
Author

hjdhnx commented Oct 12, 2024

我也是,数字7识别为/

我解决问题了,可以参考我这个项目 https://github.com/hjdhnx/font-decoder
使用了微信ocr拿来针对ddddocr识别出的英文字母,矫正大小写问题

@lotomer
Copy link

lotomer commented Oct 18, 2024

已经提交pull request,等待合并。如果着急,可以参考修改的部分手动修改本地对应的__init__.py文件:

@hjdhnx
Copy link
Author

hjdhnx commented Oct 18, 2024

已经提交pull request,等待合并。如果着急,可以参考修改的部分手动修改本地对应的__init__.py文件:

大佬666,膜拜大佬

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

3 participants