Skip to main content

Metrics Library

This library provides utilities for calculating various metrics in image quality assessment and classification.

Features

  • Image Quality Metrics: PSNR, SSIM, MSE, FID, NIQE
  • Classification Metrics: Confusion Matrix, Accuracy, Precision, Recall, F1 Score

Installation

pip install mmetrics

Usage

'''Image Quality Assessment'''
from metrics.image_quality import psnr, ssim, mse, niqe, fid

#Load your images to compare using any tool to have them as numpy arrays
psnr(img1, img2)
ssim(img1, img2)
mse(img1, img2)
niqe(img1)

#Put the path of your images
fid(real_images_path, fake_images_path)

'''Classification Assessment'''
from metrics.classification import confusion_matrix, accuracy, precision, recall, f1_score, jaccard_index

#Load your ground truth (y_true) and your predictions (y_pred) as numpy arrays 
confusion_matrix(y_true, y_pred)
accuracy(y_true, y_pred)
precision(y_true, y_pred)
recall(y_true, y_pred)
f1_score(y_true, y_pred)
jaccard_index(y_true, y_pred)

Metadata

Release files for mmetrics 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mmetrics 1.1.0
File Size Uploaded
mmetrics-1.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mmetrics 1.1.0
File Interpreter ABI Platform
mmetrics-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / mmetrics-1.1.0.tar.gz

Download URL mmetrics-1.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5baea9c647d784e227abea861655c82e2ff8a20369c2c6b335e586d134cbfb09
BLAKE2b-256 checksum
How to use checksums
46bd1abd7db6c56f31c3c085bc568d5608d4b1f1a20843dd8cbd99f27154334a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.1

Release files / mmetrics-1.1.0-py3-none-any.whl

Download URL mmetrics-1.1.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca5845b6864aa95ab15d970a1ca67e25e1b39d75d4ba7d1a499a64530eca3cf4
BLAKE2b-256 checksum
How to use checksums
a84f993c75a814682c0fcae7842d2fe9ae4bca483bf0943536ab821e825dda9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page