pyflink.multimodal.expression.ImageExpressionAccessor#
- class ImageExpressionAccessor(expression)[source]#
Image operations available on a DataFrame expression.
These methods use the expression on the left side as the image input. For example,
col("img").image.resize(width=224, height=224)is the expression-accessor form ofimage_resize(col("img"), width=224, height=224).- Examples::
>>> from pyflink.dataframe import col >>> df = df.with_column( ... "small", col("img").image.resize(width=224, height=224)) >>> df = df.with_column( ... "jpeg", col("small").image.encode(format="JPEG"))
Methods
adjust_color(*[, brightness, contrast, ...])Adjust image brightness, contrast, and saturation.
aesthetic_score(*[, hf_scorer_model, ...])Score images for aesthetic quality.
aspect_ratio(*[, concurrency])Compute image aspect ratio.
blur(*[, radius, blur_type, concurrency])Blur image values.
compress(*[, quality, format, concurrency])Compress image values using the requested format and quality.
convert_format(*, format[, concurrency])Convert image values to a different encoded image format.
convert_mode(*, mode[, concurrency])Convert image values to another image mode.
crop(*[, crop_coords, crop_type, ...])Crop image values by coordinates, crop type, ratio, or size.
crop_black_border(*[, threshold, ...])Remove black borders from image values.
decode(*[, on_error, mode, pixel_limit, ...])Decode image bytes into image values.
detect_objects(*[, model, confidence, ...])Detect objects in image values.
detect_subplot(*[, threshold, concurrency])Detect subplot regions in image values.
embedding(*[, model, pretrained, ...])Compute image embeddings.
encode(*[, format, quality, output, concurrency])Encode image values into bytes or data URLs.
face_blur(*[, cv_classifier, blur_type, ...])Blur detected faces in image values.
face_count(*[, cv_classifier, ...])Count faces in image values.
face_detect(*[, cv_classifier, ...])Detect faces in image values.
file_size_filter(*[, min_bytes, max_bytes, ...])Filter image files by byte size.
flip(*[, mode, concurrency])Flip image values horizontally or vertically.
hash(*[, method, concurrency])Compute an image perceptual hash.
is_valid(*[, mode, pixel_limit, concurrency])Check whether image inputs can be decoded as valid images.
metadata(*[, concurrency])Extract image metadata.
nsfw_score(*[, hf_nsfw_model, ...])Score images for NSFW content.
ocr(*[, lang, model_sharing, concurrency, ...])Run OCR on image values.
quality_score(*[, concurrency])Score general image quality.
remove_background(*[, alpha_matting, ...])Remove image backgrounds and optionally composite a new background.
rescale(*, scale[, method, concurrency])Scale image values by a ratio.
resize(*, width, height[, method, concurrency])Resize image values to a fixed width and height.
segment(*[, model, confidence, imgsz, iou, ...])Segment objects or regions in image values.
shape_filter(*[, min_ratio, max_ratio, ...])Filter images by aspect ratio.
sharpness(*[, max_edge, allow_upscale, ...])Estimate image sharpness.
size_filter(*[, min_w, min_h, max_w, max_h, ...])Filter images by width and height bounds.
text_similarity(*[, text_column, text, ...])Compute similarity between image values and text.
to_tensor(*, width, height[, mode, layout, ...])Convert already prepared image values to fixed-shape tensors.
watermark_score(*[, hf_watermark_model, ...])Score images for watermark likelihood.