Skip to content

Commit

Permalink
Use tuple for datat range & fixed the missing range in the psnr_01_ep…
Browse files Browse the repository at this point in the history
…s case
  • Loading branch information
FelixSteinbauer authored Aug 10, 2023
1 parent 1d492aa commit 5690df7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GANDLF/cli/generate_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,14 @@ def __percentile_clip(input_tensor, reference_tensor=None, p_min=0.5, p_max=99.5
overall_stats_dict[current_subject_id][
"psnr_01"
] = peak_signal_noise_ratio(
gt_image_infill, output_infill, data_range=1.0
gt_image_infill, output_infill, data_range=(0,1)
).item()

# same as above but with epsilon for robustness
overall_stats_dict[current_subject_id][
"psnr_01_eps"
] = peak_signal_noise_ratio(
gt_image_infill, output_infill, epsilon=sys.float_info.epsilon
gt_image_infill, output_infill, data_range=(0,1), epsilon=sys.float_info.epsilon
).item()

pprint(overall_stats_dict)
Expand Down

0 comments on commit 5690df7

Please sign in to comment.