Fix case of inf XPSNR scores
Each plane is treated independently
This commit is contained in:
@@ -231,11 +231,11 @@ def get_xpsnr(xpsnr_txt_path):
|
|||||||
|
|
||||||
with xpsnr_txt_path.open("r") as file:
|
with xpsnr_txt_path.open("r") as file:
|
||||||
for line in file:
|
for line in file:
|
||||||
match = re.search(r"XPSNR [yY]: ([0-9]+\.[0-9]+) XPSNR [uU]: ([0-9]+\.[0-9]+) XPSNR [vV]: ([0-9]+\.[0-9]+)", line)
|
match = re.search(r"XPSNR [yY]: ([0-9]+\.[0-9]+|inf) XPSNR [uU]: ([0-9]+\.[0-9]+|inf) XPSNR [vV]: ([0-9]+\.[0-9]+|inf)", line)
|
||||||
if match:
|
if match:
|
||||||
Y = float(match.group(1))
|
Y = float(match.group(1)) if match.group(1) != 'inf' else 100.0
|
||||||
U = float(match.group(2))
|
U = float(match.group(2)) if match.group(2) != 'inf' else 100.0
|
||||||
V = float(match.group(3))
|
V = float(match.group(3)) if match.group(3) != 'inf' else 100.0
|
||||||
W = (4 * Y + U + V) / 6
|
W = (4 * Y + U + V) / 6
|
||||||
|
|
||||||
sum_weighted += W
|
sum_weighted += W
|
||||||
|
|||||||
Reference in New Issue
Block a user