Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
liuwenran committed Oct 20, 2023
1 parent 9f110f5 commit e738ab0
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 47 deletions.
3 changes: 1 addition & 2 deletions mmagic/configs/_base_/datasets/liif_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 1 addition & 4 deletions mmagic/configs/_base_/datasets/lsun_stylegan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
12 changes: 4 additions & 8 deletions mmagic/configs/_base_/datasets/tdan_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions mmagic/configs/_base_/models/base_deepfillv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions mmagic/configs/_base_/models/base_deepfillv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 3 additions & 8 deletions mmagic/configs/_base_/models/base_edvr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 2 additions & 4 deletions mmagic/configs/_base_/models/base_gl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions mmagic/configs/_base_/models/base_glean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 2 additions & 6 deletions mmagic/configs/_base_/models/base_liif.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions mmagic/configs/_base_/models/base_styleganv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
3 changes: 1 addition & 2 deletions mmagic/configs/_base_/models/dcgan/base_dcgan_128x128.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e738ab0

Please sign in to comment.