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
5a9c8e49
Commit
5a9c8e49
authored
Jan 20, 2021
by
WenmuZhou
Browse files
tps export down
parent
c1c80e34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
ppocr/modeling/transforms/tps.py
ppocr/modeling/transforms/tps.py
+8
-10
No files found.
ppocr/modeling/transforms/tps.py
View file @
5a9c8e49
...
...
@@ -213,16 +213,14 @@ class GridGenerator(nn.Layer):
def
build_P_paddle
(
self
,
I_r_size
):
I_r_height
,
I_r_width
=
I_r_size
I_r_grid_x
=
paddle
.
divide
(
paddle
.
arange
(
-
I_r_width
,
I_r_width
,
2
,
dtype
=
'float64'
)
+
1.0
,
paddle
.
to_tensor
(
I_r_width
,
dtype
=
'float64'
))
I_r_grid_y
=
paddle
.
divide
(
paddle
.
arange
(
-
I_r_height
,
I_r_height
,
2
,
dtype
=
'float64'
)
+
1.0
,
paddle
.
to_tensor
(
I_r_height
,
dtype
=
'float64'
))
# self.I_r_height
I_r_grid_x
=
(
paddle
.
arange
(
-
I_r_width
,
I_r_width
,
2
,
dtype
=
'float64'
)
+
1.0
)
/
paddle
.
to_tensor
(
np
.
array
([
I_r_width
]))
I_r_grid_y
=
(
paddle
.
arange
(
-
I_r_height
,
I_r_height
,
2
,
dtype
=
'float64'
)
+
1.0
)
/
paddle
.
to_tensor
(
np
.
array
([
I_r_height
]))
# P: self.I_r_width x self.I_r_height x 2
P
=
paddle
.
stack
(
paddle
.
meshgrid
(
I_r_grid_x
,
I_r_grid_y
),
axis
=
2
)
P
=
paddle
.
transpose
(
P
,
perm
=
[
1
,
0
,
2
])
...
...
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