Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
cc638a9d
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
接近 2 年 前同步成功
通知
116
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看板
提交
cc638a9d
编写于
2月 28, 2023
作者:
H
HydrogenSulfate
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update pretrained_model and inference model link in TIPC config and refine TIPC script
上级
099310ef
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
18 deletion
+22
-18
docs/zh_CN/training/metric_learning/metabin.md
docs/zh_CN/training/metric_learning/metabin.md
+6
-7
test_tipc/configs/MetaBIN/MetaBIN_ResNet50_cross_domain_train_amp_infer_python.txt
.../MetaBIN_ResNet50_cross_domain_train_amp_infer_python.txt
+4
-4
test_tipc/configs/MetaBIN/MetaBIN_ResNet50_cross_domain_train_infer_python.txt
...aBIN/MetaBIN_ResNet50_cross_domain_train_infer_python.txt
+4
-4
test_tipc/prepare.sh
test_tipc/prepare.sh
+5
-0
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+3
-3
未找到文件。
docs/zh_CN/training/metric_learning/metabin.md
浏览文件 @
cc638a9d
...
...
@@ -36,7 +36,7 @@
| 模型 | recall@1(
\%
) | mAP(
\%
) | 参考recall@1(
\%
) | 参考mAP(
\%
) | 预训练模型下载地址 | inference模型下载地址 |
| -------- | ------------ | ------- |------------ | ------- | ------------------ | --------------------- |
| ResNet50_MetaBIN | 55.
07 | 32.62 | 55.16 | 33.09 |
[
metabin_resnet50_pretrained.pdparams
](
https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/reid/metabin/metabin_resnet50_pretrained.pdparams
)
|
[
metabin_resnet50_infer.tar
](
https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/reid
/metabin/metabin_resnet50_infer.tar
)
|
| ResNet50_MetaBIN | 55.
25 | 32.97 | 55.16 | 33.09 |
[
metabin_resnet50_pretrained.pdparams
](
https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/metric_learning/metabin/metabin_resnet50_pretrained.pdparams
)
|
[
metabin_resnet50_infer.tar
](
https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/metric_learning
/metabin/metabin_resnet50_infer.tar
)
|
接下来主要以
`MetaBIN_ResNet50_cross_domain.yaml`
配置和训练好的模型文件为例,展示在 Market1501 数据集上进行训练, 在 DukeMTMC-reID 数据集上测试、推理的过程。
...
...
@@ -88,14 +88,14 @@
-o
Global.pretrained_model
=
"./output/RecModel/latest"
```
-
以训练好的模型为例,下载
[
metabin_resnet50_pretrained.pdparams
](
https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
reid
/metabin/metabin_resnet50_pretrained.pdparams
)
到
`PaddleClas/pretrained_models`
文件夹中,执行如下命令即可进行评估。
-
以训练好的模型为例,下载
[
metabin_resnet50_pretrained.pdparams
](
https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
metric_learning
/metabin/metabin_resnet50_pretrained.pdparams
)
到
`PaddleClas/pretrained_models`
文件夹中,执行如下命令即可进行评估。
```
shell
# 下载模型
cd
PaddleClas
mkdir
pretrained_models
cd
pretrained_models
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
reid
/metabin/metabin_resnet50_pretrained.pdparams
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
metric_learning
/metabin/metabin_resnet50_pretrained.pdparams
cd
..
# 评估
python3.7 tools/eval.py
\
...
...
@@ -118,10 +118,9 @@
ppcls INFO: query feature calculation process: [0/18]
ppcls INFO: Build query done, all feat shape: [2228, 2048]
ppcls INFO: re_ranking=False
ppcls INFO: [Eval][Epoch 0][Avg]recall1: 0.55072, recall5: 0.68492, recall10: 0.73698, mAP: 0.32624
ppcls INFO: [Eval][Epoch 0][Avg]recall1: 0.55251, recall5: 0.68268, recall10: 0.72756, mAP: 0.32977
```
默认评估日志保存在
`PaddleClas/output/RecModel/eval.log`
中,可以看到我们提供的
`metabin_resnet50_pretrained.pdparams`
模型在
SOP 数据集上的评估指标为recall@1=0.55072,recall@5=0.68492,recall@10=0.73698,mAP=0.32624
默认评估日志保存在
`PaddleClas/output/RecModel/eval.log`
中,可以看到我们提供的
`metabin_resnet50_pretrained.pdparams`
模型在
Market-1501 数据集上的评估指标为recall@1=0.55251,recall@5=0.68268,recall@10=0.72756,mAP=0.32977
-
使用re-ranking功能提升评估精度
...
...
@@ -145,7 +144,7 @@
-
或者下载并解压我们提供的 inference 模型
```
shell
cd
./deploy
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
reid
/metabin/metabin_resnet50_infer.tar
wget https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
metric_learning
/metabin/metabin_resnet50_infer.tar
tar
-xf
metabin_resnet50_infer.tar
cd
../
```
...
...
test_tipc/configs/MetaBIN/MetaBIN_ResNet50_cross_domain_train_amp_infer_python.txt
浏览文件 @
cc638a9d
===========================train_params===========================
model_name:
RecModel
model_name:
MetaBIN_ResNet50
python:python3.7
gpu_list:0
-o Global.device:gpu
...
...
@@ -13,14 +13,14 @@ train_infer_img_dir:./dataset/ILSVRC2012/val
null:null
##
trainer:amp_train
amp_train:tools/train.py -c ppcls/configs/reid/MetaBIN_ResNet50_cross_domain.yaml -o Global.seed=1234 -o DataLoader.Train.loader.num_workers=
0
-o DataLoader.Train.loader.use_shared_memory=False -o Global.eval_during_train=False -o Global.save_interval=2 -o DataLoader.Train.sampler.num_instances=2 -o DataLoader.Metalearning.Train.sampler.batch_size=16 -o DataLoader.Metalearning.Train.sampler.num_instances=2
amp_train:tools/train.py -c ppcls/configs/reid/MetaBIN_ResNet50_cross_domain.yaml -o Global.seed=1234 -o DataLoader.Train.loader.num_workers=
1
-o DataLoader.Train.loader.use_shared_memory=False -o Global.eval_during_train=False -o Global.save_interval=2 -o DataLoader.Train.sampler.num_instances=2 -o DataLoader.Metalearning.Train.sampler.batch_size=16 -o DataLoader.Metalearning.Train.sampler.num_instances=2
pact_train:null
fpgm_train:null
distill_train:null
null:null
null:null
##
===========================eval_params===========================
===========================eval_params===========================
eval:tools/eval.py -c ppcls/configs/reid/MetaBIN_ResNet50_cross_domain.yaml
null:null
##
...
...
@@ -33,7 +33,7 @@ fpgm_export:null
distill_export:null
kl_quant:null
export2:null
pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
reid
/metabin/metabin_resnet50_pretrained.pdparams
pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
metric_learning
/metabin/metabin_resnet50_pretrained.pdparams
infer_model:../inference/
infer_export:True
infer_quant:Fasle
...
...
test_tipc/configs/MetaBIN/MetaBIN_ResNet50_cross_domain_train_infer_python.txt
浏览文件 @
cc638a9d
===========================train_params===========================
model_name:
RecModel
model_name:
MetaBIN_ResNet50
python:python3.7
gpu_list:0
-o Global.device:gpu
...
...
@@ -13,14 +13,14 @@ train_infer_img_dir:./dataset/ILSVRC2012/val
null:null
##
trainer:norm_train
norm_train:tools/train.py -c ppcls/configs/reid/MetaBIN_ResNet50_cross_domain.yaml -o Global.seed=1234 -o DataLoader.Train.loader.num_workers=
0
-o DataLoader.Train.loader.use_shared_memory=False -o Global.eval_during_train=False -o Global.save_interval=2 -o DataLoader.Train.sampler.num_instances=2 -o DataLoader.Metalearning.Train.sampler.batch_size=16 -o DataLoader.Metalearning.Train.sampler.num_instances=2 -o AMP=None
norm_train:tools/train.py -c ppcls/configs/reid/MetaBIN_ResNet50_cross_domain.yaml -o Global.seed=1234 -o DataLoader.Train.loader.num_workers=
1
-o DataLoader.Train.loader.use_shared_memory=False -o Global.eval_during_train=False -o Global.save_interval=2 -o DataLoader.Train.sampler.num_instances=2 -o DataLoader.Metalearning.Train.sampler.batch_size=16 -o DataLoader.Metalearning.Train.sampler.num_instances=2 -o AMP=None
pact_train:null
fpgm_train:null
distill_train:null
null:null
null:null
##
===========================eval_params===========================
===========================eval_params===========================
eval:tools/eval.py -c ppcls/configs/reid/MetaBIN_ResNet50_cross_domain.yaml
null:null
##
...
...
@@ -33,7 +33,7 @@ fpgm_export:null
distill_export:null
kl_quant:null
export2:null
pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
reid
/metabin/metabin_resnet50_pretrained.pdparams
pretrained_model_url:https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/
metric_learning
/metabin/metabin_resnet50_pretrained.pdparams
infer_model:../inference/
infer_export:True
infer_quant:Fasle
...
...
test_tipc/prepare.sh
浏览文件 @
cc638a9d
...
...
@@ -197,6 +197,11 @@ if [[ ${MODE} = "lite_train_lite_infer" ]] || [[ ${MODE} = "lite_train_whole_inf
cd
tipc_shitu_demo_data
ln
-s
demo_test.txt val_list.txt
cd
../../
elif
[[
${
model_name
}
=
~
"MetaBIN_ResNet50"
]]
;
then
cd
dataset
wget
-nc
https://paddleclas.bj.bcebos.com/data/TIPC/duke_market.zip
--no-check-certificate
unzip duke_market.zip
cd
../
else
# pretrain lite train data
cd
dataset
...
...
test_tipc/test_train_inference_python.sh
浏览文件 @
cc638a9d
...
...
@@ -273,7 +273,7 @@ else
# export FLAGS_cudnn_deterministic=True
sleep
5
eval
$cmd
if
[[
$model_name
==
*
GeneralRecognition
*
]]
;
then
if
[[
$model_name
==
*
GeneralRecognition
*
]]
||
[[
$model_name
==
*
MetaBIN_ResNet50
*
]]
;
then
eval
"cat
${
save_log
}
/RecModel/train.log >>
${
save_log
}
.log"
else
eval
"cat
${
save_log
}
/
${
model_name
}
/train.log >>
${
save_log
}
.log"
...
...
@@ -281,7 +281,7 @@ else
status_check
$?
"
${
cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
"
${
save_log
}
.log"
sleep
5
if
[[
$model_name
==
*
GeneralRecognition
*
]]
;
then
if
[[
$model_name
==
*
GeneralRecognition
*
]]
||
[[
$model_name
==
*
MetaBIN_ResNet50
*
]]
;
then
set_eval_pretrain
=
$(
func_set_params
"
${
pretrain_model_key
}
"
"
${
save_log
}
/RecModel/
${
train_model_name
}
"
)
else
set_eval_pretrain
=
$(
func_set_params
"
${
pretrain_model_key
}
"
"
${
save_log
}
/
${
model_name
}
/
${
train_model_name
}
"
)
...
...
@@ -303,7 +303,7 @@ else
if
[
${
run_export
}
!=
"null"
]
;
then
# run export model
save_infer_path
=
"
${
save_log
}
"
if
[[
$model_name
==
*
GeneralRecognition
*
]]
;
then
if
[[
$model_name
==
*
GeneralRecognition
*
]]
||
[[
$model_name
==
*
MetaBIN_ResNet50
*
]]
;
then
set_eval_pretrain
=
$(
func_set_params
"
${
pretrain_model_key
}
"
"
${
save_log
}
/RecModel/
${
train_model_name
}
"
)
else
set_export_weight
=
$(
func_set_params
"
${
export_weight
}
"
"
${
save_log
}
/
${
model_name
}
/
${
train_model_name
}
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录