From e169fc2ccb64c851916e843938d7b91397c8d63c Mon Sep 17 00:00:00 2001 From: ulisrael Date: Fri, 27 Dec 2024 22:01:10 -0800 Subject: [PATCH] simplified casting --- token_bench/metrics_cli.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/token_bench/metrics_cli.py b/token_bench/metrics_cli.py index 10f956e..e9bea88 100644 --- a/token_bench/metrics_cli.py +++ b/token_bench/metrics_cli.py @@ -164,14 +164,8 @@ def main_psnr_ssim() -> None: assert ( input0_file.split("/")[-1] == input1_file.split("/")[-1] ), "file names must match" - input0 = read_video(input0_file) - input1 = read_video(input1_file) - - # cast to float32 - if input0.dtype != np.float32: - input0 = input0.astype(np.float32) - if input1.dtype != np.float32: - input1 = input1.astype(np.float32) + input0 = read_video(input0_file).astype(np.float32) + input1 = read_video(input1_file).astype(np.float32) name = input0_file.split("/")[-1] psnr_value = PSNR(input0, input1)