Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
  • PyFlink DataFrame
  • PyFlink Multimodal
    • Image
    • Video
    • Utilities
  • PyFlink DataStream
  • PyFlink Common

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. None uses 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"))

previous

pyflink.multimodal.operators.image_sharpness

next

pyflink.multimodal.operators.is_valid_image

Show Source

Created using Sphinx 4.5.0.