hashstats#

dataeval.metrics.stats.hashstats(images: Iterable[ArrayLike], bboxes: Iterable[ArrayLike] | None = None) HashStatsOutput#

Calculates hashes for each image

This function computes hashes from the images including exact hashes and perception-based hashes. These hash values can be used to determine if images are exact or near matches.

Parameters:
  • images (ArrayLike) – Images to hashing

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

Returns:

A dictionary-like object containing the computed hashes for each image.

Return type:

HashStatsOutput

See also

Duplicates

Examples

Calculating the statistics on the images, whose shape is (C, H, W)

>>> results = hashstats(images)
>>> print(results.xxhash)
['a72434443d6e7336', 'efc12c2f14581d79', '4a1e03483a27d674', '3a3ecedbcf814226']
>>> print(results.pchash)
['8f25506af46a7c6a', '8000808000008080', '8e71f18e0ef18e0e', 'a956d6a956d6a928']