Image Wrapper Function

The Read Pixels Function is used to provide indexed access to an embedding over 2 dimensions.

Configuration

A new function of type image.readpixels named <id> can be created as follows:

mldb.put("/v1/functions/"+<id>, {
    "type": "image.readpixels",
    "params": {
        "expression": <string>
    }
})

with the following key-value definitions for params:

Field, Type, DefaultDescription

expression
string

SQL Expression that will evaluate to the embedding we want to provide access to

Example

The following function configuration will provide indexed access over the 2x2 embedding specified.

{
    "id": "expr",
    "type": "image.wrapper",
    "params": {
        "expression": "[[[1],[2]],[[3],[4]]]"
    }
}

The expression expr(0,1) will return the value 2 from the embedding.

See also