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
8f1b9c8b
Commit
8f1b9c8b
authored
Oct 16, 2020
by
WenmuZhou
Browse files
对齐静态图时使用random数据
parent
86268551
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
ppocr/modeling/architectures/model.py
ppocr/modeling/architectures/model.py
+8
-12
No files found.
ppocr/modeling/architectures/model.py
View file @
8f1b9c8b
...
...
@@ -94,13 +94,11 @@ def check_static():
from
ppocr.utils.logging
import
get_logger
from
tools
import
program
config
=
program
.
load_config
(
'configs/
det/det_r50_vd_db
.yml'
)
config
=
program
.
load_config
(
'configs/
rec/rec_r34_vd_none_bilstm_ctc
.yml'
)
# import cv2
# data = cv2.imread('doc/imgs/1.jpg')
# data = normalize(data)
logger
=
get_logger
()
data
=
np
.
zeros
((
1
,
3
,
640
,
640
),
dtype
=
np
.
float32
)
np
.
random
.
seed
(
0
)
data
=
np
.
random
.
rand
(
1
,
3
,
32
,
320
).
astype
(
np
.
float32
)
paddle
.
disable_static
()
config
[
'Architecture'
][
'in_channels'
]
=
3
...
...
@@ -110,17 +108,15 @@ def check_static():
load_dygraph_pretrain
(
model
,
logger
,
'/Users/zhoujun20/Desktop/code/PaddleOCR/
db/db
'
,
'/Users/zhoujun20/Desktop/code/PaddleOCR/
cnn_ctc/cnn_ctc
'
,
load_static_weights
=
True
)
x
=
paddle
.
to_
variable
(
data
)
x
=
paddle
.
to_
tensor
(
data
)
y
=
model
(
x
)
for
y1
in
y
:
print
(
y1
.
shape
)
#
# # from matplotlib import pyplot as plt
# # plt.imshow(y.numpy())
# # plt.show()
static_out
=
np
.
load
(
'/Users/zhoujun20/Desktop/code/PaddleOCR/db/db.npy'
)
static_out
=
np
.
load
(
'/Users/zhoujun20/Desktop/code/PaddleOCR/output/conv.npy'
)
diff
=
y
.
numpy
()
-
static_out
print
(
y
.
shape
,
static_out
.
shape
,
diff
.
mean
())
...
...
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