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
7bcabe0f
Commit
7bcabe0f
authored
Jun 22, 2021
by
MissPenguin
Browse files
refine
parent
6e1cfb05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
tools/program.py
tools/program.py
+8
-2
No files found.
tools/program.py
View file @
7bcabe0f
...
...
@@ -210,7 +210,10 @@ def train(config,
images
=
batch
[
0
]
if
use_srn
:
model_average
=
True
preds
=
model
(
images
,
data
=
batch
[
1
:])
if
use_srn
or
model_type
==
'table'
:
preds
=
model
(
images
,
data
=
batch
[
1
:])
else
:
preds
=
model
(
images
)
loss
=
loss_class
(
preds
,
batch
)
avg_loss
=
loss
[
'loss'
]
avg_loss
.
backward
()
...
...
@@ -356,7 +359,10 @@ def eval(model,
break
images
=
batch
[
0
]
start
=
time
.
time
()
preds
=
model
(
images
,
data
=
batch
[
1
:])
if
use_srn
or
model_type
==
'table'
:
preds
=
model
(
images
,
data
=
batch
[
1
:])
else
:
preds
=
model
(
images
)
batch
=
[
item
.
numpy
()
for
item
in
batch
]
# Obtain usable results from post-processing methods
total_time
+=
time
.
time
()
-
start
...
...
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