What: We force user to provide a data_range as input to psnr() function.
Why: out psnr() function is based on peak_signal_noise_ratio function from skimage. This function infers the data range from the data type (e.g., 255 if data in np.uint8), producing weird results in some cases.
How: If data_range is not provided raise a ValueError.
Please ensure your PR meets the following requirements:
[x] Code builds and passes tests locally, including doctests
[x] New tests have been added (for bug fixes/features)
[x] Pre-commit passes
[ ] PR to the documentation exists (for bug fixes / features)
Description
data_range
as input topsnr()
function.psnr()
function is based onpeak_signal_noise_ratio
function fromskimage
. This function infers the data range from the data type (e.g., 255 if data innp.uint8
), producing weird results in some cases.data_range
is not provided raise aValueError
.Please ensure your PR meets the following requirements: