hashstats#
- dataeval.metrics.stats.hashstats(images: Iterable[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]], bboxes: Iterable[_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]] | 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
DuplicatesExamples
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']