公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。如果您在 2025 年 9 月 26 日之前未完成验证,您的访问权限可能会被暂停。
ee.Model.fromAiPlatformPredictor
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据 AI Platform 预测模型的说明返回 ee.Model。(请参阅 https://cloud.google.com/ml-engine/)。
| 用法 | 返回 |
|---|
ee.Model.fromAiPlatformPredictor(projectName, projectId, modelName, version, region, inputProperties, inputTypeOverride, inputShapes, proj, fixInputProj, inputTileSize, inputOverlapSize, outputTileSize, outputBands, outputProperties, outputMultiplier) | 型号 |
| 参数 | 类型 | 详细信息 |
|---|
projectName | 对象,默认值:null | 模型所属的 Google Cloud 项目。已弃用:请改用“projectId”。 |
projectId | 字符串,默认值:null | 模型所属的 Google Cloud 项目的 ID。 |
modelName | 字符串,默认值:null | 模型的名称。 |
version | 字符串,默认值:null | 模型版本。默认为 AI Platform 默认模型版本。 |
region | 字符串,默认值:null | 模型部署区域。默认值为“us-central1”。 |
inputProperties | 列表,默认值:null | 随每个预测实例传递的属性。图片预测结果采用平铺布局,因此这些属性将复制到每个图片平铺实例中。默认值为无属性。 |
inputTypeOverride | 字典,默认值:null | 如果指定,模型输入将被强制转换为这些类型。图片波段和图片/特征属性均有效。 |
inputShapes | 字典,默认值:null | 输入数组波段的固定形状。对于未指定的每个数组频段,系统会根据非屏蔽像素自动推断出固定数组形状。 |
proj | 投影,默认值:null | 用于对所有波段进行采样的输入投影。默认为图像第一个波段的默认投影。 |
fixInputProj | 布尔值,默认值:null | 如果为 true,则将以“proj”指定的固定投影对像素进行采样。否则,使用输出投影。默认值为 false。 |
inputTileSize | 列表,默认值:null | 传递给预测实例的像素块的矩形尺寸。对于图片预测是必需的。 |
inputOverlapSize | 列表,默认值:null | 传递到预测实例中的像素块沿每条边的 X/Y 相邻块重叠量。默认值为 [0, 0]。 |
outputTileSize | 列表,默认值:null | 从 AI Platform 返回的像素块的矩形尺寸。默认值为“inputTileSize”中的值。 |
outputBands | 字典,默认值:null | 从输出频段名称到输出频段信息字典的映射。有效的频段信息字段包括“type”和“dimensions”。“type”应为描述输出波段的 ee.PixelType,“dimensions”是可选的整数,表示相应波段中的维度数量,例如,"outputBands: {'p': {'type': ee.PixelType.int8(), 'dimensions': 1}}". 对于图片预测是必需的。 |
outputProperties | 字典,默认值:null | 从输出属性名称到输出属性信息字典的映射。有效的属性信息字段包括“type”和“dimensions”。“type”应为描述输出属性的 ee.PixelType,“dimensions”是一个可选整数,表示相应属性的维度数(如果该属性是数组),例如,"outputBands: {'p': {'type': ee.PixelType.int8(), 'dimensions': 1}}". 对于来自 FeatureCollection 的预测,此参数是必需的。 |
outputMultiplier | 浮点数,默认值:null | 模型输出相对于模型输入的数据量增幅的近似值。如果指定,则必须 >= 1。只有当模型生成的数据多于其消耗的数据时,才需要这样做,例如,一个模型采用 5 个波段,并为每个像素生成 10 个输出。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],["This document describes the `ee.Model.fromAiPlatformPredictor` function, which retrieves an `ee.Model` from an AI Platform prediction model. Key parameters include `projectId`, `modelName`, `version`, and `region` to locate the model. Input and output specifications are defined by `inputProperties`, `inputTypeOverride`, `inputShapes`, `outputBands`, and `outputProperties`. Image predictions require `inputTileSize`, and optional tile overlap can be specified using `inputOverlapSize`. The output tile size can be adjusted using `outputTileSize`, and the `outputMultiplier` can be specified for models that increase data size.\n"]]