Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
9de22673
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9de22673
编写于
4月 08, 2022
作者:
W
weishengyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dbg
上级
7f0b7a04
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
10 addition
and
10 deletion
+10
-10
ppcls/arch/gears/bnneck.py
ppcls/arch/gears/bnneck.py
+2
-2
ppcls/arch/gears/fc.py
ppcls/arch/gears/fc.py
+2
-2
ppcls/configs/Pedestrian/strong_baseline_m1.yaml
ppcls/configs/Pedestrian/strong_baseline_m1.yaml
+4
-4
ppcls/engine/evaluation/retrieval.py
ppcls/engine/evaluation/retrieval.py
+1
-1
ppcls/loss/triplet.py
ppcls/loss/triplet.py
+1
-1
未找到文件。
ppcls/arch/gears/bnneck.py
浏览文件 @
9de22673
...
@@ -8,8 +8,8 @@ class BNNeck(paddle.nn.Layer):
...
@@ -8,8 +8,8 @@ class BNNeck(paddle.nn.Layer):
self
.
bn
=
paddle
.
nn
.
BatchNorm1D
(
self
.
bn
=
paddle
.
nn
.
BatchNorm1D
(
self
.
num_filters
)
self
.
num_filters
)
if
not
trainable
:
#
if not trainable:
self
.
bn
.
bias
.
trainable
=
False
#
self.bn.bias.trainable = False
def
forward
(
self
,
input
,
label
=
None
):
def
forward
(
self
,
input
,
label
=
None
):
out
=
self
.
bn
(
input
)
out
=
self
.
bn
(
input
)
...
...
ppcls/arch/gears/fc.py
浏览文件 @
9de22673
...
@@ -21,14 +21,14 @@ import paddle.nn as nn
...
@@ -21,14 +21,14 @@ import paddle.nn as nn
class
FC
(
nn
.
Layer
):
class
FC
(
nn
.
Layer
):
def
__init__
(
self
,
embedding_size
,
class_num
):
def
__init__
(
self
,
embedding_size
,
class_num
,
bias_attr
=
None
):
super
(
FC
,
self
).
__init__
()
super
(
FC
,
self
).
__init__
()
self
.
embedding_size
=
embedding_size
self
.
embedding_size
=
embedding_size
self
.
class_num
=
class_num
self
.
class_num
=
class_num
weight_attr
=
paddle
.
ParamAttr
(
weight_attr
=
paddle
.
ParamAttr
(
initializer
=
paddle
.
nn
.
initializer
.
XavierNormal
())
initializer
=
paddle
.
nn
.
initializer
.
XavierNormal
())
self
.
fc
=
paddle
.
nn
.
Linear
(
self
.
fc
=
paddle
.
nn
.
Linear
(
self
.
embedding_size
,
self
.
class_num
,
weight_attr
=
weight_attr
)
self
.
embedding_size
,
self
.
class_num
,
weight_attr
=
weight_attr
,
bias_attr
=
bias_attr
)
def
forward
(
self
,
input
,
label
=
None
):
def
forward
(
self
,
input
,
label
=
None
):
out
=
self
.
fc
(
input
)
out
=
self
.
fc
(
input
)
...
...
ppcls/configs/Pedestrian/strong_baseline_m1.yaml
浏览文件 @
9de22673
...
@@ -26,14 +26,14 @@ Arch:
...
@@ -26,14 +26,14 @@ Arch:
stem_act
:
null
stem_act
:
null
BackboneStopLayer
:
BackboneStopLayer
:
name
:
"
flatten"
name
:
"
flatten"
#Neck:
Neck
:
# name: BNNeck
name
:
BNNeck
# num_filters: 2048
num_filters
:
2048
# trainable: false
Head
:
Head
:
name
:
"
FC"
name
:
"
FC"
embedding_size
:
2048
embedding_size
:
2048
class_num
:
751
class_num
:
751
bias_attr
:
false
# loss function config for traing/eval process
# loss function config for traing/eval process
Loss
:
Loss
:
...
...
ppcls/engine/evaluation/retrieval.py
浏览文件 @
9de22673
...
@@ -125,7 +125,7 @@ def cal_feature(engine, name='gallery'):
...
@@ -125,7 +125,7 @@ def cal_feature(engine, name='gallery'):
out
=
engine
.
model
(
batch
[
0
],
batch
[
1
])
out
=
engine
.
model
(
batch
[
0
],
batch
[
1
])
if
"Student"
in
out
:
if
"Student"
in
out
:
out
=
out
[
"Student"
]
out
=
out
[
"Student"
]
batch_feas
=
out
[
"
features
"
]
batch_feas
=
out
[
"
backbone
"
]
# do norm
# do norm
if
engine
.
config
[
"Global"
].
get
(
"feature_normalize"
,
True
):
if
engine
.
config
[
"Global"
].
get
(
"feature_normalize"
,
True
):
...
...
ppcls/loss/triplet.py
浏览文件 @
9de22673
...
@@ -24,7 +24,7 @@ class TripletLossV2(nn.Layer):
...
@@ -24,7 +24,7 @@ class TripletLossV2(nn.Layer):
inputs: feature matrix with shape (batch_size, feat_dim)
inputs: feature matrix with shape (batch_size, feat_dim)
target: ground truth labels with shape (num_classes)
target: ground truth labels with shape (num_classes)
"""
"""
inputs
=
input
[
"
features
"
]
inputs
=
input
[
"
backbone
"
]
if
self
.
normalize_feature
:
if
self
.
normalize_feature
:
inputs
=
1.
*
inputs
/
(
paddle
.
expand_as
(
inputs
=
1.
*
inputs
/
(
paddle
.
expand_as
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录