Model.Builder

公開靜態類別 Model.Builder

此類別已淘汰
請使用 Model.createModel(Context, String, Options)

Model 的建構工具。

公用建構函式

Builder(背景資訊、String modelPath)
建立建構工具,使用記憶體對應檔案從素材資源資料夾載入 tflite 模型。

公用方法

模型
build()
Model.Builder
setDevice(Model.Device 裝置)
設定執行中的裝置。
Model.Builder
setNumThreads(int numThreads)
設定執行緒數量。

繼承的方法

公用建構函式

public Builder (內容背景資訊、String modelPath)

建立建構工具,使用記憶體對應檔案從素材資源資料夾載入 tflite 模型。

參數
context 存取資產的應用程式情境。
modelPath 模型的資產路徑 (.tflite 檔案)。
擲回
IOException

公用方法

public 模型 build ()

public Model.Builder setDevice (Model.Device 裝置)

設定執行中的裝置。根據預設,TFLite 將在 CPU 上執行。

參數
裝置

public Model.Builder setNumThreads (int numThreads)

設定執行緒數量。預設值為 1。

參數
numThreads