Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
0989caf7
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0989caf7
编写于
11月 05, 2021
作者:
S
shangliang Xu
提交者:
GitHub
11月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix code reference and licence (#4478)
上级
f5ddf363
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
45 addition
and
7 deletion
+45
-7
ppdet/modeling/assigners/atss_assigner.py
ppdet/modeling/assigners/atss_assigner.py
+4
-1
ppdet/modeling/assigners/task_aligned_assigner.py
ppdet/modeling/assigners/task_aligned_assigner.py
+4
-1
ppdet/modeling/heads/detr_head.py
ppdet/modeling/heads/detr_head.py
+15
-5
ppdet/modeling/heads/tood_head.py
ppdet/modeling/heads/tood_head.py
+7
-0
ppdet/modeling/transformers/deformable_transformer.py
ppdet/modeling/transformers/deformable_transformer.py
+3
-0
ppdet/modeling/transformers/detr_transformer.py
ppdet/modeling/transformers/detr_transformer.py
+3
-0
ppdet/modeling/transformers/matchers.py
ppdet/modeling/transformers/matchers.py
+3
-0
ppdet/modeling/transformers/position_encoding.py
ppdet/modeling/transformers/position_encoding.py
+3
-0
ppdet/modeling/transformers/utils.py
ppdet/modeling/transformers/utils.py
+3
-0
未找到文件。
ppdet/modeling/assigners/atss_assigner.py
浏览文件 @
0989caf7
...
@@ -79,7 +79,10 @@ class ATSSAssigner(nn.Layer):
...
@@ -79,7 +79,10 @@ class ATSSAssigner(nn.Layer):
gt_bboxes
,
gt_bboxes
,
bg_index
,
bg_index
,
gt_scores
=
None
):
gt_scores
=
None
):
r
"""The assignment is done in following steps
r
"""This code is based on
https://github.com/fcjian/TOOD/blob/master/mmdet/core/bbox/assigners/atss_assigner.py
The assignment is done in following steps
1. compute iou between all bbox (bbox of all pyramid levels) and gt
1. compute iou between all bbox (bbox of all pyramid levels) and gt
2. compute center distance between all bbox and gt
2. compute center distance between all bbox and gt
3. on each pyramid level, for each gt, select k bbox whose center
3. on each pyramid level, for each gt, select k bbox whose center
...
...
ppdet/modeling/assigners/task_aligned_assigner.py
浏览文件 @
0989caf7
...
@@ -47,7 +47,10 @@ class TaskAlignedAssigner(nn.Layer):
...
@@ -47,7 +47,10 @@ class TaskAlignedAssigner(nn.Layer):
gt_bboxes
,
gt_bboxes
,
bg_index
,
bg_index
,
gt_scores
=
None
):
gt_scores
=
None
):
r
"""The assignment is done in following steps
r
"""This code is based on
https://github.com/fcjian/TOOD/blob/master/mmdet/core/bbox/assigners/task_aligned_assigner.py
The assignment is done in following steps
1. compute alignment metric between all bbox (bbox of all pyramid levels) and gt
1. compute alignment metric between all bbox (bbox of all pyramid levels) and gt
2. select top-k bbox as candidates for each gt
2. select top-k bbox as candidates for each gt
3. limit the positive sample's center in gt (because the anchor-free detector
3. limit the positive sample's center in gt (because the anchor-free detector
...
...
ppdet/modeling/heads/detr_head.py
浏览文件 @
0989caf7
...
@@ -28,6 +28,10 @@ __all__ = ['DETRHead', 'DeformableDETRHead']
...
@@ -28,6 +28,10 @@ __all__ = ['DETRHead', 'DeformableDETRHead']
class
MLP
(
nn
.
Layer
):
class
MLP
(
nn
.
Layer
):
"""This code is based on
https://github.com/facebookresearch/detr/blob/main/models/detr.py
"""
def
__init__
(
self
,
input_dim
,
hidden_dim
,
output_dim
,
num_layers
):
def
__init__
(
self
,
input_dim
,
hidden_dim
,
output_dim
,
num_layers
):
super
().
__init__
()
super
().
__init__
()
self
.
num_layers
=
num_layers
self
.
num_layers
=
num_layers
...
@@ -48,7 +52,11 @@ class MLP(nn.Layer):
...
@@ -48,7 +52,11 @@ class MLP(nn.Layer):
class
MultiHeadAttentionMap
(
nn
.
Layer
):
class
MultiHeadAttentionMap
(
nn
.
Layer
):
"""This is a 2D attention module, which only returns the attention softmax (no multiplication by value)"""
"""This code is based on
https://github.com/facebookresearch/detr/blob/main/models/segmentation.py
This is a 2D attention module, which only returns the attention softmax (no multiplication by value)
"""
def
__init__
(
self
,
query_dim
,
hidden_dim
,
num_heads
,
dropout
=
0.0
,
def
__init__
(
self
,
query_dim
,
hidden_dim
,
num_heads
,
dropout
=
0.0
,
bias
=
True
):
bias
=
True
):
...
@@ -94,9 +102,11 @@ class MultiHeadAttentionMap(nn.Layer):
...
@@ -94,9 +102,11 @@ class MultiHeadAttentionMap(nn.Layer):
class
MaskHeadFPNConv
(
nn
.
Layer
):
class
MaskHeadFPNConv
(
nn
.
Layer
):
"""
"""This code is based on
Simple convolutional head, using group norm.
https://github.com/facebookresearch/detr/blob/main/models/segmentation.py
Upsampling is done using a FPN approach
Simple convolutional head, using group norm.
Upsampling is done using a FPN approach
"""
"""
def
__init__
(
self
,
input_dim
,
fpn_dims
,
context_dim
,
num_groups
=
8
):
def
__init__
(
self
,
input_dim
,
fpn_dims
,
context_dim
,
num_groups
=
8
):
...
@@ -307,7 +317,7 @@ class DeformableDETRHead(nn.Layer):
...
@@ -307,7 +317,7 @@ class DeformableDETRHead(nn.Layer):
linear_init_
(
self
.
score_head
)
linear_init_
(
self
.
score_head
)
constant_
(
self
.
score_head
.
bias
,
-
4.595
)
constant_
(
self
.
score_head
.
bias
,
-
4.595
)
constant_
(
self
.
bbox_head
.
layers
[
-
1
].
weight
)
constant_
(
self
.
bbox_head
.
layers
[
-
1
].
weight
)
with
paddle
.
no_grad
():
with
paddle
.
no_grad
():
bias
=
paddle
.
zeros_like
(
self
.
bbox_head
.
layers
[
-
1
].
bias
)
bias
=
paddle
.
zeros_like
(
self
.
bbox_head
.
layers
[
-
1
].
bias
)
bias
[
2
:]
=
-
2.0
bias
[
2
:]
=
-
2.0
...
...
ppdet/modeling/heads/tood_head.py
浏览文件 @
0989caf7
...
@@ -48,6 +48,10 @@ class ScaleReg(nn.Layer):
...
@@ -48,6 +48,10 @@ class ScaleReg(nn.Layer):
class
TaskDecomposition
(
nn
.
Layer
):
class
TaskDecomposition
(
nn
.
Layer
):
"""This code is based on
https://github.com/fcjian/TOOD/blob/master/mmdet/models/dense_heads/tood_head.py
"""
def
__init__
(
def
__init__
(
self
,
self
,
feat_channels
,
feat_channels
,
...
@@ -105,6 +109,9 @@ class TaskDecomposition(nn.Layer):
...
@@ -105,6 +109,9 @@ class TaskDecomposition(nn.Layer):
@
register
@
register
class
TOODHead
(
nn
.
Layer
):
class
TOODHead
(
nn
.
Layer
):
"""This code is based on
https://github.com/fcjian/TOOD/blob/master/mmdet/models/dense_heads/tood_head.py
"""
__inject__
=
[
'nms'
,
'static_assigner'
,
'assigner'
]
__inject__
=
[
'nms'
,
'static_assigner'
,
'assigner'
]
__shared__
=
[
'num_classes'
]
__shared__
=
[
'num_classes'
]
...
...
ppdet/modeling/transformers/deformable_transformer.py
浏览文件 @
0989caf7
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
# Modified from Deformable-DETR (https://github.com/fundamentalvision/Deformable-DETR)
# Copyright (c) 2020 SenseTime. All Rights Reserved.
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
...
...
ppdet/modeling/transformers/detr_transformer.py
浏览文件 @
0989caf7
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
# Modified from DETR (https://github.com/facebookresearch/detr)
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
...
...
ppdet/modeling/transformers/matchers.py
浏览文件 @
0989caf7
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
# Modified from DETR (https://github.com/facebookresearch/detr)
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
...
...
ppdet/modeling/transformers/position_encoding.py
浏览文件 @
0989caf7
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
# Modified from DETR (https://github.com/facebookresearch/detr)
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
...
...
ppdet/modeling/transformers/utils.py
浏览文件 @
0989caf7
...
@@ -11,6 +11,9 @@
...
@@ -11,6 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
#
# Modified from DETR (https://github.com/facebookresearch/detr)
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录