mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* add ncnn test exporter in test_ops.py * add ncnn test exporter in utils.py * add onnxruntime and tensorrt ops test * fix blank line * fix comment add nms ops test * remove nms test * add test sample add dockerstring * remove nms test * fix grid_sample add type hind * fix problem * fix dockerstring * add nms batch_nms multi_level_roi_align * add test data * fix problem * rm pkl file dependent * rm file * add docstring * remove multi_level_dependce * add mmseg module unittest * add mmseg test * add mmseg model unit test * fix blankline * rename file * add syncbn2bn unit test * add apis/export * lint * lint * ?? * delete# * fix ncnn check * fix problems * fix problems * fix dim problems * resolve comments * Fix SwitchBackendWrapper * fix assert problems * fix assert * Remove comment * merge master Co-authored-by: SingleZombie <singlezombie@163.com>
83 lines
2.3 KiB
Python
83 lines
2.3 KiB
Python
# dataset settings
|
|
dataset_type = 'CityscapesDataset'
|
|
data_root = 'data/cityscapes/'
|
|
img_norm_cfg = dict(
|
|
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
|
crop_size = (512, 1024)
|
|
|
|
test_pipeline = [
|
|
dict(type='LoadImageFromFile'),
|
|
dict(
|
|
type='MultiScaleFlipAug',
|
|
img_scale=(2048, 1024),
|
|
flip=False,
|
|
transforms=[
|
|
dict(type='Resize', keep_ratio=True),
|
|
dict(type='RandomFlip'),
|
|
dict(type='Normalize', **img_norm_cfg),
|
|
dict(type='ImageToTensor', keys=['img']),
|
|
dict(type='Collect', keys=['img']),
|
|
])
|
|
]
|
|
data = dict(
|
|
samples_per_gpu=1,
|
|
workers_per_gpu=1,
|
|
val=dict(
|
|
type=dataset_type,
|
|
data_root=data_root,
|
|
img_dir='leftImg8bit/val',
|
|
ann_dir='gtFine/val',
|
|
pipeline=test_pipeline),
|
|
test=dict(
|
|
type=dataset_type,
|
|
data_root=data_root,
|
|
img_dir='leftImg8bit/val',
|
|
ann_dir='gtFine/val',
|
|
pipeline=test_pipeline))
|
|
|
|
# model settings
|
|
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
|
model = dict(
|
|
type='EncoderDecoder',
|
|
pretrained='open-mmlab://resnet50_v1c',
|
|
backbone=dict(
|
|
type='ResNetV1c',
|
|
depth=50,
|
|
num_stages=4,
|
|
out_indices=(0, 1, 2, 3),
|
|
dilations=(1, 1, 2, 4),
|
|
strides=(1, 2, 1, 1),
|
|
norm_cfg=norm_cfg,
|
|
norm_eval=False,
|
|
style='pytorch',
|
|
contract_dilation=True),
|
|
decode_head=dict(
|
|
type='FCNHead',
|
|
in_channels=2048,
|
|
in_index=3,
|
|
channels=512,
|
|
num_convs=2,
|
|
concat_input=True,
|
|
dropout_ratio=0.1,
|
|
num_classes=19,
|
|
norm_cfg=norm_cfg,
|
|
align_corners=False,
|
|
loss_decode=dict(
|
|
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
|
|
auxiliary_head=dict(
|
|
type='FCNHead',
|
|
in_channels=1024,
|
|
in_index=2,
|
|
channels=256,
|
|
num_convs=1,
|
|
concat_input=False,
|
|
dropout_ratio=0.1,
|
|
num_classes=19,
|
|
norm_cfg=norm_cfg,
|
|
align_corners=False,
|
|
loss_decode=dict(
|
|
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
|
|
# model training and testing settings
|
|
train_cfg=dict(),
|
|
test_cfg=dict(mode='whole'))
|