Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to 1.0.0rc3. #1425

Merged
merged 63 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
9eff9b1
[Improve] add a version option in docs menu (#1162)
zengyh1900 Oct 8, 2022
f6886a1
[Enhance] update dev_scripts for link checking (#1164)
zengyh1900 Oct 8, 2022
944d3a8
[Refactoring] decompose the implementations of different metrics into…
zengyh1900 Oct 9, 2022
5a080ff
[Fix] Fix PPL bug (#1172)
plyfager Oct 9, 2022
0fdd4a8
[Fix] Fix some known bugs. (#1200)
LeoXing1996 Oct 10, 2022
11dcf18
[Fix] Benchmark related bugs (#1236)
plyfager Oct 11, 2022
1ca720d
[Enhancement] Support rerun failed or canceled jobs in `train_benchma…
LeoXing1996 Oct 11, 2022
e25023b
[Fix] Fix bugs in `sr test config`, `realbasicvsr config` and `pconv…
Z-Fran Oct 12, 2022
2547173
[Fix] fix test of Vid4 datasets bug (#1293)
Z-Fran Oct 14, 2022
fcd43a6
[Feature] Support multi-metrics with different sample-model (#1171)
LeoXing1996 Oct 14, 2022
5a38f5b
[Fix] fix GenerateSegmentIndices ut (#1302)
Z-Fran Oct 14, 2022
f33a09d
[Enhancement] Reduce the randomness in unit test of `stylegan3_utils.…
LeoXing1996 Oct 17, 2022
97d74d8
[CI] Fix GitHub windows CI (#1320)
LeoXing1996 Oct 17, 2022
836e180
[Fix] fix basicvsr++ mirror sequence bug (#1304)
Z-Fran Oct 17, 2022
591b666
[Fix] fix sisr-test psnr config (#1319)
Z-Fran Oct 17, 2022
1f71028
[Fix] fix vsr models pytorch2onnx (#1300)
Z-Fran Oct 17, 2022
3721df4
[Bug] Ensure the output type of `GenerateFacialHeatmap` is `np.float3…
LeoXing1996 Oct 17, 2022
013f106
[Bug] Fix sampling behavior of `unpaired_dataset.py` and urls in cyc…
LeoXing1996 Oct 17, 2022
c844581
[README] Fix TTSR's README (#1325)
LeoXing1996 Oct 17, 2022
1dd0529
[CI] Update `paths-ignore` for GitHub CI (#1327)
LeoXing1996 Oct 17, 2022
6498c61
[Bug] Save gt images in PGGAN's `forward` (#1328)
LeoXing1996 Oct 18, 2022
1e741ea
[Bug] Correct RDN number of channels (#1332)
ryanxingql Oct 18, 2022
d1725ae
[Bug] Revise flip transformation in some conditional gan's setting (#…
LeoXing1996 Oct 19, 2022
6261f9e
[Unit Test] Fix unit test of SNR (#1335)
LeoXing1996 Oct 19, 2022
20e5850
[Bug] Revise flavr config (#1336)
LeoXing1996 Oct 20, 2022
b90ac53
[Fix] fix realesrgan ema (#1341)
Z-Fran Oct 21, 2022
7713e5c
[Fix] Fix bugs find during benchmark running (#1348)
plyfager Oct 24, 2022
4cf90a6
[Fix] fix liif test config (#1353)
Z-Fran Oct 25, 2022
4353ab8
[Enhancement] Complete save_best in configs (#1349)
plyfager Oct 28, 2022
eb9fab5
[Config] Revise discriminator's learning rate of TTSR to align with 0…
LeoXing1996 Oct 28, 2022
38f805a
[Fix] fix edsr configs (#1367)
Z-Fran Oct 30, 2022
da10b0f
[Enhancement] Add pixel value clip in visualizer (#1365)
LeoXing1996 Oct 30, 2022
6653aa6
[Bug] Fix randomness in FixedCrop + add L1 loss in Pix2Pix (#1364)
LeoXing1996 Oct 30, 2022
4b55cdd
[Fix] fix realbasicvsr config (#1358)
Z-Fran Oct 30, 2022
a576d02
[Enhancement] Fix PESinGAN-inter-pad setting + add SinGAN Dataset + a…
LeoXing1996 Oct 30, 2022
6d83fb6
[Fix] fix types of exceptions in demos (#1372)
gaoyang07 Oct 31, 2022
3375fff
[Enhancement] Support deterministic training in benchmark (#1356)
LeoXing1996 Oct 31, 2022
9c0768f
[Fix] Avoid cast int and float in GenDataPreprocessor (#1385)
LeoXing1996 Oct 31, 2022
71961a7
[Config] Update metric config in ggan (#1386)
LeoXing1996 Oct 31, 2022
c3cff1d
[Config] Revise batch size in wang-gp's config (#1384)
LeoXing1996 Oct 31, 2022
bf7714e
[Fix]: add type and change default number of preprocess_div2k_dataset…
ruoningYu Oct 31, 2022
00c55b5
[Feature] Support qualitative comparison tools (#1303)
Z-Fran Nov 2, 2022
525767c
[Docs] Revise docs (change PackGenInputs and GenDataSample to mmediti…
LeoXing1996 Nov 2, 2022
424c48c
[Config] Revise Pix2Pix edges2shoes config (#1391)
LeoXing1996 Nov 2, 2022
73ba837
[Bug] fix rdn and srcnn train configs (#1392)
Z-Fran Nov 2, 2022
239bdf1
[Fix] Fix test/val pipeline of pegan configs (#1393)
plyfager Nov 2, 2022
5f2a4c0
[Fix] Modify Readme of S3 (#1398)
plyfager Nov 3, 2022
31fe019
[Fix] Correct fid of ggan (#1397)
plyfager Nov 3, 2022
3575ba9
[Feature] support instance_aware_colorization inference (#1370)
zengyh1900 Nov 3, 2022
ec162c2
Merge branch '1.x' of github.com:open-mmlab/mmediting into dev-1.x
zengyh1900 Nov 4, 2022
76722c1
[Bug] fix cain config (#1404)
Z-Fran Nov 4, 2022
c93fb02
[Fix] Revise config and pretrain model loading in esrgan (#1407)
LeoXing1996 Nov 4, 2022
3a18501
[Fix] Fix lsgan config (#1409)
plyfager Nov 4, 2022
b70695d
[Enhancement] Support `try_import` for `mmdet` (#1408)
LeoXing1996 Nov 4, 2022
3349986
[Enhancement] Set ``real_feat`` to cpu in inception_utils (#1415)
plyfager Nov 7, 2022
b616736
[Enhancement] git ignore slurm generated files (#1416)
plyfager Nov 7, 2022
cb8b6df
[Fix] modify readme and configs of stylegan2&pegan (#1418)
plyfager Nov 8, 2022
ce064f4
[Enhancement] Support try-import for `clip` (#1420)
LeoXing1996 Nov 9, 2022
17e6d13
[Enhancement]: Improve the rendering of Docs-API (#1373)
ruoningYu Nov 9, 2022
807239d
[Fix] Complete requirements (#1419)
plyfager Nov 9, 2022
a32d838
[Doc] Update changelog and README for 1.0.0rc3. (#1421)
LeoXing1996 Nov 10, 2022
454b914
[Bug] Install clip in merge stage test (#1423)
LeoXing1996 Nov 10, 2022
4f8df7a
[Fix] Install clip in windows CI (#1424)
LeoXing1996 Nov 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Fix] fix realesrgan ema (#1341)
* [Fix] fix realesrgan ema

* fix

* fix ut

* fix config

* fix ut
  • Loading branch information
Z-Fran authored Oct 21, 2022
commit b90ac533a06882dcbefe1eda52bc2d6fd08c110e
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@
is_use_sharpened_gt_in_pixel=True,
is_use_sharpened_gt_in_percep=True,
is_use_sharpened_gt_in_gan=False,
is_use_ema=True,
train_cfg=dict(start_iter=1000000),
test_cfg=dict(),
data_preprocessor=dict(
type='EditDataPreprocessor',
mean=[0, 0, 0],
std=[1, 1, 1],
mean=[0., 0., 0.],
std=[255., 255., 255.],
))

train_cfg = dict(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
upscale_factor=scale),
pixel_loss=dict(type='L1Loss', loss_weight=1.0, reduction='mean'),
is_use_sharpened_gt_in_pixel=True,
is_use_ema=True,
train_cfg=dict(),
test_cfg=dict(),
data_preprocessor=dict(
type='EditDataPreprocessor',
mean=[0, 0, 0],
std=[1, 1, 1],
mean=[0., 0., 0.],
std=[255., 255., 255.],
))

train_pipeline = [
Expand Down Expand Up @@ -177,7 +178,6 @@
val_pipeline = [
dict(type='LoadImageFromFile', key='img', channel_order='rgb'),
dict(type='LoadImageFromFile', key='gt', channel_order='rgb'),
dict(type='RescaleToZeroOne', keys=['img', 'gt']),
dict(type='PackEditInputs')
]

Expand Down Expand Up @@ -205,14 +205,13 @@
dataset=dict(
type=dataset_type,
metainfo=dict(dataset_type='set5', task_name='real_sr'),
data_root='data/set5',
data_prefix=dict(gt='HR', img='bicLRx4'),
data_root='data/Set5',
data_prefix=dict(gt='GTmod12', img='LRbicx4'),
pipeline=val_pipeline))

test_dataloader = val_dataloader

val_evaluator = [
dict(type='MAE'),
dict(type='PSNR'),
dict(type='SSIM'),
]
Expand Down Expand Up @@ -253,7 +252,7 @@
vis_backends=vis_backends,
fn_key='gt_path',
img_keys=['gt_img', 'input', 'pred_img'],
bgr2rgb=True)
bgr2rgb=False)
custom_hooks = [
dict(type='BasicVisualizationHook', interval=1),
dict(
Expand Down
2 changes: 2 additions & 0 deletions mmedit/models/editors/real_basicvsr/real_basicvsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def __init__(self,
is_use_sharpened_gt_in_pixel=False,
is_use_sharpened_gt_in_percep=False,
is_use_sharpened_gt_in_gan=False,
is_use_ema=False,
train_cfg=None,
test_cfg=None,
init_cfg=None,
Expand All @@ -72,6 +73,7 @@ def __init__(self,
is_use_sharpened_gt_in_pixel=is_use_sharpened_gt_in_pixel,
is_use_sharpened_gt_in_percep=is_use_sharpened_gt_in_percep,
is_use_sharpened_gt_in_gan=is_use_sharpened_gt_in_gan,
is_use_ema=is_use_ema,
train_cfg=train_cfg,
test_cfg=test_cfg,
init_cfg=init_cfg,
Expand Down
25 changes: 25 additions & 0 deletions mmedit/models/editors/real_esrgan/real_esrgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class RealESRGAN(SRGAN):
is_use_sharpened_gt_in_gan (bool, optional): Whether to use the
image sharpened by unsharp masking as the GT for adversarial loss.
Default: False.
is_use_ema (bool, optional): When to apply exponential moving average
on the network weights. Default: True.
train_cfg (dict): Config for training. Default: None.
You may change the training of gan by setting:
`disc_steps`: how many discriminator updates after one generate
Expand All @@ -56,6 +58,7 @@ def __init__(self,
is_use_sharpened_gt_in_pixel=False,
is_use_sharpened_gt_in_percep=False,
is_use_sharpened_gt_in_gan=False,
is_use_ema=True,
train_cfg=None,
test_cfg=None,
init_cfg=None,
Expand All @@ -75,12 +78,34 @@ def __init__(self,
self.is_use_sharpened_gt_in_pixel = is_use_sharpened_gt_in_pixel
self.is_use_sharpened_gt_in_percep = is_use_sharpened_gt_in_percep
self.is_use_sharpened_gt_in_gan = is_use_sharpened_gt_in_gan
self.is_use_ema = is_use_ema

if train_cfg is not None: # used for initializing from ema model
self.start_iter = train_cfg.get('start_iter', -1)
else:
self.start_iter = -1

def forward_tensor(self, inputs, data_samples=None, training=False):
"""Forward tensor. Returns result of simple forward.

Args:
inputs (torch.Tensor): batch input tensor collated by
:attr:`data_preprocessor`.
data_samples (List[BaseDataElement], optional):
data samples collated by :attr:`data_preprocessor`.
training (bool): Whether is training. Default: False.

Returns:
Tensor: result of simple forward.
"""

if training or not self.is_use_ema:
feats = self.generator(inputs)
else:
feats = self.generator_ema(inputs)

return feats

def g_step(self, batch_outputs, batch_gt_data):
"""G step of GAN: Calculate losses of generator.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_real_esrgan(init_weights):
is_use_sharpened_gt_in_pixel=False,
is_use_sharpened_gt_in_percep=False,
is_use_sharpened_gt_in_gan=False,
is_use_ema=False,
train_cfg=None,
test_cfg=None,
data_preprocessor=EditDataPreprocessor())
Expand Down Expand Up @@ -88,6 +89,12 @@ def test_real_esrgan(init_weights):
output = model.val_step(data)
assert output[0].output.pred_img.data.shape == (3, 128, 128)

# val_ema
model.generator_ema = model.generator
model.is_use_ema = True
output = model.val_step(data)
assert output[0].output.pred_img.data.shape == (3, 128, 128)

# feat
output = model(torch.rand(1, 3, 32, 32), mode='tensor')
assert output.shape == (1, 3, 128, 128)
Expand Down