DecodingRaphael / unraphael

Python toolkit for unraveling image similarity with a focus on artistic practice
https://unraphael.readthedocs.io
Apache License 2.0
2 stars 1 forks source link

Fix bugs in normalization page #57

Open stefsmeets opened 3 months ago

stefsmeets commented 3 months ago

Width

Docs/layout

Additional features

Metrics

68 lays the groundwork for getting images back to the dashboard and displaying them. There is some work to select the right metrics and do better formatting.

Bugs

Performance

stefsmeets commented 3 months ago

Hi @ThijsVroegh I think I addressed all the things I wanted in this issue, could you have a look at the other metrics to add or remove? Or tell me what you had in mind, then I am also happy to implement it 😅

ThijsVroegh commented 3 months ago

Hi @stefsmeets, great! ;-)

Perhaps for clarity we should only provide the absolute values ​​for the template base image and the value after equalization of the aligned image? For example for sharpness: only the sharpness_template and sharpness_normalized (these values ​​are very close to each other, and give the user the information that the equalization was successful). What do you think?

Yes, I studied the appropriate metrics that we should include for the present purposes. I came up with this list of measures which, taken together, cover different but relevant aspects for similarity assessment. Of course, we can reduce its amount if needed:

• Structural Similarity Metrics: SSIM, MS-SSIM, CW-SSIM, IW-SSIM • Perceptual Similarity Metrics: FSIM, VIF, LPIPS, PieAPP • Gradient-Based Metrics: GMSD, MDSI, DISTS • Saliency-Based Metrics: SR-SIM, VSI

All these measures can be calculated with PyTorch Image Quality (https://pypi.org/project/piq/) except for CW-SSIM which I found to be available in the pyssim package (https://pypi.org/project/pyssim/)

Each category of metrics is valauable when dealing with highly similar images where subtle differences might exist. My idea was that, by using a combination of these metrics, we can obtain a comprehensive evaluation that covers various aspects of structural, perceptual, and detailed similarities or differences between images. Finally, these metrics come in hand in the cluster process as well, so lets think about developing a widget that can be used in several pages

stefsmeets commented 3 months ago

skimage also has a metrics module: https://scikit-image.org/docs/stable/api/skimage.metrics.html This works with numpy arrays, and it seems that piq works on tensors(?)

It also has SSIM and PSNR

I'm also thinking that for some of the metrics we calculate in the equalize functions, we may instead calculate them regardless of whether the step was carried out.

ThijsVroegh commented 3 months ago

@stefsmeets ; I agree on ".... some of the metrics we calculate in the equalize functions, we may instead calculate them regardless of whether the step was carried out." So when not carrying out the equalisation, the values for brightness ,contrast and sharpness are provided for both the base and aligned image along side the slider-output to inform the user about the magnitude of difference in these parameters