dataeval.metrics.stats.boxratiostats

dataeval.metrics.stats.boxratiostats(boxstats, imgstats)

Calculates ratio statistics of box outputs over image outputs.

Parameters:
boxstats : DimensionStatsOutput | PixelStatsOutput | VisualStatsOutput

Box statistics outputs to perform calculations on

imgstats : DimensionStatsOutput | PixelStatsOutput | VisualStatsOutput

Image statistics outputs to perform calculations on

Returns:

A dictionary-like object containing the computed ratio of the box statistics divided by the image statistics.

Return type:

DimensionStatsOutput | PixelStatsOutput | VisualStatsOutput

Note

DimensionStatsOutput values for channels, depth and distances are the original values provided by the box outputs

Examples

Calculate the box ratio statistics using the dimension stats of the images and boxes on a dataset containing 15 targets.

>>> from dataeval.metrics.stats import dimensionstats
>>> imagestats = dimensionstats(dataset, per_box=False)
>>> boxstats = dimensionstats(dataset, per_box=True)
>>> ratiostats = boxratiostats(boxstats, imagestats)
>>> print(ratiostats.aspect_ratio)
[ 0.864  0.588 16.     0.857  1.27   0.438  0.667  3.833  1.95   0.833
  1.     0.6    0.522 15.     3.834]
>>> print(ratiostats.size)
[0.026 0.01  0.001 0.018 0.023 0.007 0.009 0.034 0.021 0.007 0.001 0.008
 0.017 0.001 0.008]