Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
恒星小白
PaddleOCR
提交
08b3f98c
P
PaddleOCR
项目概览
恒星小白
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
08b3f98c
编写于
10月 22, 2020
作者:
W
WenmuZhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
去掉注释
上级
7c96520d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
12 deletion
+10
-12
ppocr/modeling/architectures/model.py
ppocr/modeling/architectures/model.py
+10
-12
未找到文件。
ppocr/modeling/architectures/model.py
浏览文件 @
08b3f98c
...
@@ -76,7 +76,6 @@ class Model(nn.Layer):
...
@@ -76,7 +76,6 @@ class Model(nn.Layer):
config
[
"Head"
][
'in_channels'
]
=
in_channels
config
[
"Head"
][
'in_channels'
]
=
in_channels
self
.
head
=
build_head
(
config
[
"Head"
])
self
.
head
=
build_head
(
config
[
"Head"
])
# @paddle.jit.to_static
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
if
self
.
use_transform
:
if
self
.
use_transform
:
x
=
self
.
transform
(
x
)
x
=
self
.
transform
(
x
)
...
@@ -93,30 +92,29 @@ def check_static():
...
@@ -93,30 +92,29 @@ def check_static():
from
ppocr.utils.logging
import
get_logger
from
ppocr.utils.logging
import
get_logger
from
tools
import
program
from
tools
import
program
config
=
program
.
load_config
(
'configs/
rec/rec_mv3_none_none_ctc_lm
db.yml'
)
config
=
program
.
load_config
(
'configs/
det/det_r50_vd_
db.yml'
)
logger
=
get_logger
()
logger
=
get_logger
()
np
.
random
.
seed
(
0
)
np
.
random
.
seed
(
0
)
data
=
np
.
random
.
rand
(
2
,
3
,
64
,
320
).
astype
(
np
.
float32
)
data
=
np
.
random
.
rand
(
1
,
3
,
640
,
640
).
astype
(
np
.
float32
)
paddle
.
disable_static
()
paddle
.
disable_static
()
x
=
paddle
.
to_tensor
(
data
)
config
[
'Architecture'
][
'in_channels'
]
=
3
config
[
'Architecture'
][
'in_channels'
]
=
3
config
[
'Architecture'
][
"Head"
][
'out_channels'
]
=
6624
config
[
'Architecture'
][
"Head"
][
'out_channels'
]
=
37
model
=
Model
(
config
[
'Architecture'
])
model
=
Model
(
config
[
'Architecture'
])
model
.
eval
()
model
.
eval
()
load_dygraph_pretrain
(
load_dygraph_pretrain
(
model
,
model
,
logger
,
'det_r50_vd_db/best_accuracy'
,
load_static_weights
=
True
)
logger
,
'/Users/zhoujun20/Desktop/code/PaddleOCR/cnn_ctc/cnn_ctc'
,
load_static_weights
=
True
)
x
=
paddle
.
to_tensor
(
data
)
y
=
model
(
x
)
y
=
model
(
x
)
for
y1
in
y
:
for
y1
in
y
:
print
(
y1
.
shape
)
print
(
y1
.
shape
)
static_out
=
np
.
load
(
static_out
=
np
.
load
(
'static_out.npy'
)
'/Users/zhoujun20/Desktop/code/PaddleOCR/output/conv.npy'
)
diff
=
y
.
numpy
()
-
static_out
diff
=
y
.
reshape
((
-
1
,
6624
)).
numpy
()
-
static_out
print
(
y
.
shape
,
static_out
.
shape
,
diff
.
mean
())
print
(
y
.
shape
,
static_out
.
shape
,
diff
.
mean
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录