Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
5069baf0
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看板
未验证
提交
5069baf0
编写于
10月 22, 2020
作者:
L
littletomatodonkey
提交者:
GitHub
10月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #622 from BeyondYourself/BeyondYourself-barnch-8-27
fix the file read
上级
606f869d
93df86ca
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
3 deletion
+15
-3
ppocr/data/det/sast_process.py
ppocr/data/det/sast_process.py
+1
-1
ppocr/utils/utility.py
ppocr/utils/utility.py
+12
-0
tools/program.py
tools/program.py
+2
-2
未找到文件。
ppocr/data/det/sast_process.py
浏览文件 @
5069baf0
...
...
@@ -599,7 +599,7 @@ class SASTProcessTrain(object):
"""
text_polys
,
txt_tags
,
txts
=
[],
[],
[]
with
open
(
poly_txt_path
)
as
f
:
with
open
(
poly_txt_path
,
'rb'
)
as
f
:
for
line
in
f
.
readlines
():
poly_str
,
txt
=
line
.
strip
().
split
(
'
\t
'
)
poly
=
map
(
float
,
poly_str
.
split
(
','
))
...
...
ppocr/utils/utility.py
浏览文件 @
5069baf0
...
...
@@ -90,3 +90,15 @@ def check_and_read_gif(img_path):
return
imgvalue
,
True
return
None
,
False
def
create_multi_devices_program
(
program
,
loss_var_name
):
build_strategy
=
fluid
.
BuildStrategy
()
build_strategy
.
memory_optimize
=
False
build_strategy
.
enable_inplace
=
True
exec_strategy
=
fluid
.
ExecutionStrategy
()
exec_strategy
.
num_iteration_per_drop_scope
=
1
compile_program
=
fluid
.
CompiledProgram
(
program
).
with_data_parallel
(
loss_name
=
loss_var_name
,
build_strategy
=
build_strategy
,
exec_strategy
=
exec_strategy
)
return
compile_program
tools/program.py
浏览文件 @
5069baf0
...
...
@@ -90,13 +90,13 @@ def load_config(file_path):
merge_config
(
default_config
)
_
,
ext
=
os
.
path
.
splitext
(
file_path
)
assert
ext
in
[
'.yml'
,
'.yaml'
],
"only support yaml files for now"
merge_config
(
yaml
.
load
(
open
(
file_path
),
Loader
=
yaml
.
Loader
))
merge_config
(
yaml
.
load
(
open
(
file_path
,
'rb'
),
Loader
=
yaml
.
Loader
))
assert
"reader_yml"
in
global_config
[
'Global'
],
\
"absence reader_yml in global"
reader_file_path
=
global_config
[
'Global'
][
'reader_yml'
]
_
,
ext
=
os
.
path
.
splitext
(
reader_file_path
)
assert
ext
in
[
'.yml'
,
'.yaml'
],
"only support yaml files for reader"
merge_config
(
yaml
.
load
(
open
(
reader_file_path
),
Loader
=
yaml
.
Loader
))
merge_config
(
yaml
.
load
(
open
(
reader_file_path
,
'rb'
),
Loader
=
yaml
.
Loader
))
return
global_config
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录