Skip to content

Commit

Permalink
simplified casting
Browse files Browse the repository at this point in the history
  • Loading branch information
ulisrael committed Dec 28, 2024
1 parent 404dc6d commit e169fc2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions token_bench/metrics_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e169fc2

Please sign in to comment.