Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
7e81a9e6
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7e81a9e6
编写于
7月 10, 2022
作者:
xuyang2233
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modified annotation
上级
3e8f5ce4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
26 deletion
+4
-26
ppocr/modeling/backbones/rec_resnet_32.py
ppocr/modeling/backbones/rec_resnet_32.py
+4
-24
ppocr/modeling/heads/rec_spin_att_head.py
ppocr/modeling/heads/rec_spin_att_head.py
+0
-1
ppocr/modeling/transforms/gaspin_transformer.py
ppocr/modeling/transforms/gaspin_transformer.py
+0
-1
未找到文件。
ppocr/modeling/backbones/rec_resnet_32.py
浏览文件 @
7e81a9e6
# copyright (c) 202
1
PaddlePaddle Authors. All Rights Reserve.
# copyright (c) 202
2
PaddlePaddle Authors. All Rights Reserve.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may not use this file except in compliance with the License.
...
@@ -20,11 +20,7 @@ from __future__ import absolute_import
...
@@ -20,11 +20,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
paddle
from
paddle
import
ParamAttr
import
paddle.nn
as
nn
import
paddle.nn
as
nn
import
paddle.nn.functional
as
F
import
numpy
as
np
__all__
=
[
"ResNet32"
]
__all__
=
[
"ResNet32"
]
...
@@ -51,10 +47,10 @@ class ResNet32(nn.Layer):
...
@@ -51,10 +47,10 @@ class ResNet32(nn.Layer):
def
forward
(
self
,
inputs
):
def
forward
(
self
,
inputs
):
"""
"""
Args:
Args:
inputs
(torch.Tensor)
: input feature
inputs: input feature
Returns:
Returns:
torch.Tensor:
output feature
output feature
"""
"""
return
self
.
ConvNet
(
inputs
)
return
self
.
ConvNet
(
inputs
)
...
@@ -92,7 +88,7 @@ class BasicBlock(nn.Layer):
...
@@ -92,7 +88,7 @@ class BasicBlock(nn.Layer):
out_planes (int): channels of the middle feature
out_planes (int): channels of the middle feature
stride (int): stride of the convolution
stride (int): stride of the convolution
Returns:
Returns:
nn.
Module
: Conv2D with kernel = 3
nn.
Layer
: Conv2D with kernel = 3
"""
"""
...
@@ -102,14 +98,6 @@ class BasicBlock(nn.Layer):
...
@@ -102,14 +98,6 @@ class BasicBlock(nn.Layer):
bias_attr
=
False
)
bias_attr
=
False
)
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
"""
Args:
x (torch.Tensor): input feature
Returns:
torch.Tensor: output feature of the BasicBlock
"""
residual
=
x
residual
=
x
out
=
self
.
conv1
(
x
)
out
=
self
.
conv1
(
x
)
...
@@ -246,14 +234,6 @@ class ResNet(nn.Layer):
...
@@ -246,14 +234,6 @@ class ResNet(nn.Layer):
return
nn
.
Sequential
(
*
layers
)
return
nn
.
Sequential
(
*
layers
)
def
forward
(
self
,
x
):
def
forward
(
self
,
x
):
"""
Args:
x (torch.Tensor): input feature
Returns:
torch.Tensor: output feature of the Resnet
"""
x
=
self
.
conv0_1
(
x
)
x
=
self
.
conv0_1
(
x
)
x
=
self
.
bn0_1
(
x
)
x
=
self
.
bn0_1
(
x
)
x
=
self
.
relu
(
x
)
x
=
self
.
relu
(
x
)
...
...
ppocr/modeling/heads/rec_spin_att_head.py
浏览文件 @
7e81a9e6
...
@@ -19,7 +19,6 @@ from __future__ import print_function
...
@@ -19,7 +19,6 @@ from __future__ import print_function
import
paddle
import
paddle
import
paddle.nn
as
nn
import
paddle.nn
as
nn
import
paddle.nn.functional
as
F
import
paddle.nn.functional
as
F
import
numpy
as
np
class
SPINAttentionHead
(
nn
.
Layer
):
class
SPINAttentionHead
(
nn
.
Layer
):
...
...
ppocr/modeling/transforms/gaspin_transformer.py
浏览文件 @
7e81a9e6
...
@@ -21,7 +21,6 @@ import paddle
...
@@ -21,7 +21,6 @@ import paddle
from
paddle
import
nn
,
ParamAttr
from
paddle
import
nn
,
ParamAttr
from
paddle.nn
import
functional
as
F
from
paddle.nn
import
functional
as
F
import
numpy
as
np
import
numpy
as
np
import
itertools
import
functools
import
functools
from
.tps
import
GridGenerator
from
.tps
import
GridGenerator
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录