photosynthesis-team / piq

Measures and metrics for image2image tasks. PyTorch.
Apache License 2.0
1.32k stars 114 forks source link

data_range when using z-score normalization on input image #344

Closed Michael-H777 closed 1 year ago

Michael-H777 commented 1 year ago

hello dear developers,

I am trying to incorporate several of the losses implemented in piq into my masked autoencoder model for pre-training. I noticed that parameter data_range is often used to revert the input image into 0 -> 255 range. However, with z-score normalization a simple input_image / data_range * 255 will not conver the input_image back to 0 -> 255 range. In this scenario, is it better to set data_range to 1, or is it better to revert the images manually and set data_range to 255?

Best, Michael

zakajd commented 1 year ago

Hi @Michael-H777 I would recommend to revert images manually to [0., 1.] range and pass the data_range=1.0.

Michael-H777 commented 1 year ago

ok, thanks for the clarification.