dataeval.metrics.stats.imagestats

dataeval.metrics.stats.imagestats(dataset, *, per_box=False, per_channel=False)

Calculates various statistics for each image.

This function computes pixel and visual metrics on the images or individual bounding boxes for each image.

Parameters:
dataset : Dataset

Dataset to perform calculations on.

per_box : bool, default False

If True, perform calculations on each bounding box.

per_channel : bool, default False

If True, perform calculations on each channel.

Returns:

Output class containing the outputs of various stats functions

Return type:

ImageStatsOutput

Examples

Calculate dimension, pixel and visual statistics for a dataset containing 8 images.

>>> stats = imagestats(dataset)
>>> print(stats.mean)
[0.181 0.132 0.248 0.373 0.464 0.613 0.734 0.854]
>>> print(stats.sharpness)
[20.23 20.23 23.33 20.23 77.06 20.23 20.23 20.23]

Calculate the pixel and visual stats for a dataset containing 6 3-channel images and 2 1-channel images for a total of 20 channels.

>>> ch_stats = imagestats(dataset, per_channel=True)
>>> print(ch_stats.brightness)
[0.027 0.152 0.277 0.127 0.135 0.142 0.259 0.377 0.385 0.392 0.508 0.626
 0.634 0.642 0.751 0.759 0.767 0.876 0.884 0.892]