Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
f85b3ea8
P
PaddleOCR
项目概览
weixin_41840029
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f85b3ea8
编写于
3月 18, 2022
作者:
文幕地方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug in whl import fce
上级
496887f8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
14 deletion
+9
-14
MANIFEST.in
MANIFEST.in
+1
-1
paddleocr.py
paddleocr.py
+8
-12
tools/infer/utility.py
tools/infer/utility.py
+0
-1
未找到文件。
MANIFEST.in
浏览文件 @
f85b3ea8
include LICENSE
include LICENSE
include README.md
include README.md
recursive-include ppocr/utils *.
txt utility.py logging.py network.py
recursive-include ppocr/utils *.
*
recursive-include ppocr/data *.py
recursive-include ppocr/data *.py
recursive-include ppocr/postprocess *.py
recursive-include ppocr/postprocess *.py
recursive-include tools/infer *.py
recursive-include tools/infer *.py
...
...
paddleocr.py
浏览文件 @
f85b3ea8
...
@@ -42,7 +42,7 @@ __all__ = [
...
@@ -42,7 +42,7 @@ __all__ = [
]
]
SUPPORT_DET_MODEL
=
[
'DB'
]
SUPPORT_DET_MODEL
=
[
'DB'
]
VERSION
=
'2.4.0.
1
'
VERSION
=
'2.4.0.
2
'
SUPPORT_REC_MODEL
=
[
'CRNN'
]
SUPPORT_REC_MODEL
=
[
'CRNN'
]
BASE_DIR
=
os
.
path
.
expanduser
(
"~/.paddleocr/"
)
BASE_DIR
=
os
.
path
.
expanduser
(
"~/.paddleocr/"
)
...
@@ -308,20 +308,18 @@ class PaddleOCR(predict_system.TextSystem):
...
@@ -308,20 +308,18 @@ class PaddleOCR(predict_system.TextSystem):
det_lang
)
det_lang
)
params
.
det_model_dir
,
det_url
=
confirm_model_dir_url
(
params
.
det_model_dir
,
det_url
=
confirm_model_dir_url
(
params
.
det_model_dir
,
params
.
det_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
VERSION
,
'ocr
'
,
'det'
,
det_lang
),
os
.
path
.
join
(
BASE_DIR
,
'whl
'
,
'det'
,
det_lang
),
det_model_config
[
'url'
])
det_model_config
[
'url'
])
rec_model_config
=
get_model_config
(
'OCR'
,
params
.
ocr_version
,
'rec'
,
rec_model_config
=
get_model_config
(
'OCR'
,
params
.
ocr_version
,
'rec'
,
lang
)
lang
)
params
.
rec_model_dir
,
rec_url
=
confirm_model_dir_url
(
params
.
rec_model_dir
,
rec_url
=
confirm_model_dir_url
(
params
.
rec_model_dir
,
params
.
rec_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
VERSION
,
'ocr'
,
'rec'
,
lang
),
os
.
path
.
join
(
BASE_DIR
,
'whl'
,
'rec'
,
lang
),
rec_model_config
[
'url'
])
rec_model_config
[
'url'
])
cls_model_config
=
get_model_config
(
'OCR'
,
params
.
ocr_version
,
'cls'
,
cls_model_config
=
get_model_config
(
'OCR'
,
params
.
ocr_version
,
'cls'
,
'ch'
)
'ch'
)
params
.
cls_model_dir
,
cls_url
=
confirm_model_dir_url
(
params
.
cls_model_dir
,
cls_url
=
confirm_model_dir_url
(
params
.
cls_model_dir
,
params
.
cls_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
VERSION
,
'ocr'
,
'cls'
),
os
.
path
.
join
(
BASE_DIR
,
'whl'
,
'cls'
),
cls_model_config
[
'url'
])
cls_model_config
[
'url'
])
# download model
# download model
maybe_download
(
params
.
det_model_dir
,
det_url
)
maybe_download
(
params
.
det_model_dir
,
det_url
)
maybe_download
(
params
.
rec_model_dir
,
rec_url
)
maybe_download
(
params
.
rec_model_dir
,
rec_url
)
...
@@ -412,20 +410,18 @@ class PPStructure(OCRSystem):
...
@@ -412,20 +410,18 @@ class PPStructure(OCRSystem):
det_lang
)
det_lang
)
params
.
det_model_dir
,
det_url
=
confirm_model_dir_url
(
params
.
det_model_dir
,
det_url
=
confirm_model_dir_url
(
params
.
det_model_dir
,
params
.
det_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
VERSION
,
'ocr
'
,
'det'
,
det_lang
),
os
.
path
.
join
(
BASE_DIR
,
'whl
'
,
'det'
,
det_lang
),
det_model_config
[
'url'
])
det_model_config
[
'url'
])
rec_model_config
=
get_model_config
(
'OCR'
,
params
.
ocr_version
,
'rec'
,
rec_model_config
=
get_model_config
(
'OCR'
,
params
.
ocr_version
,
'rec'
,
lang
)
lang
)
params
.
rec_model_dir
,
rec_url
=
confirm_model_dir_url
(
params
.
rec_model_dir
,
rec_url
=
confirm_model_dir_url
(
params
.
rec_model_dir
,
params
.
rec_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
VERSION
,
'ocr'
,
'rec'
,
lang
),
os
.
path
.
join
(
BASE_DIR
,
'whl'
,
'rec'
,
lang
),
rec_model_config
[
'url'
])
rec_model_config
[
'url'
])
table_model_config
=
get_model_config
(
table_model_config
=
get_model_config
(
'STRUCTURE'
,
params
.
structure_version
,
'table'
,
'en'
)
'STRUCTURE'
,
params
.
structure_version
,
'table'
,
'en'
)
params
.
table_model_dir
,
table_url
=
confirm_model_dir_url
(
params
.
table_model_dir
,
table_url
=
confirm_model_dir_url
(
params
.
table_model_dir
,
params
.
table_model_dir
,
os
.
path
.
join
(
BASE_DIR
,
VERSION
,
'ocr'
,
'table'
),
os
.
path
.
join
(
BASE_DIR
,
'whl'
,
'table'
),
table_model_config
[
'url'
])
table_model_config
[
'url'
])
# download model
# download model
maybe_download
(
params
.
det_model_dir
,
det_url
)
maybe_download
(
params
.
det_model_dir
,
det_url
)
maybe_download
(
params
.
rec_model_dir
,
rec_url
)
maybe_download
(
params
.
rec_model_dir
,
rec_url
)
...
@@ -499,4 +495,4 @@ def main():
...
@@ -499,4 +495,4 @@ def main():
for
item
in
result
:
for
item
in
result
:
item
.
pop
(
'img'
)
item
.
pop
(
'img'
)
logger
.
info
(
item
)
logger
.
info
(
item
)
\ No newline at end of file
tools/infer/utility.py
浏览文件 @
f85b3ea8
...
@@ -622,7 +622,6 @@ def get_rotate_crop_image(img, points):
...
@@ -622,7 +622,6 @@ def get_rotate_crop_image(img, points):
def
check_gpu
(
use_gpu
):
def
check_gpu
(
use_gpu
):
if
use_gpu
and
not
paddle
.
is_compiled_with_cuda
():
if
use_gpu
and
not
paddle
.
is_compiled_with_cuda
():
use_gpu
=
False
use_gpu
=
False
return
use_gpu
return
use_gpu
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录