Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
0ee6137d
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看板
提交
0ee6137d
编写于
6月 08, 2021
作者:
W
WenmuZhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
del pad
上级
4290c697
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
6 addition
and
15 deletion
+6
-15
ppocr/data/imaug/operators.py
ppocr/data/imaug/operators.py
+5
-9
ppstructure/predict_system.py
ppstructure/predict_system.py
+1
-2
tools/infer/predict_det.py
tools/infer/predict_det.py
+0
-2
tools/infer/utility.py
tools/infer/utility.py
+0
-2
未找到文件。
ppocr/data/imaug/operators.py
浏览文件 @
0ee6137d
...
@@ -122,8 +122,6 @@ class DetResizeForTest(object):
...
@@ -122,8 +122,6 @@ class DetResizeForTest(object):
elif
'limit_side_len'
in
kwargs
:
elif
'limit_side_len'
in
kwargs
:
self
.
limit_side_len
=
kwargs
[
'limit_side_len'
]
self
.
limit_side_len
=
kwargs
[
'limit_side_len'
]
self
.
limit_type
=
kwargs
.
get
(
'limit_type'
,
'min'
)
self
.
limit_type
=
kwargs
.
get
(
'limit_type'
,
'min'
)
self
.
pad
=
kwargs
.
get
(
'pad'
,
False
)
self
.
pad_size
=
kwargs
.
get
(
'pad_size'
,
480
)
elif
'resize_long'
in
kwargs
:
elif
'resize_long'
in
kwargs
:
self
.
resize_type
=
2
self
.
resize_type
=
2
self
.
resize_long
=
kwargs
.
get
(
'resize_long'
,
960
)
self
.
resize_long
=
kwargs
.
get
(
'resize_long'
,
960
)
...
@@ -174,11 +172,9 @@ class DetResizeForTest(object):
...
@@ -174,11 +172,9 @@ class DetResizeForTest(object):
ratio
=
float
(
limit_side_len
)
/
h
ratio
=
float
(
limit_side_len
)
/
h
else
:
else
:
ratio
=
float
(
limit_side_len
)
/
w
ratio
=
float
(
limit_side_len
)
/
w
elif
self
.
pad
:
ratio
=
float
(
self
.
pad_size
)
/
max
(
h
,
w
)
else
:
else
:
ratio
=
1.
ratio
=
1.
el
se
:
el
if
self
.
limit_type
==
'min'
:
if
min
(
h
,
w
)
<
limit_side_len
:
if
min
(
h
,
w
)
<
limit_side_len
:
if
h
<
w
:
if
h
<
w
:
ratio
=
float
(
limit_side_len
)
/
h
ratio
=
float
(
limit_side_len
)
/
h
...
@@ -186,6 +182,10 @@ class DetResizeForTest(object):
...
@@ -186,6 +182,10 @@ class DetResizeForTest(object):
ratio
=
float
(
limit_side_len
)
/
w
ratio
=
float
(
limit_side_len
)
/
w
else
:
else
:
ratio
=
1.
ratio
=
1.
elif
self
.
limit_type
==
'resize_long'
:
ratio
=
float
(
limit_side_len
)
/
max
(
h
,
w
)
else
:
raise
Exception
(
'not support limit type, image '
)
resize_h
=
int
(
h
*
ratio
)
resize_h
=
int
(
h
*
ratio
)
resize_w
=
int
(
w
*
ratio
)
resize_w
=
int
(
w
*
ratio
)
...
@@ -201,10 +201,6 @@ class DetResizeForTest(object):
...
@@ -201,10 +201,6 @@ class DetResizeForTest(object):
sys
.
exit
(
0
)
sys
.
exit
(
0
)
ratio_h
=
resize_h
/
float
(
h
)
ratio_h
=
resize_h
/
float
(
h
)
ratio_w
=
resize_w
/
float
(
w
)
ratio_w
=
resize_w
/
float
(
w
)
if
self
.
limit_type
==
'max'
and
self
.
pad
:
padding_im
=
np
.
zeros
((
self
.
pad_size
,
self
.
pad_size
,
c
),
dtype
=
np
.
float32
)
padding_im
[:
resize_h
,
:
resize_w
,
:]
=
img
img
=
padding_im
return
img
,
[
ratio_h
,
ratio_w
]
return
img
,
[
ratio_h
,
ratio_w
]
def
resize_image_type2
(
self
,
img
):
def
resize_image_type2
(
self
,
img
):
...
...
ppstructure/predict_system.py
浏览文件 @
0ee6137d
...
@@ -38,8 +38,7 @@ logger = get_logger()
...
@@ -38,8 +38,7 @@ logger = get_logger()
class
OCRSystem
(
object
):
class
OCRSystem
(
object
):
def
__init__
(
self
,
args
):
def
__init__
(
self
,
args
):
args
.
det_pad
=
True
args
.
det_limit_type
=
'resize_long'
args
.
det_pad_size
=
960
args
.
drop_score
=
0
args
.
drop_score
=
0
self
.
text_system
=
TextSystem
(
args
)
self
.
text_system
=
TextSystem
(
args
)
self
.
table_system
=
TableSystem
(
args
,
self
.
text_system
.
text_detector
,
self
.
text_system
.
text_recognizer
)
self
.
table_system
=
TableSystem
(
args
,
self
.
text_system
.
text_detector
,
self
.
text_system
.
text_recognizer
)
...
...
tools/infer/predict_det.py
浏览文件 @
0ee6137d
...
@@ -42,8 +42,6 @@ class TextDetector(object):
...
@@ -42,8 +42,6 @@ class TextDetector(object):
'DetResizeForTest'
:
{
'DetResizeForTest'
:
{
'limit_side_len'
:
args
.
det_limit_side_len
,
'limit_side_len'
:
args
.
det_limit_side_len
,
'limit_type'
:
args
.
det_limit_type
,
'limit_type'
:
args
.
det_limit_type
,
'pad'
:
args
.
det_pad
,
'pad_size'
:
args
.
det_pad_size
}
}
},
{
},
{
'NormalizeImage'
:
{
'NormalizeImage'
:
{
...
...
tools/infer/utility.py
浏览文件 @
0ee6137d
...
@@ -46,8 +46,6 @@ def init_args():
...
@@ -46,8 +46,6 @@ def init_args():
parser
.
add_argument
(
"--det_model_dir"
,
type
=
str
)
parser
.
add_argument
(
"--det_model_dir"
,
type
=
str
)
parser
.
add_argument
(
"--det_limit_side_len"
,
type
=
float
,
default
=
960
)
parser
.
add_argument
(
"--det_limit_side_len"
,
type
=
float
,
default
=
960
)
parser
.
add_argument
(
"--det_limit_type"
,
type
=
str
,
default
=
'max'
)
parser
.
add_argument
(
"--det_limit_type"
,
type
=
str
,
default
=
'max'
)
parser
.
add_argument
(
"--det_pad"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--det_pad_size"
,
type
=
int
,
default
=
640
)
# DB parmas
# DB parmas
parser
.
add_argument
(
"--det_db_thresh"
,
type
=
float
,
default
=
0.3
)
parser
.
add_argument
(
"--det_db_thresh"
,
type
=
float
,
default
=
0.3
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录