Azure 認知服務中的容器支援Container support in Azure Cognitive Services

Azure 認知服務中的容器支援可讓開發人員使用 Azure 中可用的相同豐富 API,並同時享有 Docker 容器 (英文) 所帶來的部署及裝載服務彈性。Container support in Azure Cognitive Services allows developers to use the same rich APIs that are available in Azure, and enables flexibility in where to deploy and host the services that come with Docker containers. 容器支援是目前可供預覽的 Azure 認知服務,包括組件的子集:Container support is currently available in preview for a subset of Azure Cognitive Services, including parts of:

容器化是散發軟體的方法,它會將應用程式或服務 (包括其相依性及設定) 一起封裝成容器映像。Containerization is an approach to software distribution in which an application or service, including its dependencies & configuration, is packaged together as a container image. 在只需要小幅修改或不修改的情況下,便可將容器映像部署在容器主機上。With little or no modification, a container image can be deployed on a container host. 容器之間會彼此隔離,也會與基礎作業系統隔離,這使其磁碟使用量比虛擬機器更小。Containers are isolated from each other and the underlying operating system, with a smaller footprint than a virtual machine. 容器可以從容器映像具現化以進行短期工作,並於不再需要時移除。Containers can be instantiated from container images for short-term tasks, and removed when no longer needed.

以下影片將示範如何使用認知服務容器。The following video demonstrates using a Cognitive Services container.

認知服務的容器示範Container demonstration for Cognitive Services

認知服務資源位於Microsoft AzureCognitive Services resources are available on Microsoft Azure. 請登入 Azure 入口網站以建立並探索適用於這些服務的 Azure 資源。Sign into the Azure portal to create and explore Azure resources for these services.

功能與優點Features and benefits

  • 對資料的控制:讓客戶選擇這些認知服務在哪裡處理他們的資料。Control over data: Allow customers to choose where these Cognitive Services process their data. 這對於無法將資料傳送到雲端,但需要存取認知服務技術的客戶來說,這是不可或缺的。This is essential for customers that cannot send data to the cloud but need access to Cognitive Services technology. 支援混合式環境中的一致性,橫跨資料、管理、身分識別及安全性。Support consistency in hybrid environments – across data, management, identity, and security.
  • 對模型更新的控制:為客戶針對部署於其解決方案中的模型,提供版本控制和更新上的彈性。Control over model updates: Provide customers flexibility in versioning and updating of models deployed in their solutions.
  • 可攜式架構:能建立可攜式的應用程式架構,並將它部署至 Azure、內部部署及邊緣。Portable architecture: Enable the creation of a portable application architecture that can be deployed on Azure, on-premises and the edge. 您可以將容器直接部署至 Azure Kubernetes ServiceAzure 容器執行個體,或是已部署至 Azure StackKubernetes 叢集。Containers can be deployed directly to Azure Kubernetes Service, Azure Container Instances, or to a Kubernetes cluster deployed to Azure Stack. 如需詳細資訊,請參閱將 Kubernetes 部署至 Azure StackFor more information, see Deploy Kubernetes to Azure Stack.
  • 高輸送量 / 低延遲:透過讓認知服務在實體鄰近客戶應用程式邏輯和資料執行,為客戶提供針對高輸送量及低延遲需求進行調整的能力。High throughput / low latency: Provide customers the ability to scale for high throughput and low latency requirements by enabling Cognitive Services to run physically close to their application logic and data. 容器不會限制每秒交易 (TPS),而且如果您提供必要的硬體資源,會相應增加和相應放大來處理要求。Containers do not cap transactions per second (TPS) and can be made to scale both up and out to handle demand if you provide the necessary hardware resources.

Azure 認知服務中的容器Containers in Azure Cognitive Services

Azure 認知服務容器能提供下列 Docker 容器集合,每個容器都包含 Azure 認知服務中服務之功能的子集:Azure Cognitive Services containers provide the following set of Docker containers, each of which contains a subset of functionality from services in Azure Cognitive Services:

服務Service 支援的定價層Supported Pricing Tier 容器Container 說明Description
異常偵測器Anomaly detector F0, S0F0, S0 Anomaly-DetectorAnomaly-Detector 異常偵測器 API 可讓您監視和偵測時間序列資料使用 machine learning 中的異常。The Anomaly Detector API enables you to monitor and detect abnormalities in your time series data with machine learning.
要求存取Request access
電腦視覺Computer Vision F0, S1F0, S1 辨識文字Recognize Text 從具不同表面和背景之各種物件 (例如收據、海報和名片) 的影像擷取印刷文字。Extracts printed text from images of various objects with different surfaces and backgrounds, such as receipts, posters, and business cards.

重要事項: 辨識文字容器目前只適用於英文。Important: The Recognize Text container currently works only with English.
要求存取Request access
臉部Face F0, S0F0, S0 臉部Face 能偵測影像中的人臉並識別其特性,包括臉部特徵點 (例如鼻子和眼睛)、性別、年齡及其他機器預測的臉部容貌。Detects human faces in images, and identifies attributes, including face landmarks (such as noses and eyes), gender, age, and other machine-predicted facial features. 除了偵測以外,臉部也可以使用信賴分數檢查相同或不同影像中的兩張臉是否相同,或將臉部向資料庫進行比對,看看是否有樣貌相似或相同的臉部。In addition to detection, Face can check if two faces in the same image or different images are the same by using a confidence score, or compare faces against a database to see if a similar-looking or identical face already exists. 它也能夠使用共同視覺特徵,將相似臉部分組。It can also organize similar faces into groups, using shared visual traits.
要求存取Request access
表單的辨識器Form recognizer F0, S0F0, S0 表單的辨識器Form Recognizer 表單的了解適用於機器學習技術來識別和擷取表單中的索引鍵 / 值組和資料表。Form Understanding applies machine learning technology to identify and extract key-value pairs and tables from forms.
要求存取Request access
LUISLUIS F0, S0F0, S0 LUIS (影像)LUIS (image) 將已定型或發佈的 Language Understanding 模型 (也稱為 LUIS 應用程式) 載入 Docker 容器中,並提供從容器的 API 端點存取查詢預測的權限。Loads a trained or published Language Understanding model, also known as a LUIS app, into a docker container and provides access to the query predictions from the container's API endpoints. 您可以從容器收集查詢記錄,並將這些記錄重新上傳至 LUIS 入口網站,以改善應用程式的預測精確度。You can collect query logs from the container and upload these back to the LUIS portal to improve the app's prediction accuracy.
語音服務 APISpeech Service API F0, S0F0, S0 語音轉文字Speech-to-text 連續的即時語音謄寫成文字。Transcribes continuous real-time speech into text.
要求存取Request access
語音服務 APISpeech Service API F0, S0F0, S0 文字轉換語音Text-to-speech 將文字轉換成自然發音語音。Converts text to natural-sounding speech.
要求存取Request access
文字分析Text Analytics 其中 F0、 SF0, S 關鍵片語擷取 (影像)Key Phrase Extraction (image) 擷取關鍵片語來識別重點。Extracts key phrases to identify the main points. 例如,若輸入文字為 "The food was delicious and there were wonderful staff",API 即會傳回主要討論要點:"food" 和 "wonderful staff"。For example, for the input text "The food was delicious and there were wonderful staff", the API returns the main talking points: "food" and "wonderful staff".
文字分析Text Analytics 其中 F0、 SF0, S 語言偵測 (影像)Language Detection (image) 偵測輸入文字是以何種語言撰寫的,並針對要求所提交的每份文件回報單一語言代碼,最多可達 120 種語言。For up to 120 languages, detects which language the input text is written in and report a single language code for every document submitted on the request. 語言代碼各配有一個分數,表示分數的強度。The language code is paired with a score indicating the strength of the score.
文字分析Text Analytics 其中 F0、 SF0, S 情感分析 (影像)Sentiment Analysis (image) 分析原始文字以尋找正面或負面情感的線索。Analyzes raw text for clues about positive or negative sentiment. 此 API 會為每份文件傳回 0 到 1 之間的情感分數,1 代表最正面的情感。This API returns a sentiment score between 0 and 1 for each document, where 1 is the most positive. 分析模型是使用大量文字主體和 Microsoft 的自然語言技術預先定型。The analysis models are pre-trained using an extensive body of text and natural language technologies from Microsoft. 針對選取的語言,API 可對您所提供的任何原始文字進行分析及評分,並直接將結果傳回至呼叫端應用程式。For selected languages, the API can analyze and score any raw text that you provide, directly returning results to the calling application.

此外,認知服務中支援某些容器 -全方位供應項目資源索引鍵。In addition, some containers are supported in Cognitive Services All-In-One offering resource keys. 您可以建立一個單一的認知服務-全方位資源,並跨下列服務支援的服務使用相同的計費金鑰:You can create one single Cognitive Services All-In-One resource and use the same billing key across supported services for the following services:

  • 電腦視覺Computer Vision
  • 臉部Face
  • LUISLUIS
  • 文字分析Text Analytics

Azure 認知服務中的容器可用性Container availability in Azure Cognitive Services

Azure 認知服務容器可透過您的 Azure 訂用帳戶公開取得,而 Docker 容器映像則可以從 Microsoft Container Registry 或 Docker Hub 提取。Azure Cognitive Services containers are publicly available through your Azure subscription, and Docker container images can be pulled from either the Microsoft Container Registry or Docker Hub. 您可以使用 docker pull (英文) 命令來從適當的登錄下載容器映像。You can use the docker pull command to download a container image from the appropriate registry.

重要

目前,您必須完成註冊程序來存取下列容器,讓您填寫並提交問卷,以您、 您的公司和您要實作容器的使用案例相關問題。Currently, you must complete a sign-up process to access the following containers, in which you fill out and submit a questionnaire with questions about you, your company, and the use case for which you want to implement the containers. 在您被授與存取權並取得認證之後,接著便可以從由 Azure Container Registry 所裝載的私人容器登錄,提取適用於臉部和辨識文字容器的容器映像。Once you're granted access and provided credentials, you can then pull the container images for the Face and Recognize Text containers from a private container registry hosted by Azure Container Registry.

必要條件Prerequisites

您必須滿足下列必要條件才能使用 Azure 認知服務容器:You must satisfy the following prerequisites before using Azure Cognitive Services containers:

Docker 引擎:您必須在本機安裝 Docker 引擎。Docker Engine: You must have Docker Engine installed locally. Docker 提供可在 macOS (英文)、Linux (英文) 和 Windows (英文) 上設定 Docker 環境的套件。Docker provides packages that configure the Docker environment on macOS, Linux, and Windows. 在 Windows 上,必須將 Docker 設定為支援 Linux 容器。On Windows, Docker must be configured to support Linux containers. 您也可以將 Docker 容器直接部署至 Azure Kubernetes ServiceAzure 容器執行個體Docker containers can also be deployed directly to Azure Kubernetes Service or Azure Container Instances.

Docker 必須設定為允許容器與 Azure 連線,以及傳送帳單資料至 Azure。Docker must be configured to allow the containers to connect with and send billing data to Azure.

對 Microsoft Container Registry 和 Docker 的熟悉度:您應具備對 Microsoft Container Registry 和 Docker 概念 (例如登錄、存放庫、容器和容器映像等) 的基本了解,以及基本 docker 命令的知識。Familiarity with Microsoft Container Registry and Docker: You should have a basic understanding of both Microsoft Container Registry and Docker concepts, like registries, repositories, containers, and container images, as well as knowledge of basic docker commands.

如需 Docker 和容器基本概念的入門,請參閱 Docker 概觀 (英文)。For a primer on Docker and container basics, see the Docker overview.

個別的容器可能也會有各自的需求,包括伺服器和記憶體配置需求。Individual containers can have their own requirements, as well, including server and memory allocation requirements.

部落格文章Blog posts

開發人員範例Developer samples

開發人員範例可從我們的 GitHub 存放庫取得。Developer samples are available at our GitHub repository.

檢視網路研討會View webinar

加入網路研討會以了解:Join the webinar to learn about:

  • 如何將認知服務部署到任何使用 Docker 的機器How to deploy Cognitive Services to any machine using Docker
  • 如何將認知服務部署到 AKSHow to deploy Cognitive Services to AKS

後續步驟Next steps

安裝並探索由 Azure 認知服務中的容器所提供的功能:Install and explore the functionality provided by containers in Azure Cognitive Services: