myungsub / CAIN

Source code for AAAI 2020 paper "Channel Attention Is All You Need for Video Frame Interpolation"
MIT License
327 stars 43 forks source link

PSNR calculation #6

Closed tarun005 closed 4 years ago

tarun005 commented 4 years ago

Hi,

I observed that you clip the values between [0,1] before calculating the PSNR. https://github.com/myungsub/CAIN/blob/09859b22741365a48510c3f531feb50f35761de8/utils.py#L185

But shouldn't you be calculating PSNR on the raw pixel output values, since clipping will score good on lot of outlier pixels? Prior works calculate PSNR on raw pixels. (https://github.com/avinashpaliwal/Super-SloMo/blob/bae5375b7b4c9ae4756424fc27b14cce358fe6b3/train.py#L184 ).

Will both the outputs be same?

myungsub commented 4 years ago

Hi @tarun005 , thanks for your interest in our work. It's a good point you mentioned, and below are my answers.

Clipping will reduce the effects of outlier pixels --> Yes. Will both outputs be the same? --> If there are outlier pixels, no. Otherwise, yes. Should we calculate on raw values? --> I think no (in fact, it doesn't matter that much). We can always just clamp the output values of any models, although my current code doesn't do this, because I don't remember seeing any outlier pixels during my experiments and forgot to add; I think Super-SloMo should be similar.

In summary, this is just for checking whether the pixel values are in the correct range, and it won't affect the performance unless the model suddenly show outlier pixels for extreme case, which I haven't experienced.

tarun005 commented 4 years ago

I actually tested with both forms, and found not much difference. So, I guess it doesn't matter.