| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- # Runtime
- use_gpu: true
- use_xpu: false
- use_mlu: false
- use_npu: false
- log_iter: 20
- save_dir: output
- snapshot_epoch: 1
- print_flops: false
- print_params: false
- use_ema: true
- # Dataset
- metric: COCO
- num_classes: 80
- TrainDataset:
- name: COCODataSet
- image_dir: train2017
- anno_path: annotations/instances_train2017.json
- dataset_dir: dataset/coco
- data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
- EvalDataset:
- name: COCODataSet
- image_dir: val2017
- anno_path: annotations/instances_val2017.json
- dataset_dir: dataset/coco
- allow_empty: true
- TestDataset:
- name: ImageFolder
- anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
- dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'
- # Reader
- worker_num: 2
- TrainReader:
- sample_transforms:
- - Decode: {}
- - RandomResize: {target_size: [[640, 1333], [672, 1333], [704, 1333], [736, 1333], [768, 1333], [800, 1333]], interp: 2, keep_ratio: True}
- - RandomFlip: {prob: 0.5}
- - 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: -1}
- batch_size: 1
- shuffle: true
- drop_last: true
- collate_batch: false
- EvalReader:
- sample_transforms:
- - Decode: {}
- - Resize: {interp: 2, 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: -1}
- batch_size: 1
- shuffle: false
- drop_last: false
- TestReader:
- sample_transforms:
- - Decode: {}
- - Resize: {interp: 2, 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: -1}
- batch_size: 1
- shuffle: false
- drop_last: false
- # Model
- architecture: FasterRCNN
- pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet101_pretrained.pdparams
- FasterRCNN:
- backbone: ResNet
- rpn_head: RPNHead
- bbox_head: BBoxHead
- # post process
- bbox_post_process: BBoxPostProcess
- ResNet:
- # index 0 stands for res2
- depth: 101
- norm_type: bn
- freeze_at: 0
- return_idx: [2]
- num_stages: 3
- RPNHead:
- anchor_generator:
- aspect_ratios: [0.5, 1.0, 2.0]
- anchor_sizes: [32, 64, 128, 256, 512]
- strides: [16]
- rpn_target_assign:
- batch_size_per_im: 256
- fg_fraction: 0.5
- negative_overlap: 0.3
- positive_overlap: 0.7
- use_random: True
- train_proposal:
- min_size: 0.0
- nms_thresh: 0.7
- pre_nms_top_n: 12000
- post_nms_top_n: 2000
- topk_after_collect: False
- test_proposal:
- min_size: 0.0
- nms_thresh: 0.7
- pre_nms_top_n: 6000
- post_nms_top_n: 1000
- BBoxHead:
- head: Res5Head
- roi_extractor:
- resolution: 14
- sampling_ratio: 0
- aligned: True
- bbox_assigner: BBoxAssigner
- with_pool: true
- BBoxAssigner:
- batch_size_per_im: 512
- bg_thresh: 0.5
- fg_thresh: 0.5
- fg_fraction: 0.25
- use_random: True
- BBoxPostProcess:
- decode: RCNNBox
- nms:
- name: MultiClassNMS
- keep_top_k: 100
- score_threshold: 0.05
- nms_threshold: 0.5
- # Optimizer
- epoch: 12
- LearningRate:
- base_lr: 0.01
- schedulers:
- - !PiecewiseDecay
- gamma: 0.1
- milestones: [8, 11]
- - !LinearWarmup
- start_factor: 0.1
- steps: 1000
- OptimizerBuilder:
- optimizer:
- momentum: 0.9
- type: Momentum
- regularizer:
- factor: 0.0001
- type: L2
- # Exporting the model
- export:
- post_process: True # Whether post-processing is included in the network when export model.
- nms: True # Whether NMS is included in the network when export model.
- benchmark: False # It is used to testing model performance, if set `True`, post-process and NMS will not be exported.
- fuse_conv_bn: False
|