TArdelean / AnomalyLocalizationFCA

Official implementation of High-Fidelity Zero-Shot Texture Anomaly Localization Using Feature Correspondence Analysis.
MIT License
8 stars 2 forks source link

Wasserstein distance #1

Open yuhbai opened 4 months ago

yuhbai commented 4 months ago

how to calculate Wasserstein distance in sc_methods.py?

TArdelean commented 1 month ago

Hi,

The function sc_hist in sc_methods.py computes the Wasserstein distance (EMD) between histograms (called Histogram method in the paper). The class ScSWW in sc_methods.py computes our Sample-weighted Wasserstein distance, which is an intermediate step between the histogram method and our approach; see the paper for more details. Lastly, the class ScFCA implements our full method, which is based on the fast computation of the Wasserstein distance between empirical distributions, but we use the contribution of each element to the distance.

I hope this answer your question!