pyflink.multimodal.operators.image_hash#
- image_hash(*columns, method='phash', concurrency=None)[source]#
Compute a perceptual hash of an image.
- Parameters
*columns – Optional image columns. When provided, the UDF is applied directly (syntactic sugar).
method – Hash algorithm —
"phash"(default),"dhash", or"ahash".concurrency – UDF concurrency.
Noneuses the framework default.
- Returns
A UDF producing
string.
- Example::
>>> # As a reusable variable >>> hasher = image_hash(method="phash") >>> df = df.with_columns("hash", hasher(col("img"))) >>> >>> # Inline >>> df = df.with_columns("hash", image_hash(col("img"), method="phash"))