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.
Noneuses 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_gpusis set.
- Returns
A DataFrame expression that produces foreground
IMAGEvalues, optionally composited with the requested background.