Skip to content

Commit cf84ffb

Browse files
committed
refactor: 📝 change mad test_y_channel to be false by default
1 parent 26c113a commit cf84ffb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyiqa/archs/mad_arch.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class MAD(torch.nn.Module):
272272
(2010): 011006.
273273
"""
274274

275-
def __init__(self, channels=3, test_y_channel=True):
275+
def __init__(self, channels=3, test_y_channel=False):
276276
super(MAD, self).__init__()
277277
self.channels = channels
278278
self.test_y_channel = test_y_channel
@@ -287,6 +287,9 @@ def mad(self, ref, dst):
287287
ref = to_y_channel(ref, 255.)
288288
dst = to_y_channel(dst, 255.)
289289
self.channels = 1
290+
else:
291+
ref = ref * 255
292+
dst = dst * 255
290293

291294
HI = hi_index(ref, dst)
292295
LO = lo_index(ref, dst)

pyiqa/default_model_configs.py

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@
144144
'mad': {
145145
'metric_opts': {
146146
'type': 'MAD',
147-
'test_y_channel': True,
148147
},
149148
'metric_mode': 'FR',
150149
'lower_better': True,

0 commit comments

Comments
 (0)