ee.Model.fromVertexAi

  • The ee.Model.fromVertexAi method creates an Earth Engine Model from a Vertex AI model endpoint description.

  • This method is currently in public preview and subject to change.

  • It requires specifying the Vertex AI endpoint name and supports various optional arguments for configuring input and output properties, types, shapes, projections, tiling, bands, and payload settings.

Returns an ee.Model from a description of a Vertex AI model endpoint. (See https://cloud.google.com/vertex-ai).

UsageReturns
ee.Model.fromVertexAi(endpoint, inputProperties, inputTypeOverride, inputShapes, proj, fixInputProj, inputTileSize, inputOverlapSize, outputTileSize, outputBands, outputProperties, outputMultiplier, maxPayloadBytes, payloadFormat)Model
ArgumentTypeDetails
endpointStringThe endpoint name for predictions.
inputPropertiesList, default: nullProperties passed with each prediction instance. Image predictions are tiled, so these properties will be replicated into each image tile instance. Defaults to no properties.
inputTypeOverrideDictionary, default: nullTypes to which model inputs will be coerced if specified. Both Image bands and Image/Feature properties are valid.
inputShapesDictionary, default: nullThe fixed shape of input array bands. For each array band not specified, the fixed array shape will be automatically deduced from a non-masked pixel.
projProjection, default: nullThe input projection at which to sample all bands. Defaults to the default projection of an image's first band.
fixInputProjBoolean, default: nullIf true, pixels will be sampled in a fixed projection specified by 'proj'. The output projection is used otherwise. Defaults to false.
inputTileSizeList, default: nullRectangular dimensions of pixel tiles passed in to prediction instances. Required for image predictions.
inputOverlapSizeList, default: nullAmount of adjacent-tile overlap in X/Y along each edge of pixel tiles passed in to prediction instances. Defaults to [0, 0].
outputTileSizeList, default: nullRectangular dimensions of pixel tiles returned from AI Platform. Defaults to the value in 'inputTileSize'.
outputBandsDictionary, default: nullA map from output band names to a dictionary of output band info. Valid band info fields are 'type' and 'dimensions'. 'type' should be an ee.PixelType describing the output band, and 'dimensions' is an optional integer with the number of dimensions in that band, e.g., "outputBands: {'p': {'type': ee.PixelType.int8(), 'dimensions': 1}}". Required for image predictions.
outputPropertiesDictionary, default: nullA map from output property names to a dictionary of output property info. Valid property info fields are 'type' and 'dimensions'. 'type' should be an ee.PixelType describing the output property, and 'dimensions' is an optional integer with the number of dimensions for that property if it is an array, e.g., "outputProperties: {'p': {'type': ee.PixelType.int8(), 'dimensions': 1}}". Required for predictions from FeatureCollections.
outputMultiplierFloat, default: nullAn approximation to the increase in data volume for the model outputs over the model inputs. If specified this must be >= 1. This is only needed if the model produces more data than it consumes, e.g., a model that takes 5 bands and produces 10 outputs per pixel.
maxPayloadBytesLong, default: nullThe prediction payload size limit in bytes. Defaults to 1.5MB (1500000 bytes.)
payloadFormatString, default: nullThe payload format of entries in prediction requests and responses. One of: ['SERIALIZED_TF_TENSORS', 'RAW_JSON', 'ND_ARRAYS', 'GRPC_TF_TENSORS', 'GRPC_SERIALIZED_TF_TENSORS', 'GRPC_TF_EXAMPLES']. Defaults to 'SERIALIZED_TF_TENSORS'.