匯出您的模型以用於行動裝置Export your model for use with mobile devices

自訂視覺服務可讓分類器匯出而離線執行。Custom Vision Service allows classifiers to be exported to run offline. 您可以將匯出的分類器內嵌到應用程式中,並裝置的本機執行以進行即時分類。You can embed your exported classifier into an application and run it locally on a device for real-time classification.

匯出選項Export options

自訂視覺服務支援下列匯出:Custom Vision Service supports the following exports:

  • AndroidTensorflowTensorflow for Android.
  • iOS11CoreMLCoreML for iOS11.
  • Windows MLONNXONNX for Windows ML.
  • 願景 AI 開發人員工具組Vision AI Developer Kit.
  • 用於 Windows、Linux 或 ARM 體系結構的__Docker 容器__。A Docker container for Windows, Linux, or ARM architecture. 容器包括使用自訂視覺 API 的 Tensorflow 模型和服務代碼。The container includes a Tensorflow model and service code to use the Custom Vision API.

重要

自訂視覺服務只會匯出__密集__區域。Custom Vision Service only exports compact domains. 密集區域所產生的模型會針對行動裝置的即時分類條件約束進行最佳化。The models generated by compact domains are optimized for the constraints of real-time classification on mobile devices. 以密集區域建置的分類器精確性可能會略低於具有等量訓練資料的標準區域。Classifiers built with a compact domain may be slightly less accurate than a standard domain with the same amount of training data.

如需改善分類器的相關資訊,請參閱改善您的分類器文件。For information on improving your classifiers, see the Improving your classifier document.

轉換為密集區域Convert to a compact domain

注意

僅當現有模型未設置為壓縮域時,本節中的步驟才適用。The steps in this section only apply if you have an existing model that is not set to compact domain.

要轉換現有模型的域,請執行以下步驟:To convert the domain of an existing model, take the following steps:

  1. 自訂視覺網站上,選擇 "主頁"圖示以查看專案清單。On the Custom vision website, select the Home icon to view a list of your projects.

    首頁圖示和專案清單的影像

  2. 選取專案,然後選取頁面右上方的 [齒輪]____ 圖示。Select a project, and then select the Gear icon in the upper right of the page.

    齒輪圖示的影像

  3. "域" 部分中,選擇其中一個__緊湊的__域。In the Domains section, select one of the compact domains. 選取 [儲存變更]____ 以儲存變更。Select Save Changes to save the changes.

    注意

    對於 Vision AI 開發工具組,必須使用__常規(壓縮)__ 域創建專案,並且必須在 "匯出功能" 部分下指定 "視覺 AI 開發工具組"選項。For Vision AI Dev Kit, the project must be created with the General (Compact) domain, and you must specify the Vision AI Dev Kit option under the Export Capabilities section.

    區域選取項目的影像

  4. 在頁面頂端選取 [訓練]____,以使用新的區域進行重新訓練。From the top of the page, select Train to retrain using the new domain.

匯出您的模型Export your model

若要在重新訓練之後匯出模型,請使用下列步驟:To export the model after retraining, use the following steps:

  1. 移至 [效能]**** 索引標籤,並選取 [匯出]____。Go to the Performance tab and select Export.

    匯出圖示的影像

    提示

    如果 [匯出]____ 項目無法使用,則選取的反覆項目不會使用密集區域。If the Export entry is not available, then the selected iteration does not use a compact domain. 請使用此頁面的 [反覆項目]____ 區段選取使用密集區域的反覆項目,然後選取 [匯出]____。Use the Iterations section of this page to select an iteration that uses a compact domain, and then select Export.

  2. 選擇所需的匯出格式,然後選擇 "匯出" 以下載模型。Select your desired export format, and then select Export to download the model.

後續步驟Next steps

通過流覽以下文章或示例之一,將匯出的模型集成到應用程式中:Integrate your exported model into an application by exploring one of the following articles or samples: