Closed dfulu closed 2 days ago
The function used to create SSIM is relatively slow compared to other metrics. We currently use the structural_similarity() function from skimage, this results in a nested native python loop over sample, time, and channel. We could likely speed up the calculation of SSIM by rewriting this to avoid nested loops. One implementation might be to lift this: https://github.com/google-deepmind/dm_pix/blob/d60144e7c648e73c9349a5926fbb4cbd20045cea/dm_pix/_src/metrics.py#L139-L256
structural_similarity()
Also the current function does not work with NaNs
I'm going to close this via #52, and open a broader issue about metric speed.
The function used to create SSIM is relatively slow compared to other metrics. We currently use the
structural_similarity()
function from skimage, this results in a nested native python loop over sample, time, and channel. We could likely speed up the calculation of SSIM by rewriting this to avoid nested loops. One implementation might be to lift this: https://github.com/google-deepmind/dm_pix/blob/d60144e7c648e73c9349a5926fbb4cbd20045cea/dm_pix/_src/metrics.py#L139-L256