dataeval.metrics.stats.datasetstats#

dataeval.metrics.stats.datasetstats(images, bboxes=None, labels=None)#

Calculates various statistics for each image

This function computes dimension, pixel and visual metrics on the images or individual bounding boxes for each image as well as label statistics if provided.

Parameters:
  • images (Iterable[ArrayLike]) – Images to perform calculations on

  • bboxes (Iterable[ArrayLike] or None) – Bounding boxes in xyxy format for each image to perform calculations on

  • labels (Iterable[ArrayLike] or None) – Labels of images or boxes to perform calculations on

Returns:

Output class containing the outputs of various stats functions

Return type:

DatasetStatsOutput

Examples

Calculating the dimension, pixel and visual stats for a dataset with bounding boxes

>>> stats = datasetstats(stats_images, bboxes)
>>> print(stats.dimensionstats.aspect_ratio)
[ 0.864   0.5884 16.      1.143   1.692   0.5835  0.6665  2.555   1.3   ]
>>> print(stats.visualstats.sharpness)
[4.04   4.434  0.2778 4.957  5.145  5.22   4.957  3.076  2.855 ]