Ctrl+K
Logo image Logo image

Site Navigation

  • API Reference
  • Examples

Site Navigation

  • API Reference
  • Examples

Section Navigation

  • PyFlink DataFrame
    • DataFrame
    • DataFrame Creation
    • Input / Output
    • SQL
    • Data Types
    • User Defined Functions
    • Configuration
    • Catalog
    • GPU Support
    • AI / LLM
    • Multimodal Expressions
  • PyFlink Multimodal
  • PyFlink Table
  • PyFlink DataStream
  • PyFlink Common

pyflink.multimodal.expression.ImageExpressionAccessor.remove_background#

ImageExpressionAccessor.remove_background(*, alpha_matting: bool = False, alpha_matting_foreground_threshold: int = 240, alpha_matting_background_threshold: int = 10, alpha_matting_erode_size: int = 10, bgcolor: Optional[Union[List[int], Tuple[int, int, int, int]]] = None, model_sharing: Optional[Literal['process', 'shared']] = None, concurrency: Optional[int] = None, batch_size: Optional[int] = None, num_gpus: Optional[float] = None, gpu_type: Optional[str] = None) → pyflink.table.expression.Expression[source]#

Remove image backgrounds and optionally composite a new background.

Equivalent to image_remove_background(). See that function for full parameter details.

Parameters
  • alpha_matting – Whether to refine the foreground mask with alpha matting.

  • alpha_matting_foreground_threshold – Foreground threshold for alpha matting.

  • alpha_matting_background_threshold – Background threshold for alpha matting.

  • alpha_matting_erode_size – Erosion size for alpha matting.

  • bgcolor – Optional replacement background color.

  • model_sharing – Optional model sharing mode.

  • concurrency – Optional execution concurrency for this operation. None uses the framework default.

  • batch_size – Optional inference batch size.

  • num_gpus – Optional number of GPUs requested for model inference.

  • gpu_type – GPU type requested for model inference. The DataFrame UDF runtime requires this when num_gpus is set.

Returns

A DataFrame expression that produces foreground IMAGE values, optionally composited with the requested background.

previous

pyflink.multimodal.expression.ImageExpressionAccessor.adjust_color

next

pyflink.multimodal.expression.ImageExpressionAccessor.metadata

Show Source

Created using Sphinx 4.5.0.