From e738ab0d8d43651de67c021aee3ed1f1b6036ee8 Mon Sep 17 00:00:00 2001 From: liuwenran <448073814@qq.com> Date: Fri, 20 Oct 2023 18:53:05 +0800 Subject: [PATCH] fix lint --- mmagic/configs/_base_/datasets/liif_test_config.py | 3 +-- mmagic/configs/_base_/datasets/lsun_stylegan.py | 5 +---- mmagic/configs/_base_/datasets/tdan_test_config.py | 12 ++++-------- mmagic/configs/_base_/models/base_deepfillv1.py | 10 +++------- mmagic/configs/_base_/models/base_deepfillv2.py | 3 +-- mmagic/configs/_base_/models/base_edvr.py | 11 +++-------- mmagic/configs/_base_/models/base_gl.py | 6 ++---- mmagic/configs/_base_/models/base_glean.py | 3 +-- mmagic/configs/_base_/models/base_liif.py | 8 ++------ mmagic/configs/_base_/models/base_styleganv1.py | 3 +-- .../_base_/models/dcgan/base_dcgan_128x128.py | 3 +-- 11 files changed, 20 insertions(+), 47 deletions(-) diff --git a/mmagic/configs/_base_/datasets/liif_test_config.py b/mmagic/configs/_base_/datasets/liif_test_config.py index f74861a39..343ab634b 100644 --- a/mmagic/configs/_base_/datasets/liif_test_config.py +++ b/mmagic/configs/_base_/datasets/liif_test_config.py @@ -17,8 +17,7 @@ color_type='color', channel_order='rgb', imdecode_backend='cv2'), - dict( - type=RandomDownSampling, scale_min=scale_test, scale_max=scale_test), + dict(type=RandomDownSampling, scale_min=scale_test, scale_max=scale_test), dict(type=GenerateCoordinateAndCell, scale=scale_test, reshape_gt=False), dict(type=PackInputs) ] for scale_test in scale_test_list] diff --git a/mmagic/configs/_base_/datasets/lsun_stylegan.py b/mmagic/configs/_base_/datasets/lsun_stylegan.py index dbb0da45d..1b66a8689 100644 --- a/mmagic/configs/_base_/datasets/lsun_stylegan.py +++ b/mmagic/configs/_base_/datasets/lsun_stylegan.py @@ -10,10 +10,7 @@ dict(type=PackInputs) ] -val_pipeline = [ - dict(type=LoadImageFromFile, key='gt'), - dict(type=PackInputs) -] +val_pipeline = [dict(type=LoadImageFromFile, key='gt'), dict(type=PackInputs)] # `batch_size` and `data_root` need to be set. train_dataloader = dict( diff --git a/mmagic/configs/_base_/datasets/tdan_test_config.py b/mmagic/configs/_base_/datasets/tdan_test_config.py index 224a9b5a8..1794cc040 100644 --- a/mmagic/configs/_base_/datasets/tdan_test_config.py +++ b/mmagic/configs/_base_/datasets/tdan_test_config.py @@ -51,18 +51,14 @@ SPMC_bd_evaluator = dict( type=Evaluator, metrics=[ - dict( - type=PSNR, crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'), - dict( - type=SSIM, crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'), + dict(type=PSNR, crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'), + dict(type=SSIM, crop_border=8, convert_to='Y', prefix='SPMCS-BDx4-Y'), ]) SPMC_bi_evaluator = dict( type=Evaluator, metrics=[ - dict( - type=PSNR, crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'), - dict( - type=SSIM, crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'), + dict(type=PSNR, crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'), + dict(type=SSIM, crop_border=8, convert_to='Y', prefix='SPMCS-BIx4-Y'), ]) # config for vid4 diff --git a/mmagic/configs/_base_/models/base_deepfillv1.py b/mmagic/configs/_base_/models/base_deepfillv1.py index 07b5ba878..7588597a4 100644 --- a/mmagic/configs/_base_/models/base_deepfillv1.py +++ b/mmagic/configs/_base_/models/base_deepfillv1.py @@ -28,9 +28,7 @@ type=GLEncoderDecoder, encoder=dict(type=DeepFillEncoder, padding_mode='reflect'), decoder=dict( - type=DeepFillDecoder, - in_channels=128, - padding_mode='reflect'), + type=DeepFillDecoder, in_channels=128, padding_mode='reflect'), dilation_neck=dict( type=GLDilationNeck, in_channels=128, @@ -56,8 +54,7 @@ in_channels=128, padding_mode='reflect'), decoder=dict( - type=DeepFillDecoder, - in_channels=256, + type=DeepFillDecoder, in_channels=256, padding_mode='reflect'))), disc=dict( type=DeepFillv1Discriminators, @@ -102,8 +99,7 @@ # optimizer optim_wrapper = dict( constructor='MultiOptimWrapperConstructor', - generator=dict( - type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0001)), + generator=dict(type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0001)), disc=dict(type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0001))) # learning policy diff --git a/mmagic/configs/_base_/models/base_deepfillv2.py b/mmagic/configs/_base_/models/base_deepfillv2.py index 843e8c4b5..0ed601203 100644 --- a/mmagic/configs/_base_/models/base_deepfillv2.py +++ b/mmagic/configs/_base_/models/base_deepfillv2.py @@ -106,8 +106,7 @@ # optimizer optim_wrapper = dict( constructor='MultiOptimWrapperConstructor', - generator=dict( - type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0001)), + generator=dict(type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0001)), disc=dict(type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0001))) # learning policy diff --git a/mmagic/configs/_base_/models/base_edvr.py b/mmagic/configs/_base_/models/base_edvr.py index 60f840482..0ae9a49ea 100644 --- a/mmagic/configs/_base_/models/base_edvr.py +++ b/mmagic/configs/_base_/models/base_edvr.py @@ -34,12 +34,8 @@ dict(type=SetValues, dictionary=dict(scale=scale)), dict(type=PairedRandomCrop, gt_patch_size=256), dict( - type=Flip, - keys=['img', 'gt'], - flip_ratio=0.5, - direction='horizontal'), - dict( - type=Flip, keys=['img', 'gt'], flip_ratio=0.5, direction='vertical'), + type=Flip, keys=['img', 'gt'], flip_ratio=0.5, direction='horizontal'), + dict(type=Flip, keys=['img', 'gt'], flip_ratio=0.5, direction='vertical'), dict(type=RandomTransposeHW, keys=['img', 'gt'], transpose_ratio=0.5), dict(type=PackInputs) ] @@ -112,8 +108,7 @@ ] test_evaluator = val_evaluator -train_cfg = dict( - type=IterBasedTrainLoop, max_iters=600_000, val_interval=5000) +train_cfg = dict(type=IterBasedTrainLoop, max_iters=600_000, val_interval=5000) val_cfg = dict(type=MultiValLoop) test_cfg = dict(type=MultiTestLoop) diff --git a/mmagic/configs/_base_/models/base_gl.py b/mmagic/configs/_base_/models/base_gl.py index 257cebade..30cb72db2 100644 --- a/mmagic/configs/_base_/models/base_gl.py +++ b/mmagic/configs/_base_/models/base_gl.py @@ -22,8 +22,7 @@ type=GLEncoderDecoder, encoder=dict(type=GLEncoder, norm_cfg=dict(type='SyncBN')), decoder=dict(type=GLDecoder, norm_cfg=dict(type='SyncBN')), - dilation_neck=dict( - type=GLDilationNeck, norm_cfg=dict(type='SyncBN'))), + dilation_neck=dict(type=GLDilationNeck, norm_cfg=dict(type='SyncBN'))), disc=dict( type=GLDiscs, global_disc_cfg=dict( @@ -56,8 +55,7 @@ # optimizer optim_wrapper = dict( constructor='MultiOptimWrapperConstructor', - generator=dict( - type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0004)), + generator=dict(type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0004)), disc=dict(type=OptimWrapper, optimizer=dict(type='Adam', lr=0.0004))) # learning policy diff --git a/mmagic/configs/_base_/models/base_glean.py b/mmagic/configs/_base_/models/base_glean.py index a0fcdc7f6..5a2faed3f 100644 --- a/mmagic/configs/_base_/models/base_glean.py +++ b/mmagic/configs/_base_/models/base_glean.py @@ -23,8 +23,7 @@ ] test_evaluator = val_evaluator -train_cfg = dict( - type=IterBasedTrainLoop, max_iters=300_000, val_interval=5000) +train_cfg = dict(type=IterBasedTrainLoop, max_iters=300_000, val_interval=5000) val_cfg = dict(type=MultiValLoop) test_cfg = dict(type=MultiTestLoop) diff --git a/mmagic/configs/_base_/models/base_liif.py b/mmagic/configs/_base_/models/base_liif.py index 6dfda8524..78cd4c05b 100644 --- a/mmagic/configs/_base_/models/base_liif.py +++ b/mmagic/configs/_base_/models/base_liif.py @@ -31,12 +31,8 @@ scale_max=scale_max, patch_size=48), dict( - type=Flip, - keys=['img', 'gt'], - flip_ratio=0.5, - direction='horizontal'), - dict( - type=Flip, keys=['img', 'gt'], flip_ratio=0.5, direction='vertical'), + type=Flip, keys=['img', 'gt'], flip_ratio=0.5, direction='horizontal'), + dict(type=Flip, keys=['img', 'gt'], flip_ratio=0.5, direction='vertical'), dict(type=RandomTransposeHW, keys=['img', 'gt'], transpose_ratio=0.5), dict(type=GenerateCoordinateAndCell, sample_quantity=2304), dict(type=PackInputs) diff --git a/mmagic/configs/_base_/models/base_styleganv1.py b/mmagic/configs/_base_/models/base_styleganv1.py index e64fba636..8068d6873 100644 --- a/mmagic/configs/_base_/models/base_styleganv1.py +++ b/mmagic/configs/_base_/models/base_styleganv1.py @@ -7,6 +7,5 @@ type=StyleGAN1, data_preprocessor=dict(type=DataPreprocessor), style_channels=512, - generator=dict( - type=StyleGAN1Generator, out_size=None, style_channels=512), + generator=dict(type=StyleGAN1Generator, out_size=None, style_channels=512), discriminator=dict(type=StyleGAN1Discriminator, in_size=None)) diff --git a/mmagic/configs/_base_/models/dcgan/base_dcgan_128x128.py b/mmagic/configs/_base_/models/dcgan/base_dcgan_128x128.py index 95623fce0..42cb98350 100644 --- a/mmagic/configs/_base_/models/dcgan/base_dcgan_128x128.py +++ b/mmagic/configs/_base_/models/dcgan/base_dcgan_128x128.py @@ -8,8 +8,7 @@ type=DCGAN, noise_size=100, data_preprocessor=dict(type=DataPreprocessor), - generator=dict( - type=DCGANGenerator, output_scale=128, base_channels=1024), + generator=dict(type=DCGANGenerator, output_scale=128, base_channels=1024), discriminator=dict( type=DCGANDiscriminator, input_scale=128,