StephanST's picture
adding better trained model
4f5e042
raw
history blame
7.21 kB
norm_cfg = dict(type='SyncBN', requires_grad=True)
data_preprocessor = dict(
type='SegDataPreProcessor',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
bgr_to_rgb=True,
pad_val=0,
seg_pad_val=255,
size=(416, 416))
model = dict(
type='EncoderDecoder',
data_preprocessor=dict(
type='SegDataPreProcessor',
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
bgr_to_rgb=True,
pad_val=0,
seg_pad_val=255,
size=(416, 416)),
pretrained='mmcls://mobilenet_v2',
backbone=dict(
type='MobileNetV2',
widen_factor=1.0,
strides=(1, 2, 2, 1, 1, 1, 1),
dilations=(1, 1, 1, 2, 2, 4, 4),
out_indices=(1, 2, 4, 6),
norm_cfg=dict(type='SyncBN', requires_grad=True)),
decode_head=dict(
type='DepthwiseSeparableASPPHead',
in_channels=320,
in_index=3,
channels=128,
dilations=(1, 12, 24, 36),
c1_in_channels=24,
c1_channels=12,
dropout_ratio=0.1,
num_classes=3,
norm_cfg=dict(type='SyncBN', requires_grad=True),
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
auxiliary_head=dict(
type='FCNHead',
in_channels=96,
in_index=2,
channels=64,
num_convs=1,
concat_input=False,
dropout_ratio=0.1,
num_classes=3,
norm_cfg=dict(type='SyncBN', requires_grad=True),
align_corners=False,
loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
train_cfg=dict(),
test_cfg=dict(mode='whole'))
dataset_type = 'DroneDataset'
data_root = 'data/drone_custom_dataset'
crop_size = (416, 416)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(
type='RandomResize',
scale=(2048, 416),
ratio_range=(0.5, 2.0),
keep_ratio=True),
dict(type='RandomCrop', crop_size=(416, 416), cat_max_ratio=0.75),
dict(type='RandomFlip', prob=0.5),
dict(type='PhotoMetricDistortion'),
dict(type='PackSegInputs')
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 416), keep_ratio=True),
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
img_ratios = [0.5, 0.75, 1.0, 1.25, 1.5, 1.75]
tta_pipeline = [
dict(type='LoadImageFromFile', backend_args=None),
dict(
type='TestTimeAug',
transforms=[[{
'type': 'Resize',
'scale_factor': 0.5,
'keep_ratio': True
}, {
'type': 'Resize',
'scale_factor': 0.75,
'keep_ratio': True
}, {
'type': 'Resize',
'scale_factor': 1.0,
'keep_ratio': True
}, {
'type': 'Resize',
'scale_factor': 1.25,
'keep_ratio': True
}, {
'type': 'Resize',
'scale_factor': 1.5,
'keep_ratio': True
}, {
'type': 'Resize',
'scale_factor': 1.75,
'keep_ratio': True
}],
[{
'type': 'RandomFlip',
'prob': 0.0,
'direction': 'horizontal'
}, {
'type': 'RandomFlip',
'prob': 1.0,
'direction': 'horizontal'
}], [{
'type': 'LoadAnnotations'
}], [{
'type': 'PackSegInputs'
}]])
]
train_dataloader = dict(
batch_size=24,
num_workers=1,
persistent_workers=True,
sampler=dict(type='InfiniteSampler', shuffle=True),
dataset=dict(
type='DroneDataset',
data_root='data/drone_custom_dataset',
data_prefix=dict(img_path='images', seg_map_path='anns'),
ann_file='train.txt',
pipeline=[
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(
type='RandomResize',
scale=(2048, 416),
ratio_range=(0.5, 2.0),
keep_ratio=True),
dict(type='RandomCrop', crop_size=(416, 416), cat_max_ratio=0.75),
dict(type='RandomFlip', prob=0.5),
dict(type='PhotoMetricDistortion'),
dict(type='PackSegInputs')
]))
val_dataloader = dict(
batch_size=1,
num_workers=4,
persistent_workers=True,
sampler=dict(type='DefaultSampler', shuffle=False),
dataset=dict(
type='DroneDataset',
data_root='data/drone_custom_dataset',
data_prefix=dict(img_path='images', seg_map_path='anns'),
ann_file='val.txt',
pipeline=[
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 416), keep_ratio=True),
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]))
test_dataloader = dict(
batch_size=1,
num_workers=4,
persistent_workers=True,
sampler=dict(type='DefaultSampler', shuffle=False),
dataset=dict(
type='DroneDataset',
data_root='data/drone_custom_dataset',
data_prefix=dict(img_path='images', seg_map_path='anns'),
ann_file='val.txt',
pipeline=[
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 416), keep_ratio=True),
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]))
val_evaluator = dict(type='IoUMetric', iou_metrics=['mIoU'])
test_evaluator = dict(type='IoUMetric', iou_metrics=['mIoU'])
default_scope = 'mmseg'
env_cfg = dict(
cudnn_benchmark=True,
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0),
dist_cfg=dict(backend='nccl'))
vis_backends = [dict(type='LocalVisBackend')]
visualizer = dict(
type='SegLocalVisualizer',
vis_backends=[dict(type='LocalVisBackend')],
name='visualizer')
log_processor = dict(by_epoch=False)
log_level = 'INFO'
load_from = None
resume = False
tta_model = dict(type='SegTTAModel')
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
optim_wrapper = dict(
type='OptimWrapper',
optimizer=dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005),
clip_grad=None)
param_scheduler = [
dict(
type='PolyLR',
eta_min=0.0001,
power=0.9,
begin=0,
end=240000,
by_epoch=False)
]
train_cfg = dict(
type='IterBasedTrainLoop', max_iters=240000, val_interval=24000)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
default_hooks = dict(
timer=dict(type='IterTimerHook'),
logger=dict(type='LoggerHook', interval=50, log_metric_by_epoch=False),
param_scheduler=dict(type='ParamSchedulerHook'),
checkpoint=dict(type='CheckpointHook', by_epoch=False, interval=24000),
sampler_seed=dict(type='DistSamplerSeedHook'),
visualization=dict(type='SegVisualizationHook'))
launcher = 'pytorch'
work_dir = './work_dirs/mobilenet_deeplab_drone'