Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Modele niestandardowe
plat_iosplat_android
Jeśli jesteś doświadczonym programistą ML, a gotowe modele ML Kit nie
zgodnie z Twoimi potrzebami, możesz użyć
Model TensorFlow Lite z
ML Kit,
Hostuj modele TensorFlow Lite za pomocą Firebase lub spakuj je ze swoją aplikacją.
Następnie użyj pakietu ML Kit SDK, aby wnioskować przy użyciu najlepszej dostępnej
wersji modelu niestandardowego.
Jeśli hostujesz swój model w Firebase, ML Kit automatycznie aktualizuje użytkowników
z najnowszą wersją.
Hostuj modele za pomocą Firebase, aby zmniejszyć rozmiar plików binarnych aplikacji oraz
upewnij się, że aplikacja zawsze używa najnowszej dostępnej wersji
Twój model
Wnioskowanie ML na urządzeniu
Wykonywanie wnioskowania w aplikacji na iOS lub Androida za pomocą pakietu ML Kit SDK w celu uruchomienia niestandardowego modelu TensorFlow Lite. Model można połączyć w pakiet z
aplikacji hostowanej w chmurze,
albo w obu tych miejscach.
Automatyczny model zastępczy
Podaj wiele źródeł modelu; użyj lokalnego modelu, gdy
Model hostowany w chmurze jest niedostępny
Automatyczne aktualizacje modeli
Skonfiguruj warunki automatycznego pobierania aplikacji
nowe wersje Twojego modelu: gdy urządzenie użytkownika jest nieaktywne, się ładuje,
lub urządzenie ma połączenie Wi-Fi.
Ścieżka implementacji
Wytrenuj model TensorFlow
Utworzenie i wytrenowanie modelu niestandardowego za pomocą TensorFlow. Możesz też ponownie wytrenować istniejący model, który rozwiązuje problem podobny do tego, który chcesz rozwiązać.
Zobacz TensorFlow Lite
Przewodnik dla programistów.
Przekonwertuj model na TensorFlow Lite
Przekonwertuj model ze standardowego formatu TensorFlow na TensorFlow Lite za pomocą
zablokowanie wykresu i użycie konwertera optymalizacyjnego TensorFlow,
(TOCO). Zapoznaj się z przewodnikiem dla programistów TensorFlow Lite.
Hostowanie modelu TensorFlow Lite za pomocą Firebase
Opcjonalnie: gdy hostujesz model TensorFlow Lite za pomocą Firebase i
Jeśli umieścisz w aplikacji pakiet ML Kit SDK,
z najnowszą wersją modelu. Możesz skonfigurować ML Kit tak, aby automatycznie pobierał aktualizacje modelu, gdy urządzenie użytkownika jest nieaktywne lub ładowane albo gdy jest połączone z Wi-Fi.
Używanie modelu TensorFlow Lite do wnioskowania
Użyj interfejsów API modeli niestandardowych ML Kit w aplikacji na iOS lub Androida
wnioskowania z wykorzystaniem modelu hostowanego w Firebase lub z pakietu aplikacji.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-25 UTC."],[],[],null,["Custom Models \nplat_ios plat_android \nIf you're an experienced ML developer and ML Kit's pre-built models don't\nmeet your needs, you can use a custom\n[TensorFlow Lite](//www.tensorflow.org/lite/) model with\nML Kit.\n\nHost your TensorFlow Lite models using Firebase or package them with your app.\nThen, use the ML Kit SDK to perform inference using the best-available\nversion of your custom model.\nIf you host your model with Firebase, ML Kit automatically updates your users\nwith the latest version.\n\n[iOS](/docs/ml-kit/ios/use-custom-models)\n[Android](/docs/ml-kit/android/use-custom-models)\n| This is a beta release of ML Kit for Firebase. This API might be changed in backward-incompatible ways and is not subject to any SLA or deprecation policy.\n\nKey capabilities\n\n|-------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| TensorFlow Lite model hosting | Host your models using Firebase to reduce your app's binary size and to make sure your app is always using the most recent version available of your model |\n| On-device ML inference | Perform inference in an iOS or Android app by using the ML Kit SDK to run your custom TensorFlow Lite model. The model can be bundled with the app, hosted in the Cloud, or both. |\n| Automatic model fallback | Specify multiple model sources; use a locally-stored model when the Cloud-hosted model is unavailable |\n| Automatic model updates | Configure the conditions under which your app automatically downloads new versions of your model: when the user's device is idle, is charging, or has a Wi-Fi connection |\n\nImplementation path\n\n|---|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | **Train your TensorFlow model** | Build and train a custom model using TensorFlow. Or, re-train an existing model that solves a problem similar to what you want to achieve. See the TensorFlow Lite [Developer Guide](//www.tensorflow.org/mobile/tflite/devguide). |\n| | **Convert the model to TensorFlow Lite** | Convert your model from standard TensorFlow format to TensorFlow Lite by freezing the graph, and then using the TensorFlow Optimizing Converter (TOCO). See the TensorFlow Lite [Developer Guide](//www.tensorflow.org/mobile/tflite/devguide). |\n| | **Host your TensorFlow Lite model with Firebase** | Optional: When you host your TensorFlow Lite model with Firebase and include the ML Kit SDK in your app, ML Kit keeps your users up to date with the latest version of your model. You can configure ML Kit to automatically download model updates when the user's device is idle or charging, or has a Wi-Fi connection. |\n| | **Use the TensorFlow Lite model for inference** | Use ML Kit's custom model APIs in your iOS or Android app to perform inference with your Firebase-hosted or app-bundled model. |"]]