Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
06b943f9
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看板
未验证
提交
06b943f9
编写于
8月 02, 2020
作者:
X
xiaoting
提交者:
GitHub
8月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #420 from BeyondYourself/develop
Common modules do not need to be executed repeatedly
上级
5a0a193e
1a0848a4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
12 deletion
+9
-12
ppocr/data/det/dataset_traversal.py
ppocr/data/det/dataset_traversal.py
+9
-9
ppocr/utils/save_load.py
ppocr/utils/save_load.py
+0
-3
未找到文件。
ppocr/data/det/dataset_traversal.py
浏览文件 @
06b943f9
...
@@ -36,17 +36,17 @@ class TrainReader(object):
...
@@ -36,17 +36,17 @@ class TrainReader(object):
"absence process_function in Reader"
"absence process_function in Reader"
self
.
process
=
create_module
(
params
[
'process_function'
])(
params
)
self
.
process
=
create_module
(
params
[
'process_function'
])(
params
)
def
__call__
(
self
,
process_id
):
def
__call__
(
self
,
process_id
):
with
open
(
self
.
label_file_path
,
"rb"
)
as
fin
:
label_infor_list
=
fin
.
readlines
()
img_num
=
len
(
label_infor_list
)
img_id_list
=
list
(
range
(
img_num
))
if
sys
.
platform
==
"win32"
and
self
.
num_workers
!=
1
:
print
(
"multiprocess is not fully compatible with Windows."
"num_workers will be 1."
)
self
.
num_workers
=
1
def
sample_iter_reader
():
def
sample_iter_reader
():
with
open
(
self
.
label_file_path
,
"rb"
)
as
fin
:
label_infor_list
=
fin
.
readlines
()
img_num
=
len
(
label_infor_list
)
img_id_list
=
list
(
range
(
img_num
))
random
.
shuffle
(
img_id_list
)
random
.
shuffle
(
img_id_list
)
if
sys
.
platform
==
"win32"
and
self
.
num_workers
!=
1
:
print
(
"multiprocess is not fully compatible with Windows."
"num_workers will be 1."
)
self
.
num_workers
=
1
for
img_id
in
range
(
process_id
,
img_num
,
self
.
num_workers
):
for
img_id
in
range
(
process_id
,
img_num
,
self
.
num_workers
):
label_infor
=
label_infor_list
[
img_id_list
[
img_id
]]
label_infor
=
label_infor_list
[
img_id_list
[
img_id
]]
outs
=
self
.
process
(
label_infor
)
outs
=
self
.
process
(
label_infor
)
...
...
ppocr/utils/save_load.py
浏览文件 @
06b943f9
...
@@ -21,7 +21,6 @@ import os
...
@@ -21,7 +21,6 @@ import os
import
shutil
import
shutil
import
tempfile
import
tempfile
import
paddle
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
.utility
import
initial_logger
from
.utility
import
initial_logger
...
@@ -113,14 +112,12 @@ def init_model(config, program, exe):
...
@@ -113,14 +112,12 @@ def init_model(config, program, exe):
path
=
checkpoints
path
=
checkpoints
fluid
.
load
(
program
,
path
,
exe
)
fluid
.
load
(
program
,
path
,
exe
)
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
return
pretrain_weights
=
config
[
'Global'
].
get
(
'pretrain_weights'
)
pretrain_weights
=
config
[
'Global'
].
get
(
'pretrain_weights'
)
if
pretrain_weights
:
if
pretrain_weights
:
path
=
pretrain_weights
path
=
pretrain_weights
load_params
(
exe
,
program
,
path
)
load_params
(
exe
,
program
,
path
)
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
return
def
save_model
(
program
,
model_path
):
def
save_model
(
program
,
model_path
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录