photosynthesis-team / piq

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

ValueError instead of AssertionError for DSS, GMSD, Haarpsi, MS-SSIM, Perceptual, SRSIM, SSIM, VIF #304

Closed denproc closed 2 years ago

denproc commented 2 years ago

DSS, GMSD, Haarpsi, MS-SSIM, Perceptual, SRSIM, SSIM, VIF metrics and loss function classes use ValueError exception instead of AssertionError.

Expected behavior Check size of the images or features with assert.

Additional context In context of previous discussion to allow user to turn off validation with python -O command to boost processing time.

denproc commented 2 years ago

After discussion with @snk4tr and @zakajd, we decided to keep ValueError exceptions for cases, when a metric computation leads to error (Exception or Invalid values).

For further reference, one should use python -O command to enable processing of tensors, which are outside of standard metric scope.

Previous discussion in #305:

image