Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f4f2b5a

Browse files
committed
m
1 parent 618203a commit f4f2b5a

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

‎yeke/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
+ [py-minesweep](https://github.com/JustDoPython/python-examples/tree/master/yeke/py-minesweep) :用 Python 实现扫雷小游戏
1919
+ [py-ascii](https://github.com/JustDoPython/python-examples/tree/master/yeke/py-ascii) :Python 实现图片转字符画,静态图、GIF 都能转
2020
+ [py-snow](https://github.com/JustDoPython/python-examples/tree/master/yeke/py-snow) :用 Python 实现带音乐的雪花飘落雪景图
21+
+ [py-discern](https://github.com/JustDoPython/python-examples/tree/master/yeke/py-discern) :十行 Python 代码就提取了韦小宝的身份证信息
2122

2223
---
2324

‎yeke/py-discern/__init__.py‎

Whitespace-only changes.

‎yeke/py-discern/card.jpg‎

144 KB
Loading[フレーム]

‎yeke/py-discern/idcard_discern.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from aip import AipOcr
2+
3+
APP_ID = ''
4+
API_KEY = ''
5+
SECRET_KEY = ''
6+
# 创建客户端对象
7+
client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
8+
# 打开并读取文件内容
9+
fp = open("card.jpg", "rb").read()
10+
# res = client.basicGeneral(fp) # 普通
11+
res = client.basicAccurate(fp) # 高精度
12+
# 遍历结果
13+
for tex in res["words_result"]:
14+
row = tex["words"]
15+
print(row)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /