Merge branch 'limengzhang/fix_testpipeline_loadannotation' into 'refactor_dev'

[Fix] Fix no LoadAnnotations in testpipeline

See merge request openmmlab-enterprise/openmmlab-ce/mmsegmentation!41
pull/1801/head
zhengmiao 2022-06-13 05:33:34 +00:00
commit e5d4cc2807
31 changed files with 92 additions and 0 deletions

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2560, 640), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -15,6 +15,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=img_scale, keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 1024), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -12,6 +12,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 1024), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

View File

@ -12,6 +12,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2049, 1025), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

View File

@ -12,6 +12,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2049, 1025), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

View File

@ -12,6 +12,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 1024), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -15,6 +15,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=img_scale, keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -15,6 +15,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=img_scale, keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -21,6 +21,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(896, 896), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(1024, 1024), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -17,6 +17,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=img_scale, keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -17,6 +17,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=img_scale, keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(512, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -15,6 +15,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=img_scale, keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -14,6 +14,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(512, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -7,6 +7,9 @@ test_pipeline = [
# img_ratios is [0.5, 0.75, 1.0, 1.25, 1.5, 1.75]
# original image scale is (2560, 640)
dict(type='Resize', scale=(2560, 640), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs'),
]
val_dataloader = dict(batch_size=1, dataset=dict(pipeline=test_pipeline))

View File

@ -7,6 +7,9 @@ test_pipeline = [
# img_ratios is [0.5, 0.75, 1.0, 1.25, 1.5, 1.75]
# original image scale is (2560, 640)
dict(type='Resize', scale=(2560, 640), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs'),
]
val_dataloader = dict(dataset=dict(pipeline=test_pipeline))

View File

@ -38,6 +38,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 1024), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
train_dataloader = dict(

View File

@ -32,6 +32,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 640), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

View File

@ -7,6 +7,9 @@ test_pipeline = [
# img_ratios is [0.5, 0.75, 1.0, 1.25, 1.5, 1.75]
# original image scale is (2048, 512)
dict(type='Resize', scale=(2048, 512), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
val_dataloader = dict(batch_size=1, dataset=dict(pipeline=test_pipeline))

View File

@ -9,6 +9,9 @@ model = dict(preprocess_cfg=preprocess_cfg)
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(1920, 1080), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
test_dataloader = dict(

View File

@ -10,6 +10,9 @@ model = dict(preprocess_cfg=preprocess_cfg)
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(1920, 1080), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
test_dataloader = dict(

View File

@ -10,6 +10,9 @@ model = dict(preprocess_cfg=preprocess_cfg)
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(1920, 1080), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
test_dataloader = dict(

View File

@ -10,6 +10,9 @@ model = dict(preprocess_cfg=preprocess_cfg)
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(1920, 1080), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations'),
dict(type='PackSegInputs')
]
test_dataloader = dict(

View File

@ -15,6 +15,9 @@ train_pipeline = [
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='Resize', scale=(2048, 640), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
dict(type='LoadAnnotations', reduce_zero_label=True),
dict(type='PackSegInputs')
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))

View File

@ -92,6 +92,8 @@ def test_config_data_pipeline():
to_float32 = load_img_pipeline.get('to_float32', False)
config_mod.train_pipeline.pop(0)
config_mod.test_pipeline.pop(0)
# remove loading annotation in test pipeline
config_mod.test_pipeline.pop(1)
train_pipeline = Compose(config_mod.train_pipeline)
test_pipeline = Compose(config_mod.test_pipeline)