Skip to main content

A library to perform image quality and classification assessment.

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmetrics-1.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmetrics-1.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mmetrics-1.1.0.tar.gz.

File metadata

  • Download URL: mmetrics-1.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for mmetrics-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5baea9c647d784e227abea861655c82e2ff8a20369c2c6b335e586d134cbfb09
MD5 d17e3269c3ba45702232bffb54057409
BLAKE2b-256 46bd1abd7db6c56f31c3c085bc568d5608d4b1f1a20843dd8cbd99f27154334a

See more details on using hashes here.

File details

Details for the file mmetrics-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: mmetrics-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for mmetrics-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca5845b6864aa95ab15d970a1ca67e25e1b39d75d4ba7d1a499a64530eca3cf4
MD5 84a684fa8f5a5aa52f399138ce42bb85
BLAKE2b-256 a84f993c75a814682c0fcae7842d2fe9ae4bca483bf0943536ab821e825dda9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page