Skip to content

Commit

Permalink
[CodeCamp #84] Support SwinIR model (#1476)
Browse files Browse the repository at this point in the history
* [Feature] Support SwinIR model

* [Feature] Support SwinIR model

* [Feature] Support SwinIR model

* [Feature] Support SwinIR model

* [Feature] Support SwinIR model

* [Feature] Support SwinIR model

* fix configs

* rename

* remove testdata

* refactor decompression test config

* update the readme

* [Feature] Support SwinIR model

* update random JPEG and noise

* update random JPEG and noise

* update real sr large config

* fix sr configs

* fix car and denoising configs

* fix random_degradations

* fix readme

* refactor swinirnet

* fix ut

* remove files

* fix init

* fix jpeg comp

* fix readme

* fix lint

* fix ut

* fix ut

* fix ut

Co-authored-by: Z-Fran <1396925302@qq.com>
Co-authored-by: Z-Fran <49083766+Z-Fran@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 30, 2022
1 parent c9ef99b commit 0a58456
Show file tree
Hide file tree
Showing 48 changed files with 4,367 additions and 20 deletions.
66 changes: 66 additions & 0 deletions configs/_base_/datasets/decompression_test_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
quality = 10
test_pipeline = [
dict(
type='LoadImageFromFile',
key='img',
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(
type='LoadImageFromFile',
key='gt',
color_type='color',
channel_order='rgb',
imdecode_backend='cv2'),
dict(
type='RandomJPEGCompression',
params=dict(quality=[quality, quality], color_type='color'),
bgr2rgb=True,
keys=['img']),
dict(type='PackEditInputs')
]

classic5_data_root = 'data/Classic5'
classic5_dataloader = dict(
num_workers=4,
persistent_workers=False,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False),
dataset=dict(
type='BasicImageDataset',
metainfo=dict(dataset_type='classic5', task_name='CAR'),
data_root=classic5_data_root,
data_prefix=dict(img='', gt=''),
pipeline=test_pipeline))
classic5_evaluator = [
dict(type='PSNR', prefix='Classic5'),
dict(type='SSIM', prefix='Classic5'),
]

live1_data_root = 'data/LIVE1'
live1_dataloader = dict(
num_workers=4,
persistent_workers=False,
drop_last=False,
sampler=dict(type='DefaultSampler', shuffle=False),
dataset=dict(
type='BasicImageDataset',
metainfo=dict(dataset_type='live1', task_name='CAR'),
data_root=live1_data_root,
data_prefix=dict(img='', gt=''),
pipeline=test_pipeline))
live1_evaluator = [
dict(type='PSNR', prefix='LIVE1'),
dict(type='SSIM', prefix='LIVE1'),
]

# test config
test_cfg = dict(type='MultiTestLoop')
test_dataloader = [
classic5_dataloader,
live1_dataloader,
]
test_evaluator = [
classic5_evaluator,
live1_evaluator,
]
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
params=dict(
noise_type=['gaussian'],
noise_prob=[1],
gaussian_sigma=[sigma * 255, sigma * 255],
gaussian_sigma=[sigma, sigma],
gaussian_gray_noise_prob=0),
keys=['img']),
dict(type='PackEditInputs')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
params=dict(
noise_type=['gaussian'],
noise_prob=[1],
gaussian_sigma=[sigma * 255, sigma * 255],
gaussian_sigma=[sigma, sigma],
gaussian_gray_noise_prob=1),
keys=['img']),
dict(type='PackEditInputs')
Expand Down
512 changes: 512 additions & 0 deletions configs/swinir/README.md

Large diffs are not rendered by default.

503 changes: 503 additions & 0 deletions configs/swinir/README_zh-CN.md

Large diffs are not rendered by default.

Loading

0 comments on commit 0a58456

Please sign in to comment.