更换文档检测模型
This commit is contained in:
36
paddle_detection/configs/deformable_detr/README.md
Normal file
36
paddle_detection/configs/deformable_detr/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Deformable DETR
|
||||
|
||||
## Introduction
|
||||
|
||||
|
||||
Deformable DETR is an object detection model based on DETR. We reproduced the model of the paper.
|
||||
|
||||
|
||||
## Model Zoo
|
||||
|
||||
| Backbone | Model | Images/GPU | Epochs | Box AP | Config | Log | Download |
|
||||
|:--------:|:---------------:|:----------:|:------:|:------:|:------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------:|
|
||||
| R-50 | Deformable DETR | 2 | 50 | 44.5 | [config](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/configs/deformable_detr/deformable_detr_r50_1x_coco.yml) | [log](https://bj.bcebos.com/v1/paddledet/logs/deformable_detr_r50_1x_coco_44.5.log) | [model](https://paddledet.bj.bcebos.com/models/deformable_detr_r50_1x_coco.pdparams) |
|
||||
|
||||
**Notes:**
|
||||
|
||||
- Deformable DETR is trained on COCO train2017 dataset and evaluated on val2017 results of `mAP(IoU=0.5:0.95)`.
|
||||
- Deformable DETR uses 8GPU to train 50 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/deformable_detr/deformable_detr_r50_1x_coco.yml --fleet
|
||||
```
|
||||
|
||||
## Citations
|
||||
```
|
||||
@inproceedings{
|
||||
zhu2021deformable,
|
||||
title={Deformable DETR: Deformable Transformers for End-to-End Object Detection},
|
||||
author={Xizhou Zhu and Weijie Su and Lewei Lu and Bin Li and Xiaogang Wang and Jifeng Dai},
|
||||
booktitle={International Conference on Learning Representations},
|
||||
year={2021},
|
||||
url={https://openreview.net/forum?id=gZ9hCDWe6ke}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,48 @@
|
||||
architecture: DETR
|
||||
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_vb_normal_pretrained.pdparams
|
||||
hidden_dim: 256
|
||||
use_focal_loss: True
|
||||
|
||||
|
||||
DETR:
|
||||
backbone: ResNet
|
||||
transformer: DeformableTransformer
|
||||
detr_head: DeformableDETRHead
|
||||
post_process: DETRPostProcess
|
||||
|
||||
|
||||
ResNet:
|
||||
# index 0 stands for res2
|
||||
depth: 50
|
||||
norm_type: bn
|
||||
freeze_at: 0
|
||||
return_idx: [1, 2, 3]
|
||||
lr_mult_list: [0.0, 0.1, 0.1, 0.1]
|
||||
num_stages: 4
|
||||
|
||||
|
||||
DeformableTransformer:
|
||||
num_queries: 300
|
||||
position_embed_type: sine
|
||||
nhead: 8
|
||||
num_encoder_layers: 6
|
||||
num_decoder_layers: 6
|
||||
dim_feedforward: 1024
|
||||
dropout: 0.1
|
||||
activation: relu
|
||||
num_feature_levels: 4
|
||||
num_encoder_points: 4
|
||||
num_decoder_points: 4
|
||||
|
||||
|
||||
DeformableDETRHead:
|
||||
num_mlp_layers: 3
|
||||
|
||||
|
||||
DETRLoss:
|
||||
loss_coeff: {class: 2, bbox: 5, giou: 2}
|
||||
aux_loss: True
|
||||
|
||||
|
||||
HungarianMatcher:
|
||||
matcher_coeff: {class: 2, bbox: 5, giou: 2}
|
||||
@@ -0,0 +1,44 @@
|
||||
worker_num: 2
|
||||
TrainReader:
|
||||
sample_transforms:
|
||||
- Decode: {}
|
||||
- RandomFlip: {prob: 0.5}
|
||||
- RandomSelect: { transforms1: [ RandomShortSideResize: { short_side_sizes: [ 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800 ], max_size: 1333 } ],
|
||||
transforms2: [
|
||||
RandomShortSideResize: { short_side_sizes: [ 400, 500, 600 ] },
|
||||
RandomSizeCrop: { min_size: 384, max_size: 600 },
|
||||
RandomShortSideResize: { short_side_sizes: [ 480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800 ], max_size: 1333 } ]
|
||||
}
|
||||
- NormalizeImage: {is_scale: true, mean: [0.485,0.456,0.406], std: [0.229, 0.224,0.225]}
|
||||
- NormalizeBox: {}
|
||||
- BboxXYXY2XYWH: {}
|
||||
- Permute: {}
|
||||
batch_transforms:
|
||||
- PadMaskBatch: {pad_to_stride: -1, return_pad_mask: true}
|
||||
batch_size: 2
|
||||
shuffle: true
|
||||
drop_last: true
|
||||
collate_batch: false
|
||||
use_shared_memory: false
|
||||
|
||||
|
||||
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_size: 1
|
||||
shuffle: false
|
||||
drop_last: 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_size: 1
|
||||
shuffle: false
|
||||
drop_last: false
|
||||
@@ -0,0 +1,16 @@
|
||||
epoch: 50
|
||||
|
||||
LearningRate:
|
||||
base_lr: 0.0002
|
||||
schedulers:
|
||||
- !PiecewiseDecay
|
||||
gamma: 0.1
|
||||
milestones: [40]
|
||||
use_warmup: false
|
||||
|
||||
OptimizerBuilder:
|
||||
clip_grad_by_norm: 0.1
|
||||
regularizer: false
|
||||
optimizer:
|
||||
type: AdamW
|
||||
weight_decay: 0.0001
|
||||
@@ -0,0 +1,9 @@
|
||||
_BASE_: [
|
||||
'../datasets/coco_detection.yml',
|
||||
'../runtime.yml',
|
||||
'_base_/deformable_optimizer_1x.yml',
|
||||
'_base_/deformable_detr_r50.yml',
|
||||
'_base_/deformable_detr_reader.yml',
|
||||
]
|
||||
weights: output/deformable_detr_r50_1x_coco/model_final
|
||||
find_unused_parameters: True
|
||||
Reference in New Issue
Block a user