Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
06b943f9
Unverified
Commit
06b943f9
authored
Aug 02, 2020
by
xiaoting
Committed by
GitHub
Aug 02, 2020
Browse files
Merge pull request #420 from BeyondYourself/develop
Common modules do not need to be executed repeatedly
parents
5a0a193e
1a0848a4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+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
No files found.
ppocr/data/det/dataset_traversal.py
View file @
06b943f9
...
...
@@ -37,16 +37,16 @@ class TrainReader(object):
self
.
process
=
create_module
(
params
[
'process_function'
])(
params
)
def
__call__
(
self
,
process_id
):
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
)
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
():
random
.
shuffle
(
img_id_list
)
for
img_id
in
range
(
process_id
,
img_num
,
self
.
num_workers
):
label_infor
=
label_infor_list
[
img_id_list
[
img_id
]]
outs
=
self
.
process
(
label_infor
)
...
...
ppocr/utils/save_load.py
View file @
06b943f9
...
...
@@ -21,7 +21,6 @@ import os
import
shutil
import
tempfile
import
paddle
import
paddle.fluid
as
fluid
from
.utility
import
initial_logger
...
...
@@ -113,14 +112,12 @@ def init_model(config, program, exe):
path
=
checkpoints
fluid
.
load
(
program
,
path
,
exe
)
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
return
pretrain_weights
=
config
[
'Global'
].
get
(
'pretrain_weights'
)
if
pretrain_weights
:
path
=
pretrain_weights
load_params
(
exe
,
program
,
path
)
logger
.
info
(
"Finish initing model from {}"
.
format
(
path
))
return
def
save_model
(
program
,
model_path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment