公告:凡是在
2025 年 4 月 15 日前註冊使用 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 | 字串,預設值為空值 | 擁有模型的 Google Cloud 專案 ID。 |
modelName | 字串,預設值為空值 | 模型的名稱。 |
version | 字串,預設值為空值 | 模型版本。預設為 AI Platform 預設模型版本。 |
region | 字串,預設值為空值 | 模型部署區域。預設值為「us-central1」。 |
inputProperties | 清單,預設值為空值 | 每個預測執行個體傳遞的屬性。圖片預測結果會以圖塊方式顯示,因此這些屬性會複製到每個圖片圖塊執行個體。預設為沒有任何屬性。 |
inputTypeOverride | 字典,預設值:null | 如果指定,模型輸入內容會強制轉換為這些類型。圖片帶和圖片/特徵屬性都有效。 |
inputShapes | 字典,預設值:null | 輸入陣列頻帶的固定形狀。如果未指定任何陣列頻帶,系統會從非遮罩像素自動推斷固定陣列形狀。 |
proj | 投影,預設值:null | 要取樣所有波段的輸入投影。預設為圖片第一個波段的預設投影。 |
fixInputProj | 布林值,預設值為空值 | 如為 true,系統會根據「proj」指定的固定投影方式取樣像素。否則會使用輸出投影。預設值為 false。 |
inputTileSize | 清單,預設值為空值 | 傳遞至預測例項的像素圖塊矩形尺寸。圖片預測功能需要這項資訊。 |
inputOverlapSize | 清單,預設值為空值 | 傳遞至預測執行個體的像素圖塊,在 X/Y 軸上每個邊緣的相鄰圖塊重疊量。預設值為 [0, 0]。 |
outputTileSize | 清單,預設值為空值 | 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 | 浮點值,預設值為空值 | 模型輸出資料量相較於模型輸入資料量的增加幅度近似值。如要指定,值必須 >= 1。只有在模型產生的資料量大於消耗的資料量時,才需要這麼做,例如模型會取得 5 個頻帶,並為每個像素產生 10 個輸出內容。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間: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"]]