Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
0a6e86ec
P
PaddleOCR
项目概览
s920243400
/
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看板
未验证
提交
0a6e86ec
编写于
12月 22, 2020
作者:
D
dyning
提交者:
GitHub
12月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1553 from LDOUBLEV/dyg_db
add export to limit GPU-memory-usage
上级
45f647db
2a04e1a1
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
17 addition
and
2 deletion
+17
-2
tools/infer/predict_cls.py
tools/infer/predict_cls.py
+2
-0
tools/infer/predict_det.py
tools/infer/predict_det.py
+2
-0
tools/infer/predict_rec.py
tools/infer/predict_rec.py
+2
-0
tools/infer/predict_system.py
tools/infer/predict_system.py
+2
-0
tools/infer/utility.py
tools/infer/utility.py
+3
-2
tools/infer_cls.py
tools/infer_cls.py
+2
-0
tools/infer_det.py
tools/infer_det.py
+2
-0
tools/infer_rec.py
tools/infer_rec.py
+2
-0
未找到文件。
tools/infer/predict_cls.py
浏览文件 @
0a6e86ec
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
import
copy
import
copy
import
numpy
as
np
import
numpy
as
np
...
...
tools/infer/predict_det.py
浏览文件 @
0a6e86ec
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
import
numpy
as
np
import
numpy
as
np
import
time
import
time
...
...
tools/infer/predict_rec.py
浏览文件 @
0a6e86ec
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
import
numpy
as
np
import
numpy
as
np
import
math
import
math
...
...
tools/infer/predict_system.py
浏览文件 @
0a6e86ec
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -18,6 +18,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
import
copy
import
copy
import
numpy
as
np
import
numpy
as
np
...
...
tools/infer/utility.py
浏览文件 @
0a6e86ec
...
@@ -33,7 +33,7 @@ def parse_args():
...
@@ -33,7 +33,7 @@ def parse_args():
parser
.
add_argument
(
"--ir_optim"
,
type
=
str2bool
,
default
=
True
)
parser
.
add_argument
(
"--ir_optim"
,
type
=
str2bool
,
default
=
True
)
parser
.
add_argument
(
"--use_tensorrt"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--use_tensorrt"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--use_fp16"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--use_fp16"
,
type
=
str2bool
,
default
=
False
)
parser
.
add_argument
(
"--gpu_mem"
,
type
=
int
,
default
=
80
00
)
parser
.
add_argument
(
"--gpu_mem"
,
type
=
int
,
default
=
5
00
)
# params for text detector
# params for text detector
parser
.
add_argument
(
"--image_dir"
,
type
=
str
)
parser
.
add_argument
(
"--image_dir"
,
type
=
str
)
...
@@ -62,7 +62,7 @@ def parse_args():
...
@@ -62,7 +62,7 @@ def parse_args():
parser
.
add_argument
(
"--rec_model_dir"
,
type
=
str
)
parser
.
add_argument
(
"--rec_model_dir"
,
type
=
str
)
parser
.
add_argument
(
"--rec_image_shape"
,
type
=
str
,
default
=
"3, 32, 320"
)
parser
.
add_argument
(
"--rec_image_shape"
,
type
=
str
,
default
=
"3, 32, 320"
)
parser
.
add_argument
(
"--rec_char_type"
,
type
=
str
,
default
=
'ch'
)
parser
.
add_argument
(
"--rec_char_type"
,
type
=
str
,
default
=
'ch'
)
parser
.
add_argument
(
"--rec_batch_num"
,
type
=
int
,
default
=
1
)
parser
.
add_argument
(
"--rec_batch_num"
,
type
=
int
,
default
=
6
)
parser
.
add_argument
(
"--max_text_length"
,
type
=
int
,
default
=
25
)
parser
.
add_argument
(
"--max_text_length"
,
type
=
int
,
default
=
25
)
parser
.
add_argument
(
parser
.
add_argument
(
"--rec_char_dict_path"
,
"--rec_char_dict_path"
,
...
@@ -123,6 +123,7 @@ def create_predictor(args, mode, logger):
...
@@ -123,6 +123,7 @@ def create_predictor(args, mode, logger):
# cache 10 different shapes for mkldnn to avoid memory leak
# cache 10 different shapes for mkldnn to avoid memory leak
config
.
set_mkldnn_cache_capacity
(
10
)
config
.
set_mkldnn_cache_capacity
(
10
)
config
.
enable_mkldnn
()
config
.
enable_mkldnn
()
args
.
rec_batch_num
=
1
# config.enable_memory_optim()
# config.enable_memory_optim()
config
.
disable_glog_info
()
config
.
disable_glog_info
()
...
...
tools/infer_cls.py
浏览文件 @
0a6e86ec
...
@@ -25,6 +25,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -25,6 +25,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
paddle
import
paddle
from
ppocr.data
import
create_operators
,
transform
from
ppocr.data
import
create_operators
,
transform
...
...
tools/infer_det.py
浏览文件 @
0a6e86ec
...
@@ -25,6 +25,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -25,6 +25,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
cv2
import
cv2
import
json
import
json
import
paddle
import
paddle
...
...
tools/infer_rec.py
浏览文件 @
0a6e86ec
...
@@ -25,6 +25,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
...
@@ -25,6 +25,8 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'..'
)))
os
.
environ
[
"FLAGS_allocator_strategy"
]
=
'auto_growth'
import
paddle
import
paddle
from
ppocr.data
import
create_operators
,
transform
from
ppocr.data
import
create_operators
,
transform
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录