移行ガイド
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
2020 年 6 月 3 日に、デバイス上の API とクラウドベースの API を区別しやすくするために、Firebase 向け ML Kit にいくつかの変更を行いました。現在の API セットは、次の 2 つのプロダクトに分割されています。
この変更により、デバイス上のソリューションのみが必要な場合に、ML Kit をアプリに統合しやすくなります。このドキュメントでは、アプリを Firebase ML Kit SDK から新しい ML Kit SDK に移行する方法について説明します。
変更内容
オンデバイス ベース API
次の API が新しいスタンドアロン ML Kit SDK に移動しました。
- バーコード スキャン
- 顔検出
- 画像ラベル付け
- オブジェクトの検出とトラッキング
- テキスト認識
- 言語 ID
- スマート リプライ
- 翻訳する
- AutoML Vision Edge 推論 API
Firebase SDK 用 ML Kit の既存のオンデバイスベース API は非推奨になり、更新されなくなります。
これらの API を現在アプリで使用している場合は、Android 用の ML Kit 移行ガイドと iOS 用の ML Kit 移行ガイドに沿って、新しい ML Kit SDK に移行してください。
カスタムモデル API
Firebase でホストされているモデルをダウンロードする場合、カスタムモデル ダウンローダーは引き続き Firebase ML SDK を介して提供されます。SDK は利用可能な最新のモデルを取得し、推論のために個別の TensorFlow Lite ランタイムに渡します。
Firebase SDK 向け ML Kit の既存のカスタムモデル インタープリタは非推奨であるため、更新を受け取れなくなります。推論には、TensorFlow Lite ランタイムを直接使用することをおすすめします。また、画像のラベル付け、オブジェクト検出、トラッキング API にのみカスタムモデルを使用する場合は、ML Kit のこれらの API のカスタムモデルを直接使用できるようになりました。
詳しい手順については、Android と iOS の移行ガイドをご覧ください。
変更されない点
クラウドベースの API とサービスは、Firebase ML で引き続き提供されます。
よくある質問
変更の理由
この変更は、Google Cloud が提供するソリューションを明確にすることを目的としています。この変更により、新しい ML Kit SDK は、すべてのデータ処理がデバイス上で行われ、デベロッパーは無料で利用するオンデバイスの機械学習に完全に重点を置いています。以前は Firebase ML Kit に含まれていたクラウド サービスは Firebase ML で引き続き使用でき、ML Kit API と併用できます。
オンデバイス API の場合、新しい ML Kit SDK を使用すると、デベロッパーは ML Kit をアプリに簡単に統合できます。今後は、アプリのプロジェクトに依存関係を追加して、API の使用を開始するだけで済みます。デバイス上の API を使用するためだけに Firebase プロジェクトを設定する必要はありません。
Firebase でホストされているモデルはどうなりますか?
Firebase Machine Learning は、以前と同様に引き続きモデルを提供します。この機能は変わりません。改善点は次のとおりです。
Python または Node SDK を使用して、モデルを Firebase にプログラムでデプロイできるようになりました。
Firebase ML SDK を TensorFlow Lite ランタイムと組み合わせて使用できるようになりました。Firebase SDK がモデルをデバイスにダウンロードし、TensorFlow Lite ランタイムが推論を実行します。これにより、カスタムビルドを含め、ランタイム バージョンを簡単に選択できます。
新しい ML Kit SDK に移行すると、どのようなメリットがありますか?
新しい SDK に移行することで、最新のバグ修正やオンデバイス API の改善をアプリで確実に利用できるようになります。たとえば、最初のリリースでは次のようないくつかの変更が加えられています。
新しいカスタム画像ラベル付け API とカスタム オブジェクト検出およびトラッキング API を使用して、カスタム画像分類モデルをアプリに簡単に統合し、リアルタイムのインタラクティブなユーザー エクスペリエンスを構築できるようになりました。
すべての API に Android Jetpack ライフサイクルのサポートが追加されました。addObserver
を使用して、ユーザー / システムによってアプリが画面の回転や終了を行う際に ML Kit API の開始と破棄を自動的に管理できるようになりました。これにより、CameraX との統合が容易になります。
最新の変更の完全なリストについては、ML Kit SDK のリリースノートをご覧ください。
現在 Firebase 向け ML Kit を使用しています。移行する必要があるのはいつですか?
これは、アプリで現在使用している Firebase 向け ML Kit の API によって異なります。
Firebase SDK 向け ML Kit のデバイス上のベース API は、当面は引き続きご利用いただけます。ただし、新しい ML Kit SDK への切り替えを遅らせると、新機能とアップデートのメリットを享受できなくなります。また、アプリの他のコンポーネントを更新すると、依存関係の競合が発生する可能性があります。これは、他の依存関係(直接または間接)の一部が、古い Firebase SDK 用の ML Kit で想定されるものよりも新しい場合に発生することがあります。たとえば、OkHttp や firebase-common などのライブラリが使用される可能性があります。
Firebase SDK を介して Cloud APIs を使用している場合は、現時点では変更する必要はありません。
カスタムモデルのデプロイを使用している場合は、TensorFlow Lite ランタイムで直接推論を実行できる最新バージョンにアップグレードすることをおすすめします。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eML Kit is now split into two products: ML Kit (on-device APIs) and Firebase Machine Learning (cloud-based APIs and custom model deployment).\u003c/p\u003e\n"],["\u003cp\u003eOn-device APIs like barcode scanning and text recognition have moved to the standalone ML Kit SDK; existing on-device APIs in Firebase ML Kit are deprecated.\u003c/p\u003e\n"],["\u003cp\u003eCloud-based APIs, such as image labeling and text recognition, remain available through Firebase ML.\u003c/p\u003e\n"],["\u003cp\u003eMigrating to the new ML Kit SDK ensures access to the latest features, bug fixes, and improvements, including custom models and lifecycle support.\u003c/p\u003e\n"],["\u003cp\u003eWhile on-device APIs in Firebase ML Kit will continue to function, developers are encouraged to migrate to the new ML Kit SDK to benefit from ongoing updates and avoid potential dependency conflicts.\u003c/p\u003e\n"]]],[],null,["# Migration guide\n\nOn June 3, 2020, we made some changes to ML Kit for Firebase to better distinguish the\non-device APIs from cloud based APIs. The current set of APIs is now split into\nthe following two products:\n\n- A new product, simply called [**ML Kit**](/ml-kit/guides), which will contain all the on-device APIs\n\n- [**Firebase Machine Learning**](https://firebase.google.com/docs/ml), focused on cloud-based APIs and custom model\n deployment.\n\nThis change will also make it easier to integrate ML Kit into your app if you only\nneed an on-device solution. This document explains how to migrate your app from the\nFirebase ML Kit SDK to the new ML Kit SDK.\n\nWhat's changing?\n----------------\n\n### On-device base APIs\n\nThe following APIs have moved to the new standalone ML Kit SDK.\n\n- Barcode scanning\n- Face detection\n- Image labeling\n- Object detection and tracking\n- Text recognition\n- Language ID\n- Smart reply\n- Translate\n- AutoML Vision Edge inference API\n\nThe existing on-device base APIs in the ML Kit for Firebase SDK are\ndeprecated and will no longer receive updates.\n\nIf you are using these APIs in\nyour app today, please migrate to the new ML Kit SDK, by following the\n**[ML Kit migration guide for Android](/ml-kit/migration/android)** and the\n**[ML Kit migration guide for iOS](/ml-kit/migration/ios)**.\n\n### Custom model APIs\n\nFor downloading models hosted in Firebase, the custom model downloader continues\nto be offered through the Firebase ML SDK. The SDK fetches the latest available\nmodel and passes it to the separate TensorFlow Lite runtime for inference.\n\nThe existing custom model interpreter in the ML Kit for Firebase SDK is deprecated\nand will no longer receive updates. We recommend using the TensorFlow Lite runtime\ndirectly for inference. Alternatively, if you only want to use custom models for\nimage labeling and object detection and tracking APIs, you can now use\n[custom models](/ml-kit/custom-models) in these APIs in ML Kit directly.\n\nSee the migration guides for\n[Android](https://firebase.google.com/docs/ml/android/migrate-from-legacy-api/)\nand [iOS](https://firebase.google.com/docs/ml/ios/migrate-from-legacy-api/)\nfor detailed instructions.\n\nWhat hasn't changed?\n--------------------\n\nCloud-based APIs and services will continue to be offered with Firebase ML:\n\n- The cloud-based image labeling, text recognition, and landmark recognition APIs\n are still available from the Firebase ML SDK.\n\n- Firebase ML also continues to offer [Model deployment](https://firebase.google.com/docs/ml/use-custom-models)\n\nFrequently asked questions\n--------------------------\n\n### Why this change?\n\nWe are making this change to clarify what solutions the product is offering.\nWith this change, the new ML Kit SDK is fully focused on on-device machine\nlearning where all data processing happens on-device and is available to\ndevelopers at no cost. The cloud services that were part of Firebase ML Kit\nbefore remain available through Firebase ML and you can still use these in\nparallel with ML Kit APIs.\n\nFor on-device APIs, the new ML Kit SDK makes it easier for developers to\nintegrate ML Kit into their app. Going forward, you just need to add\ndependencies to the app's project and then start using the API. There is no need\nto set up a Firebase project just to use on-device APIs.\n\n### What happens to my models that are being hosted with Firebase?\n\nFirebase Machine Learning will continue to serve your models as before. That\nfunctionality isn't changing. Here are a couple of improvements:\n\n- You can now deploy your models to Firebase programmatically using the\n [Python or Node SDKs](https://firebase.google.com/docs/ml/manage-hosted-models#manage_models_with_the_firebase_admin_sdk).\n\n- You can now use the Firebase ML SDK in conjunction with the TensorFlow\n Lite runtime. The Firebase SDK downloads the model to the device, and the TensorFlow\n Lite runtime performs the inference. This allows you to easily choose the\n runtime version you prefer, including a custom build.\n\n### What benefits do I get from migrating to the new ML Kit SDK?\n\nMigrating to the new SDK will ensure your applications benefit from the latest\nbug fixes and improvements to the on-device APIs. For example, here are a\ncouple of changes in the first release:\n\n- You can now use the new\n [custom image labeling](/ml-kit/vision/image-labeling#custom-tflite) and\n [custom object detection and tracking](/ml-kit/vision/object-detection#custom-tflite)\n APIs to easily integrate custom image classification models in your apps\n and build real-time interactive user experiences.\n\n- [Android Jetpack Lifecycle](https://developer.android.com/reference/androidx/lifecycle/Lifecycle)\n support is added to all APIs. You can now use `addObserver` to automatically\n manage the initiation and teardown of ML Kit APIs as the app goes through screen\n rotation or closure by the user / system. This makes integration with CameraX\n easier.\n\nA full list of the latest changes can be found in the [ML Kit SDK release\nnotes](/ml-kit/release-notes).\n\n### I am using ML Kit for Firebase today, when do I need to migrate over?\n\nThis depends on which ML Kit for Firebase APIs you currently use in your app.\n\n- The **on-device base APIs** in the ML Kit for Firebase SDK will continue to work for\n the foreseeable future. However, by delaying the switch to the new ML Kit SDK,\n you will not benefit from new features and updates. In addition, once you update\n other components in your app there is a risk you may\n run into dependencies conflicts. This can happen when some of your other dependencies (direct or indirect) are\n newer than the ones expected by the old ML Kit for Firebase SDK. Examples of\n libraries for which this may happen are OkHttp and firebase-common.\n\n- If you are using **Cloud APIs** via the ML Kit for Firebase SDK, no change is\n required at this time.\n\n- If you are using **Custom Model Deployment**, we recommend you upgrade to the latest\n version which allows running inferences directly on the TensorFlow Lite runtime."]]