Vane Data / Reference
image_to_tensor
image_to_tensor converts IMAGE pixels into an HWC TENSOR without changing pixel values. Known modes preserve UInt8, UInt16, or Float32; a generic IMAGE uses Float32.
Signature
vane.image_to_tensor(image) -> ExpressionSQL: image_to_tensor(image). Expression method: expr.image_to_tensor().
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| image | IMAGE value or Expression | Input image | Required |
Returns and errors
Returns a TENSOR with shape (height, width, channels). image_to_tensor belongs to the base engine and needs no image backend, regardless of image_backend. NULL returns NULL.
Example
import vane con = vane.connect() con.sql("SELECT image_to_tensor(decode_image_file(image_file('photo.png')))").show()