更换文档检测模型
This commit is contained in:
35
paddle_detection/configs/tood/README.md
Normal file
35
paddle_detection/configs/tood/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# TOOD
|
||||
|
||||
## Introduction
|
||||
|
||||
[TOOD: Task-aligned One-stage Object Detection](https://arxiv.org/abs/2108.07755)
|
||||
|
||||
TOOD is an object detection model. We reproduced the model of the paper.
|
||||
|
||||
|
||||
## Model Zoo
|
||||
|
||||
| Backbone | Model | Images/GPU | Inf time (fps) | Box AP | Config | Download |
|
||||
|:------:|:--------:|:--------:|:--------------:|:------:|:------:|:--------:|
|
||||
| R-50 | TOOD | 4 | --- | 42.5 | [config](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/configs/tood/tood_r50_fpn_1x_coco.yml) | [model](https://paddledet.bj.bcebos.com/models/tood_r50_fpn_1x_coco.pdparams) |
|
||||
|
||||
**Notes:**
|
||||
|
||||
- TOOD is trained on COCO train2017 dataset and evaluated on val2017 results of `mAP(IoU=0.5:0.95)`.
|
||||
- TOOD uses 8GPU to train 12 epochs.
|
||||
|
||||
GPU multi-card training
|
||||
```bash
|
||||
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
|
||||
python -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/tood/tood_r50_fpn_1x_coco.yml --fleet
|
||||
```
|
||||
|
||||
## Citations
|
||||
```
|
||||
@inproceedings{feng2021tood,
|
||||
title={TOOD: Task-aligned One-stage Object Detection},
|
||||
author={Feng, Chengjian and Zhong, Yujie and Gao, Yu and Scott, Matthew R and Huang, Weilin},
|
||||
booktitle={ICCV},
|
||||
year={2021}
|
||||
}
|
||||
```
|
||||
19
paddle_detection/configs/tood/_base_/optimizer_1x.yml
Normal file
19
paddle_detection/configs/tood/_base_/optimizer_1x.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
epoch: 12
|
||||
|
||||
LearningRate:
|
||||
base_lr: 0.01
|
||||
schedulers:
|
||||
- !PiecewiseDecay
|
||||
gamma: 0.1
|
||||
milestones: [8, 11]
|
||||
- !LinearWarmup
|
||||
start_factor: 0.001
|
||||
steps: 500
|
||||
|
||||
OptimizerBuilder:
|
||||
optimizer:
|
||||
momentum: 0.9
|
||||
type: Momentum
|
||||
regularizer:
|
||||
factor: 0.0001
|
||||
type: L2
|
||||
42
paddle_detection/configs/tood/_base_/tood_r50_fpn.yml
Normal file
42
paddle_detection/configs/tood/_base_/tood_r50_fpn.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
architecture: TOOD
|
||||
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
|
||||
|
||||
TOOD:
|
||||
backbone: ResNet
|
||||
neck: FPN
|
||||
head: TOODHead
|
||||
|
||||
ResNet:
|
||||
depth: 50
|
||||
variant: b
|
||||
norm_type: bn
|
||||
freeze_at: 0
|
||||
return_idx: [1, 2, 3]
|
||||
num_stages: 4
|
||||
|
||||
FPN:
|
||||
out_channel: 256
|
||||
spatial_scales: [0.125, 0.0625, 0.03125]
|
||||
extra_stage: 2
|
||||
has_extra_convs: true
|
||||
use_c5: false
|
||||
|
||||
TOODHead:
|
||||
stacked_convs: 6
|
||||
grid_cell_scale: 8
|
||||
static_assigner_epoch: 4
|
||||
loss_weight: { class: 1.0, iou: 2.0 }
|
||||
static_assigner:
|
||||
name: ATSSAssigner
|
||||
topk: 9
|
||||
assigner:
|
||||
name: TaskAlignedAssigner
|
||||
topk: 13
|
||||
alpha: 1.0
|
||||
beta: 6.0
|
||||
nms:
|
||||
name: MultiClassNMS
|
||||
nms_top_k: 1000
|
||||
keep_top_k: 100
|
||||
score_threshold: 0.05
|
||||
nms_threshold: 0.6
|
||||
40
paddle_detection/configs/tood/_base_/tood_reader.yml
Normal file
40
paddle_detection/configs/tood/_base_/tood_reader.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
worker_num: 4
|
||||
TrainReader:
|
||||
sample_transforms:
|
||||
- Decode: {}
|
||||
- RandomFlip: {prob: 0.5}
|
||||
- Resize: {target_size: [800, 1333], keep_ratio: true}
|
||||
- NormalizeImage: {is_scale: true, mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225]}
|
||||
- Permute: {}
|
||||
batch_transforms:
|
||||
- PadBatch: {pad_to_stride: 32}
|
||||
- PadGT: {}
|
||||
batch_size: 4
|
||||
shuffle: true
|
||||
drop_last: true
|
||||
collate_batch: true
|
||||
use_shared_memory: true
|
||||
|
||||
|
||||
EvalReader:
|
||||
sample_transforms:
|
||||
- Decode: {}
|
||||
- Resize: {target_size: [800, 1333], keep_ratio: True}
|
||||
- NormalizeImage: {is_scale: true, mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225]}
|
||||
- Permute: {}
|
||||
batch_transforms:
|
||||
- PadBatch: {pad_to_stride: 32}
|
||||
batch_size: 1
|
||||
shuffle: false
|
||||
|
||||
|
||||
TestReader:
|
||||
sample_transforms:
|
||||
- Decode: {}
|
||||
- Resize: {target_size: [800, 1333], keep_ratio: True}
|
||||
- NormalizeImage: {is_scale: true, mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225]}
|
||||
- Permute: {}
|
||||
batch_transforms:
|
||||
- PadBatch: {pad_to_stride: 32}
|
||||
batch_size: 1
|
||||
shuffle: false
|
||||
11
paddle_detection/configs/tood/tood_r50_fpn_1x_coco.yml
Normal file
11
paddle_detection/configs/tood/tood_r50_fpn_1x_coco.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
_BASE_: [
|
||||
'../datasets/coco_detection.yml',
|
||||
'../runtime.yml',
|
||||
'_base_/tood_r50_fpn.yml',
|
||||
'_base_/optimizer_1x.yml',
|
||||
'_base_/tood_reader.yml',
|
||||
]
|
||||
|
||||
weights: output/tood_r50_fpn_1x_coco/model_final
|
||||
find_unused_parameters: True
|
||||
log_iter: 100
|
||||
Reference in New Issue
Block a user