|
преди 2 години | |
---|---|---|
.. | ||
README.md | преди 2 години | |
denseteacher_fcos_r50_fpn_coco_full.yml | преди 2 години | |
denseteacher_fcos_r50_fpn_coco_semi005.yml | преди 2 години | |
denseteacher_fcos_r50_fpn_coco_semi010.yml | преди 2 години | |
denseteacher_fcos_r50_fpn_coco_semi010_lsj.yml | преди 2 години |
简体中文 | English
注意:
Semi Epochs (Iters)
表示半监督训练的模型的 Epochs (Iters),如果使用自定义数据集,需自行根据Iters换算到对应的Epochs调整,最好保证总Iters 和COCO数据集的设置较为接近;Sup mAP
是只使用有监督数据训练的模型的精度,请参照基础检测器的配置文件 和 baseline;Semi mAP
是半监督训练的模型的精度,模型下载和配置文件的链接均为半监督模型;LSJ
表示 large-scale jittering,表示使用更大范围的多尺度训练,可进一步提升精度,但训练速度也会变慢;Dense Teacher
原文使用R50-va-caffe
预训练,PaddleDetection中默认使用R50-vb
预训练,如果使用R50-vd
结合SSLD的预训练模型,可进一步显著提升检测精度,同时backbone部分配置也需要做出相应更改,如:
python
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_vd_ssld_v2_pretrained.pdparams
ResNet:
depth: 50
variant: d
norm_type: bn
freeze_at: 0
return_idx: [1, 2, 3]
num_stages: 4
lr_mult_list: [0.05, 0.05, 0.1, 0.15]
仅训练时必须使用半监督检测的配置文件去训练,评估、预测、部署也可以按基础检测器的配置文件去执行。
# 单卡训练 (不推荐,需按线性比例相应地调整学习率)
CUDA_VISIBLE_DEVICES=0 python tools/train.py -c configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml --eval
# 多卡训练
python -m paddle.distributed.launch --log_dir=denseteacher_fcos_semi010/ --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml --eval
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml -o weights=output/denseteacher_fcos_r50_fpn_coco_semi010/model_final.pdparams
CUDA_VISIBLE_DEVICES=0 python tools/infer.py -c configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml -o weights=output/denseteacher_fcos_r50_fpn_coco_semi010/model_final.pdparams --infer_img=demo/000000014439.jpg
部署可以使用半监督检测配置文件,也可以使用基础检测器的配置文件去部署和使用。
# 导出模型
CUDA_VISIBLE_DEVICES=0 python tools/export_model.py -c configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml -o weights=https://paddledet.bj.bcebos.com/models/denseteacher_fcos_r50_fpn_coco_semi010.pdparams
# 导出权重预测
CUDA_VISIBLE_DEVICES=0 python deploy/python/infer.py --model_dir=output_inference/denseteacher_fcos_r50_fpn_coco_semi010 --image_file=demo/000000014439_640x640.jpg --device=GPU
# 部署测速
CUDA_VISIBLE_DEVICES=0 python deploy/python/infer.py --model_dir=output_inference/denseteacher_fcos_r50_fpn_coco_semi010 --image_file=demo/000000014439_640x640.jpg --device=GPU --run_benchmark=True # --run_mode=trt_fp16
# 导出ONNX
paddle2onnx --model_dir output_inference/denseteacher_fcos_r50_fpn_coco_semi010/ --model_filename model.pdmodel --params_filename model.pdiparams --opset_version 12 --save_file denseteacher_fcos_r50_fpn_coco_semi010.onnx
@article{denseteacher2022,
title={Dense Teacher: Dense Pseudo-Labels for Semi-supervised Object Detection},
author={Hongyu Zhou, Zheng Ge, Songtao Liu, Weixin Mao, Zeming Li, Haiyan Yu, Jian Sun},
journal={arXiv preprint arXiv:2207.02541},
year={2022}
}
模型 | 监督数据比例 | Sup Baseline | Sup Epochs (Iters) | Sup mAPval 0.5:0.95 | Semi mAPval 0.5:0.95 | Semi Epochs (Iters) | 模型下载 | 配置文件 |
---|---|---|---|---|---|---|---|---|
DenseTeacher-FCOS | 5% | sup_config | 24 (8712) | 21.3 | 30.6 | 240 (87120) | download | config |
DenseTeacher-FCOS | 10% | sup_config | 24 (17424) | 26.3 | 35.1 | 240 (174240) | download | config |
DenseTeacher-FCOS(LSJ) | 10% | sup_config | 24 (17424) | 26.3 | 37.1(LSJ) | 240 (174240) | download | config |
DenseTeacher-FCOS | 100%(full) | sup_config | 24 (175896) | 42.6 | 44.2 | 24 (175896) | download | config |