راهنمای مهاجرت
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
در 3 ژوئن 2020، تغییراتی را در ML Kit for Firebase ایجاد کردیم تا APIهای روی دستگاه را بهتر از APIهای مبتنی بر ابر متمایز کنیم. مجموعه فعلی APIها اکنون به دو محصول زیر تقسیم شده است:
این تغییر همچنین ادغام ML Kit را در برنامه شما آسان تر می کند اگر فقط به یک راه حل روی دستگاه نیاز دارید. این سند نحوه انتقال برنامه خود را از Firebase ML Kit SDK به جدید ML Kit SDK توضیح می دهد.
چه چیزی در حال تغییر است؟
APIهای مبتنی بر دستگاه
APIهای زیر به کیت SDK مستقل ML منتقل شدهاند.
- اسکن بارکد
- شناسایی چهره
- برچسب گذاری تصویر
- تشخیص و ردیابی اشیاء
- تشخیص متن
- شناسه زبان
- پاسخ هوشمند
- ترجمه کردن
- API استنتاج AutoML Vision Edge
APIهای پایه روی دستگاه موجود در کیت ML برای Firebase SDK منسوخ شدهاند و دیگر بهروزرسانی دریافت نخواهند کرد.
اگر امروز از این APIها در برنامه خود استفاده می کنید، لطفاً با دنبال کردن راهنمای انتقال ML Kit برای Android و راهنمای انتقال ML Kit برای iOS ، به ML Kit SDK جدید مهاجرت کنید.
APIهای مدل سفارشی
برای دانلود مدلهای میزبانی شده در Firebase، دانلودکننده مدل سفارشی همچنان از طریق Firebase ML SDK ارائه میشود. SDK آخرین مدل موجود را واکشی می کند و آن را برای استنباط به زمان اجرا جداگانه TensorFlow Lite می دهد.
مفسر مدل سفارشی موجود در کیت ML برای Firebase SDK منسوخ شده است و دیگر بهروزرسانیها را دریافت نخواهد کرد. توصیه می کنیم از زمان اجرا TensorFlow Lite به طور مستقیم برای استنتاج استفاده کنید. از طرف دیگر، اگر فقط میخواهید از مدلهای سفارشی برای برچسبگذاری تصویر و شناسایی و ردیابی اشیا API استفاده کنید، اکنون میتوانید از مدلهای سفارشی در این APIها در ML Kit استفاده کنید.
برای دستورالعمل های دقیق به راهنمای مهاجرت برای Android و iOS مراجعه کنید.
چه چیزی تغییر نکرده است؟
APIها و خدمات مبتنی بر ابر همچنان با Firebase ML ارائه خواهند شد:
سوالات متداول
چرا این تغییر؟
ما این تغییر را انجام می دهیم تا مشخص کنیم محصول چه راه حل هایی ارائه می دهد. با این تغییر، کیت SDK جدید ML کاملاً بر یادگیری ماشین روی دستگاه متمرکز شده است که در آن تمام پردازش داده ها در دستگاه انجام می شود و بدون هیچ هزینه ای در دسترس توسعه دهندگان است. سرویسهای ابری که قبلاً بخشی از Firebase ML Kit بودند از طریق Firebase ML در دسترس باقی میمانند و همچنان میتوانید از آنها به موازات APIهای ML Kit استفاده کنید.
برای APIهای روی دستگاه، ML Kit SDK جدید، ادغام کیت ML را در برنامه خود برای توسعه دهندگان آسانتر میکند. در ادامه، فقط باید وابستگی هایی را به پروژه برنامه اضافه کنید و سپس شروع به استفاده از API کنید. فقط برای استفاده از APIهای روی دستگاه نیازی به راه اندازی پروژه Firebase نیست.
چه اتفاقی برای مدلهای من میافتد که با Firebase میزبانی میشوند؟
Firebase Machine Learning به خدمات مدل های شما مانند قبل ادامه خواهد داد. این عملکرد تغییر نمی کند. در اینجا چند بهبود وجود دارد:
اکنون می توانید مدل های خود را با استفاده از Python یا Node SDK به صورت برنامه نویسی در Firebase مستقر کنید.
اکنون میتوانید از Firebase ML SDK در ارتباط با زمان اجرا TensorFlow Lite استفاده کنید. Firebase SDK مدل را در دستگاه دانلود می کند و زمان اجرا TensorFlow Lite نتیجه گیری را انجام می دهد. این به شما امکان می دهد به راحتی نسخه زمان اجرا مورد نظر خود را انتخاب کنید، از جمله ساخت سفارشی.
از مهاجرت به کیت SDK جدید ML چه مزایایی میبرم؟
مهاجرت به SDK جدید تضمین میکند که برنامههای شما از آخرین رفع اشکال و بهبودهای APIهای روی دستگاه بهره میبرند. به عنوان مثال، در اینجا چند تغییر در نسخه اول وجود دارد:
اکنون میتوانید از برچسبگذاری تصویر سفارشی جدید و APIهای تشخیص و ردیابی شی سفارشی استفاده کنید تا به راحتی مدلهای طبقهبندی تصویر سفارشی را در برنامههای خود ادغام کنید و تجربههای تعاملی کاربر را در زمان واقعی ایجاد کنید.
پشتیبانی از Android Jetpack Lifecycle به همه API ها اضافه شده است. اکنون میتوانید از addObserver
برای مدیریت خودکار شروع و حذف APIهای ML Kit با چرخش یا بسته شدن برنامه توسط کاربر / سیستم استفاده کنید. این کار ادغام با CameraX را آسان تر می کند.
فهرست کاملی از آخرین تغییرات را میتوانید در یادداشتهای انتشار ML Kit SDK بیابید.
من امروز از کیت ML برای Firebase استفاده می کنم، چه زمانی باید مهاجرت کنم؟
این بستگی به این دارد که در حال حاضر از کدام ML Kit برای APIهای Firebase در برنامه خود استفاده می کنید.
APIهای پایه روی دستگاه در کیت ML برای Firebase SDK تا آینده قابل پیشبینی به کار خود ادامه خواهند داد. با این حال، با به تاخیر انداختن تغییر به کیت SDK جدید ML، از ویژگی ها و به روز رسانی های جدید بهره نخواهید برد. علاوه بر این، هنگامی که سایر مؤلفهها را در برنامه خود بهروزرسانی میکنید، این خطر وجود دارد که با درگیریهای وابستگی مواجه شوید. این می تواند زمانی اتفاق بیفتد که برخی از وابستگی های دیگر شما (مستقیم یا غیرمستقیم) جدیدتر از وابستگی های قدیمی ML Kit برای Firebase SDK باشند. نمونههایی از کتابخانههایی که ممکن است این اتفاق بیفتد OkHttp و firebase-common هستند.
اگر از Cloud API از طریق کیت ML برای Firebase SDK استفاده می کنید، در حال حاضر نیازی به تغییر نیست.
اگر از استقرار مدل سفارشی استفاده میکنید، توصیه میکنیم به آخرین نسخه ارتقا دهید که اجازه میدهد استنتاجها را مستقیماً در زمان اجرا TensorFlow Lite اجرا کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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"]],["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]