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
1b2ca6e6
Commit
1b2ca6e6
authored
Aug 30, 2021
by
tink2123
Browse files
polish code
parent
c9e1077d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
8 deletions
+0
-8
ppocr/modeling/transforms/tps.py
ppocr/modeling/transforms/tps.py
+0
-2
tools/program.py
tools/program.py
+0
-4
tools/train.py
tools/train.py
+0
-2
No files found.
ppocr/modeling/transforms/tps.py
View file @
1b2ca6e6
...
...
@@ -326,6 +326,4 @@ class STN_ON(nn.Layer):
image
,
self
.
tps_inputsize
,
mode
=
"bilinear"
,
align_corners
=
True
)
stn_img_feat
,
ctrl_points
=
self
.
stn_head
(
stn_input
)
x
,
_
=
self
.
tps
(
image
,
ctrl_points
)
#print("x:", np.sum(x.numpy()))
# print(x.shape)
return
x
tools/program.py
View file @
1b2ca6e6
...
...
@@ -215,9 +215,6 @@ def train(config,
preds
=
model
(
images
,
data
=
batch
[
1
:])
else
:
preds
=
model
(
images
)
state_dict
=
model
.
state_dict
()
# for key in state_dict:
# print(key)
loss
=
loss_class
(
preds
,
batch
)
avg_loss
=
loss
[
'loss'
]
avg_loss
.
backward
()
...
...
@@ -414,7 +411,6 @@ def preprocess(is_train=False):
yaml
.
dump
(
dict
(
config
),
f
,
default_flow_style
=
False
,
sort_keys
=
False
)
log_file
=
'{}/train.log'
.
format
(
save_model_dir
)
print
(
"log has save in {}/train.log"
.
format
(
save_model_dir
))
else
:
log_file
=
None
logger
=
get_logger
(
name
=
'root'
,
log_file
=
log_file
)
...
...
tools/train.py
View file @
1b2ca6e6
...
...
@@ -72,8 +72,6 @@ def main(config, device, logger, vdl_writer):
# for rec algorithm
if
hasattr
(
post_process_class
,
'character'
):
char_num
=
len
(
getattr
(
post_process_class
,
'character'
))
character
=
getattr
(
post_process_class
,
'character'
)
print
(
"getattr character:"
,
character
)
if
config
[
'Architecture'
][
"algorithm"
]
in
[
"Distillation"
,
]:
# distillation model
for
key
in
config
[
'Architecture'
][
"Models"
]:
...
...
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