dataeval.metrics.stats.dimensionstats#
- dataeval.metrics.stats.dimensionstats(images, bboxes=None)#
Calculates dimension statistics for each image
This function computes various dimensional metrics (e.g., width, height, channels) on the images or individual bounding boxes for each image.
- 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
- Returns:
A dictionary-like object containing the computed dimension statistics for each image or bounding box. The keys correspond to the names of the statistics (e.g., ‘width’, ‘height’), and the values are lists of results for each image or :term:NumPy` arrays when the results are multi-dimensional.
- Return type:
See also
pixelstats,visualstats,OutliersExamples
Calculating the dimension statistics on the images, whose shape is (C, H, W)
>>> results = dimensionstats(stats_images) >>> print(results.aspect_ratio) [1. 1. 1.333 1. 0.6665] >>> print(results.channels) [3 3 1 3 1]