123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- auto_scale_lr = dict(base_batch_size=32)
- backend_args = None
- data_root = '../../../media/tricolops/T7/Dataset/coco_format_bd/'
- dataset_type = 'CocoDataset'
- default_hooks = dict(
- checkpoint=dict(interval=10, type='CheckpointHook'),
- logger=dict(interval=50, type='LoggerHook'),
- param_scheduler=dict(type='ParamSchedulerHook'),
- sampler_seed=dict(type='DistSamplerSeedHook'),
- timer=dict(type='IterTimerHook'),
- visualization=dict(
- draw=True, test_out_dir='res', type='DetVisualizationHook'))
- default_scope = 'mmdet'
- env_cfg = dict(
- cudnn_benchmark=False,
- dist_cfg=dict(backend='nccl'),
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
- launcher = 'none'
- load_from = 'work_dirs/deformable-detr_r50_16xb2-50e_coco/epoch_470.pth'
- log_level = 'INFO'
- log_processor = dict(by_epoch=True, type='LogProcessor', window_size=50)
- max_epochs = 500
- metainfo = dict(
- classes=('barcode', ), palette=[
- (
- 220,
- 20,
- 60,
- ),
- ])
- model = dict(
- as_two_stage=False,
- backbone=dict(
- depth=50,
- frozen_stages=1,
- init_cfg=dict(checkpoint='torchvision://resnet50', type='Pretrained'),
- norm_cfg=dict(requires_grad=False, type='BN'),
- norm_eval=True,
- num_stages=4,
- out_indices=(
- 1,
- 2,
- 3,
- ),
- style='pytorch',
- type='ResNet'),
- bbox_head=dict(
- loss_bbox=dict(loss_weight=5.0, type='L1Loss'),
- loss_cls=dict(
- alpha=0.25,
- gamma=2.0,
- loss_weight=2.0,
- type='FocalLoss',
- use_sigmoid=True),
- loss_iou=dict(loss_weight=2.0, type='GIoULoss'),
- num_classes=1,
- sync_cls_avg_factor=True,
- type='DeformableDETRHead'),
- data_preprocessor=dict(
- bgr_to_rgb=True,
- mean=[
- 123.675,
- 116.28,
- 103.53,
- ],
- pad_size_divisor=1,
- std=[
- 58.395,
- 57.12,
- 57.375,
- ],
- type='DetDataPreprocessor'),
- decoder=dict(
- layer_cfg=dict(
- cross_attn_cfg=dict(batch_first=True, embed_dims=256),
- ffn_cfg=dict(
- embed_dims=256, feedforward_channels=1024, ffn_drop=0.1),
- self_attn_cfg=dict(
- batch_first=True, dropout=0.1, embed_dims=256, num_heads=8)),
- num_layers=6,
- post_norm_cfg=None,
- return_intermediate=True),
- encoder=dict(
- layer_cfg=dict(
- ffn_cfg=dict(
- embed_dims=256, feedforward_channels=1024, ffn_drop=0.1),
- self_attn_cfg=dict(batch_first=True, embed_dims=256)),
- num_layers=6),
- neck=dict(
- act_cfg=None,
- in_channels=[
- 512,
- 1024,
- 2048,
- ],
- kernel_size=1,
- norm_cfg=dict(num_groups=32, type='GN'),
- num_outs=4,
- out_channels=256,
- type='ChannelMapper'),
- num_feature_levels=4,
- num_queries=300,
- positional_encoding=dict(normalize=True, num_feats=128, offset=-0.5),
- test_cfg=dict(max_per_img=100),
- train_cfg=dict(
- assigner=dict(
- match_costs=[
- dict(type='FocalLossCost', weight=2.0),
- dict(box_format='xywh', type='BBoxL1Cost', weight=5.0),
- dict(iou_mode='giou', type='IoUCost', weight=2.0),
- ],
- type='HungarianAssigner')),
- type='DeformableDETR',
- with_box_refine=False)
- optim_wrapper = dict(
- clip_grad=dict(max_norm=10, norm_type=2),
- optimizer=dict(lr=0.0002, type='AdamW', weight_decay=0.0001),
- paramwise_cfg=dict(
- custom_keys=dict(
- backbone=dict(lr_mult=0.1),
- reference_points=dict(lr_mult=0.1),
- sampling_offsets=dict(lr_mult=0.1))),
- type='OptimWrapper')
- param_scheduler = [
- dict(
- begin=0,
- by_epoch=True,
- end=500,
- gamma=0.1,
- milestones=[
- 40,
- ],
- type='MultiStepLR'),
- ]
- resume = False
- test_cfg = dict(type='TestLoop')
- test_dataloader = dict(
- batch_size=1,
- dataset=dict(
- ann_file='Val/Val.json',
- backend_args=None,
- data_prefix=dict(img='Val/'),
- data_root='../../../media/tricolops/T7/Dataset/coco_format_bd/',
- metainfo=dict(classes=('barcode', ), palette=[
- (
- 220,
- 20,
- 60,
- ),
- ]),
- pipeline=[
- dict(backend_args=None, type='LoadImageFromFile'),
- dict(keep_ratio=True, scale=(
- 640,
- 640,
- ), type='Resize'),
- dict(type='LoadAnnotations', with_bbox=True),
- dict(
- meta_keys=(
- 'img_id',
- 'img_path',
- 'ori_shape',
- 'img_shape',
- 'scale_factor',
- ),
- type='PackDetInputs'),
- ],
- test_mode=True,
- type='CocoDataset'),
- drop_last=False,
- num_workers=2,
- persistent_workers=True,
- sampler=dict(shuffle=False, type='DefaultSampler'))
- test_evaluator = dict(
- ann_file='../../../media/tricolops/T7/Dataset/coco_format_bd/Val/Val.json',
- backend_args=None,
- format_only=False,
- metric='bbox',
- type='CocoMetric')
- test_pipeline = [
- dict(backend_args=None, type='LoadImageFromFile'),
- dict(keep_ratio=True, scale=(
- 640,
- 640,
- ), type='Resize'),
- dict(type='LoadAnnotations', with_bbox=True),
- dict(
- meta_keys=(
- 'img_id',
- 'img_path',
- 'ori_shape',
- 'img_shape',
- 'scale_factor',
- ),
- type='PackDetInputs'),
- ]
- train_cfg = dict(max_epochs=500, type='EpochBasedTrainLoop', val_interval=10)
- train_dataloader = dict(
- batch_sampler=dict(type='AspectRatioBatchSampler'),
- batch_size=4,
- dataset=dict(
- ann_file='Train/Train.json',
- backend_args=None,
- data_prefix=dict(img='Train/'),
- data_root='../../../media/tricolops/T7/Dataset/coco_format_bd/',
- filter_cfg=dict(filter_empty_gt=False, min_size=32),
- metainfo=dict(classes=('barcode', ), palette=[
- (
- 220,
- 20,
- 60,
- ),
- ]),
- pipeline=[
- dict(backend_args=None, type='LoadImageFromFile'),
- dict(type='LoadAnnotations', with_bbox=True),
- dict(prob=0.5, type='RandomFlip'),
- dict(
- keep_ratio=True,
- ratio_range=(
- 0.5,
- 2.0,
- ),
- scale=(
- 640,
- 640,
- ),
- type='RandomResize'),
- dict(crop_size=(
- 640,
- 640,
- ), type='RandomCrop'),
- dict(type='PackDetInputs'),
- ],
- type='CocoDataset'),
- num_workers=2,
- persistent_workers=True,
- sampler=dict(shuffle=True, type='DefaultSampler'))
- train_pipeline = [
- dict(backend_args=None, type='LoadImageFromFile'),
- dict(type='LoadAnnotations', with_bbox=True),
- dict(prob=0.5, type='RandomFlip'),
- dict(
- keep_ratio=True,
- ratio_range=(
- 0.5,
- 2.0,
- ),
- scale=(
- 640,
- 640,
- ),
- type='RandomResize'),
- dict(crop_size=(
- 640,
- 640,
- ), type='RandomCrop'),
- dict(type='PackDetInputs'),
- ]
- val_cfg = dict(type='ValLoop')
- val_dataloader = dict(
- batch_size=1,
- dataset=dict(
- ann_file='Val/Val.json',
- backend_args=None,
- data_prefix=dict(img='Val/'),
- data_root='../../../media/tricolops/T7/Dataset/coco_format_bd/',
- metainfo=dict(classes=('barcode', ), palette=[
- (
- 220,
- 20,
- 60,
- ),
- ]),
- pipeline=[
- dict(backend_args=None, type='LoadImageFromFile'),
- dict(keep_ratio=True, scale=(
- 640,
- 640,
- ), type='Resize'),
- dict(type='LoadAnnotations', with_bbox=True),
- dict(
- meta_keys=(
- 'img_id',
- 'img_path',
- 'ori_shape',
- 'img_shape',
- 'scale_factor',
- ),
- type='PackDetInputs'),
- ],
- test_mode=True,
- type='CocoDataset'),
- drop_last=False,
- num_workers=2,
- persistent_workers=True,
- sampler=dict(shuffle=False, type='DefaultSampler'))
- val_evaluator = dict(
- ann_file='../../../media/tricolops/T7/Dataset/coco_format_bd/Val/Val.json',
- backend_args=None,
- format_only=False,
- metric='bbox',
- type='CocoMetric')
- vis_backends = [
- dict(type='LocalVisBackend'),
- ]
- visualizer = dict(
- name='visualizer',
- type='DetLocalVisualizer',
- vis_backends=[
- dict(type='LocalVisBackend'),
- ])
- work_dir = 'result'
|