偵測及追蹤物件
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
主要功能
- 快速偵測及追蹤物件
偵測物件並在圖片中取得物件的位置。跨連續圖片的影格追蹤物件。
- 最佳化裝置端模型
物件偵測和追蹤模型已針對行動裝置進行最佳化,即使是在低階裝置上也能使用即時應用程式。
- 醒目物件偵測
自動判斷圖片中最醒目的物件。
- 粗略分類
將物件分為廣泛類別,可用來濾除不感興趣的物件。支援的類別如下:居家用品、時尚商品、食物、植物和地點。
- 使用自訂模型分類
使用自訂圖片分類模型識別或篩選特定物件類別。排除圖片的背景,自訂模型成效更佳
搜尋結果範例
追蹤不同圖片中最顯眼的物件
以下範例顯示三個連續影格的追蹤資料,且使用 ML Kit 提供的預設粗略分類分類器。
 |
追蹤 ID |
0 |
範圍 |
(95、45)、(496、45)、(496、240)、(95、240) |
類別 |
位置 |
分類信心 |
0.9296875 |
|
 |
追蹤 ID |
0 |
範圍 |
(84、46)、(478、46)、(478、247)、(84、247) |
類別 |
位置 |
分類信心 |
0.8710938 |
|
 |
追蹤 ID |
0 |
範圍 |
(53、45)、(519、45)、(519、240)、(53、240) |
類別 |
位置 |
分類信心 |
0.8828125 |
|
相片:Christian Ferrer [CC BY-SA 4.0]
靜態圖片中的多個物件
以下範例顯示使用 ML Kit 提供的預設粗略分類器,在圖片中偵測到的四個物件資料。

物件 0 |
範圍 |
(1、97)、(332、97)、(332、332)、(1、332) |
類別 |
FASHION_GOOD |
分類信心 |
0.95703125 |
Object 1 |
範圍 |
(186、80)、(337、80)、(337、226)、(186、226) |
類別 |
FASHION_GOOD |
分類信心 |
0.84375 |
Object 2 |
範圍 |
(296、80)、(472、80)、(472、388)、(296、388) |
類別 |
FASHION_GOOD |
分類信心 |
0.94921875 |
Object 3 |
範圍 |
(439、83)、(615、83)、(615、306)、(439、306) |
類別 |
FASHION_GOOD |
分類信心 |
0.9375 |
使用自訂 TensorFlow Lite 模型
預設粗細分類器是專為五個類別所設計,可提供偵測到的物件相關有限資訊。您可能需要使用更專業的分類器模型,以便更詳細地涵蓋更小的概念領域;例如,用於區分不同花朵或食品類型的模型。
這個 API 支援多種來源的自訂圖片分類模型,可讓您根據特定用途調整圖片內容。詳情請參閱「使用 ML Kit 自訂模型」一文。您可以將自訂模型與您的應用程式組合在一起,或是使用 Firebase 機器學習的模型部署服務從雲端動態下載。
iOS
Android
如有需要,物件偵測和追蹤功能會使用雙線性圖片縮放和延展功能,調整輸入圖片大小和顯示比例,使其符合基礎模型的要求。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-05 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-05 (世界標準時間)。"],[[["ML Kit's on-device API enables detection and tracking of objects within images or live camera feeds, working efficiently even on lower-end mobile devices."],["It offers optional object classification using a built-in coarse classifier or your own custom TensorFlow Lite model for more specialized categorization."],["The API can identify the most prominent object in an image and track it across frames, making it suitable for visual search applications."],["Custom models can be integrated to classify objects into specific categories, enhancing the functionality for tailored use cases."],["Input images are automatically preprocessed to fit model requirements, using bilinear scaling and stretching if necessary."]]],["ML Kit's API enables on-device object detection and tracking in images or live feeds, optionally classifying them. It features fast detection, an optimized model for mobile, and prominent object identification. Objects can be classified into broad categories or with custom models. The API supports custom image classification models, including ones dynamically downloaded. Detected objects are tracked across frames, and the system adjusts input image size and aspect ratio as needed.\n"]]