nekhtiari/image-similarity-measures
:chart_with_upwards_trend: Implementation of eight evaluation metrics to access the similarity between two images. The eight metrics are as follows: RMSE, PSNR, SSIM, ISSM, FSIM, SRE, SAM, and UIQ.
Image Similarity Measures
What it is – A small Python library (and accompanying CLI) that computes how alike two images are. It implements eight classic similarity/quality metrics such as RMSE, PSNR, SSIM, FSIM, and a few others that are common in remote‑sensing and computer‑vision research.
Why it matters – When you train or test an image‑processing model (e.g., super‑resolution, denoising, or satellite‑image reconstruction) you need a quantitative way to say whether the output looks like the ground‑truth. This package gives you those numbers in a ready‑to‑use form, both from Python code and from the command line.
How to get it – Install with pip (Python ≥ 3.10):
pip install image-similarity-measures
Optional speed‑up for the FSIM metric (pyfftw) or TIFF handling (rasterio) can be added via extras:
pip install image-similarity-measures[speedups]
pip install image-similarity-measures[rasterio]
Command‑line usage – Compare two files and output a JSON object with the selected metrics:
image-similarity-measures \
--org_img_path=a.tif \
--pred_img_path=b.tif \
--metric=rmse --metric=psnr # repeat --metric for more, or use "all"
The tool expects channel‑last arrays (height × width × channels).
Python usage – Call the high‑level evaluation helper or any metric directly:
from image_similarity_measures.evaluate import evaluation
results = evaluation(
org_img_path="example/lafayette_org.tif",
pred_img_path="example/lafayette_pred.tif",
metrics=["rmse", "psnr"]
)
# Or a single metric
from image_similarity_measures.quality_metrics import rmse
score = rmse(org_img, pred_img)
Extensibility – The repository invites contributions (see README-dev.md for developer guidelines).
Citation – If you use the code in a publication, cite the authors’ 2020 ISPRS Annals paper on super‑resolution of multispectral satellite images.
All details above are taken directly from the project's README.
Related
- Project
- Project
- Project
- Project