Android의 ML Kit 모델 설치 경로
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모든 ML Kit 기능은 기본적으로 Google에서 학습한 머신러닝 모델 (기본 모델이라고 함)을 사용합니다. 이 가이드는 기본 모델에만 적용됩니다. 커스텀 모델에 관한 안내는 여기를 참고하세요.
ML Kit API의 모델은 다음 세 가지 방법 중 하나로 설치할 수 있습니다.
- 번들 해제: 모델이 Google Play 서비스를 통해 다운로드되고 관리됩니다.
- 번들로 묶임: 모델이 빌드 시 앱에 정적으로 연결됩니다.
- 동적으로 다운로드됨: 모델이 요청 시 다운로드됩니다.
각 API의 지원되는 설치 경로
다음 표에는 각 ML Kit 기능에서 지원되는 모델 설치 경로가 나와 있습니다.
API별 가이드에는 지정된 API에 사용할 수 있는 설치 옵션이 표시됩니다.
설치 옵션 간 주요 차이점
|
번들 해제됨
|
번들로 묶인
|
동적으로 다운로드됨
|
모델은 어디에 저장되나요?
|
Google Play 서비스에 있으며 이 앱에서 사용하는 저장용량에 포함되지 않음
|
설치 후 앱별 저장소에 저장
|
모델 다운로드 후 앱별 저장소에 저장
|
모델 크기는 앱 크기에 어떤 영향을 미치나요?
|
앱 크기에 기여하지 않음
|
앱 크기에 직접 기여함
|
앱 크기에 기여하지 않지만 앱별 저장소를 늘립니다.
|
모델은 언제 업데이트되나요?
|
최신 버전이 출시되면 자동으로 업데이트됨
|
모델을 업데이트하려면 앱을 업데이트해야 함
|
모델을 업데이트하려면 앱을 업데이트해야 함
|
모델은 언제 다운로드되나요?
|
모델을 사용하기 전에 다운로드해야 합니다.
|
앱이 설치될 때 모든 모델과 기능이 포함되므로 즉시 사용할 수 있습니다.
|
모델 다운로드, 업데이트, 삭제는 RemoteModelManager API를 사용하여 수동으로 관리해야 합니다.
|
모델이 기기에서 삭제되는 시점은 언제인가요?
|
Google Play 서비스는 모델에 종속된 모든 앱이 제거된 경우에만 스토리지에서 모델을 삭제합니다.
|
앱이 제거되면 앱별 저장소에서 모델이 삭제됩니다.
|
앱이 제거되면 다운로드된 모델이 앱별 저장소에서 삭제됩니다.
|
번들형과 번들형이 아닌 제품 중에서 선택하는 방법
API가 번들 및 번들 해제된 설치 옵션을 모두 지원하는 경우:
모델 다운로드 방법
번들 해제된 모델 옵션을 사용하는 경우 모델을 기기에 다운로드하는 방법을 지정할 수 있습니다.
앱의 AndroidManifest.xml
파일에 선언을 추가하여 설치 시간 모델 다운로드를 사용 설정할 수 있습니다. 예를 들어 아래 코드 스니펫은 Play 스토어에서 앱을 설치한 후 바코드 스캔 모델을 자동으로 다운로드하도록 앱을 구성하는 방법을 보여줍니다.
<application ...>
...
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="barcode" >
<!-- To use multiple models: android:value="barcode,model2,model3" -->
</application>
Google Play 서비스 ModuleInstallClient API를 통해 명시적 다운로드를 요청할 수 있습니다.
설치 시 모델 다운로드를 사용 설정하지 않거나 명시적 다운로드를 요청하지 않으면 기능을 처음 실행할 때 모델이 다운로드됩니다.
다운로드가 완료될 때까지는 추론 요청이 실패합니다.
모델을 업데이트하는 방법
번들 모델 또는 동적으로 다운로드된 모델 옵션을 사용할 때 모델을 업데이트하려면 다음 단계를 따르세요.
최신 ML Kit 기능 클라이언트 라이브러리를 사용하도록 앱의 Gradle 파일을 업데이트합니다.
dependencies {
implementation 'com.google.mlkit:barcode-scanning: 17.3.0' // The latest version number of the API
}
앱을 다시 빌드합니다.
일부 API에서 동적으로 다운로드된 모델을 제공하는 이유
일부 ML Kit API에는 번들로 묶을 모델 옵션이 너무 많습니다. 예를 들어 디지털 잉크 인식은 300개 이상의 언어를 지원하며, 설치 중에 모든 언어를 기능 내에 포함할 필요는 없습니다.
이를 위해 설치 후 모델이 주문형으로 다운로드되는 세 번째 설치 옵션을 제공합니다. 현재 디지털 잉크 인식, 번역, 항목 추출에만 이 옵션이 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[[["\u003cp\u003eML Kit features utilize Google-trained machine learning models, offering three installation options: unbundled, bundled, and dynamically downloaded.\u003c/p\u003e\n"],["\u003cp\u003eUnbundled models are downloaded via Google Play Services, while bundled models are included in the app, and dynamically downloaded models are fetched on demand.\u003c/p\u003e\n"],["\u003cp\u003eChoosing between bundled and unbundled models depends on priorities: bundled for immediate functionality, unbundled for smaller app size and automatic updates.\u003c/p\u003e\n"],["\u003cp\u003eModels can be downloaded at install time, explicitly requested, or downloaded on first use, and updates for bundled or dynamically downloaded models require app updates.\u003c/p\u003e\n"],["\u003cp\u003eDynamically downloaded models are offered for APIs with extensive model options, such as Digital Ink Recognition and Translation, to avoid bundling all possibilities.\u003c/p\u003e\n"]]],[],null,["All ML Kit features make use of Google-trained machine learning models (known as\nbase models) by default. This guide is only applicable to base models. [See here\nfor guidance on custom models.](/ml-kit/custom-models)\n\nModels in ML Kit APIs can be installed in one of three ways:\n\n1. **Unbundled:** Models are downloaded and managed via Google Play Services.\n2. **Bundled:** Models are statically linked to your app at build time.\n3. **Dynamically downloaded:** Models are downloaded on demand.\n\nSupported installation paths for each API\n\nThe table below shows which model installation paths are supported by each ML\nKit feature:\n\n|---------------------------------------------------------------------------|---------------|-------------|----------------------------|\n| | **Unbundled** | **Bundled** | **Dynamically downloaded** |\n| [Text recognition v2](/ml-kit/vision/text-recognition/v2/android) | ✅ | ✅ | |\n| [Face detection](/ml-kit/vision/face-detection/android) | ✅ | ✅ | |\n| [Face mesh detection](/ml-kit/vision/face-mesh-detection/android) | | ✅ | |\n| [Pose detection](/ml-kit/vision/pose-detection/android) | | ✅ | |\n| [Selfie segmentation](/ml-kit/vision/selfie-segmentation/android) | | ✅ | |\n| [Barcode scanning](/ml-kit/vision/barcode-scanning/android) | ✅ | ✅ | |\n| [Image labeling](/ml-kit/vision/image-labeling/android) | ✅ | ✅ | |\n| [Object detection and tracking](/ml-kit/vision/object-detection/android) | | ✅ | |\n| [Digital ink recognition](/ml-kit/vision/digital-ink-recognition/android) | | | ✅ |\n| [Document scanner](/ml-kit/vision/doc-scanner) | ✅ | | |\n| [Subject segmentation](/ml-kit/vision/subject-segmentation/android) | ✅ | | |\n| [Google code scanner](/ml-kit/code-scanner) | ✅ | | |\n| [Language identification](/ml-kit/language/identification/android) | ✅ | ✅ | |\n| [Translation](/ml-kit/language/translation/android) | | | ✅ |\n| [Smart Reply](/ml-kit/language/smart-reply/android) | ✅ | ✅ | |\n| [Entity Extraction](/ml-kit/language/entity-extraction/android) | | | ✅ |\n\nAPI-specific guides show which installation options are available for the given\nAPI.\n\nKey differences between installation options\n\n|----------------------------------------------|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | **Unbundled** | **Bundled** | **Dynamically downloaded** |\n| **Where are models stored?** | Resides in Google Play Services and is not counted towards the storage used by this app | Saved in [app-specific storage](https://developer.android.com/training/data-storage/app-specific) after installation | Saved in [app-specific storage](https://developer.android.com/training/data-storage/app-specific) after model download |\n| **How does model size affect app size?** | Does not contribute to app size | Directly contributes to app size | Does not contribute to app size but increase the [app-specific storage](https://developer.android.com/training/data-storage/app-specific) |\n| **When are models updated?** | Automatically updated when a newer version is released | [Need to update the app to update model](#update-model) | [Need to update the app to update model](#update-model) |\n| **When are models downloaded?** | [Models must be downloaded before use](#download-models) | All models and features are included when the app is installed, so are usable immediately | Model downloads, updates, and deletions must be managed manually using the [RemoteModelManager](/android/reference/com/google/mlkit/common/model/RemoteModelManager) API |\n| **When are models removed from the device?** | Google Play Services will only remove the model from storage if all apps that depend on the model are uninstalled | Models are removed from [app-specific storage](https://developer.android.com/training/data-storage/app-specific) when the app is uninstalled | Downloaded models are removed from [app-specific storage](https://developer.android.com/training/data-storage/app-specific) when the app is uninstalled |\n\nHow to choose between bundled and unbundled\n\nIf an API supports both the bundled and unbundled installation options:\n\n- Use the bundled option if you prioritize:\n\n - Complete feature functionality immediately after app installation\n - Feature functionality without network connection after app installation\n- Use the unbundled option if you prioritize:\n\n - Smaller app size\n - Automated model updates by Google Play Services\n\nHow to download models\n\nWhen using the unbundled model option, you can specify how you want models to be\ndownloaded to the device:\n\n- You can enable **install-time model downloads** by adding a declaration to\n your app's `AndroidManifest.xml` file. For example, the code snippet below\n shows how to configure your app to automatically download the Barcode\n Scanning model after your app is installed from the Play Store:\n\n \u003capplication ...\u003e\n ...\n \u003cmeta-data\n android:name=\"com.google.mlkit.vision.DEPENDENCIES\"\n android:value=\"barcode\" \u003e\n \u003c!-- To use multiple models: android:value=\"barcode,model2,model3\" --\u003e\n \u003c/application\u003e\n\n- You can **request explicit download** through Google Play Services\n [ModuleInstallClient API](/android/guides/module-install-apis).\n\n- If you don't enable install-time model downloads or request explicit\n download, the model will be downloaded the first time you run the feature.\n Until the download is completed, inference requests will fail.\n\nHow to update models\n\nTo update your models when using the bundled model or the dynamically downloaded\nmodels option:\n\n1. Update your app's gradle file to use the latest ML Kit feature client\n library.\n\n dependencies {\n implementation 'com.google.mlkit:barcode-scanning: 17.3.0' // The latest version number of the API\n }\n\n2. Rebuild your app.\n\nWhy some APIs offer dynamically downloaded models\n\nSome ML Kit API have too many model options to bundle. For example, [Digital ink\nrecognition](/ml-kit/vision/digital-ink-recognition) supports [300+\nlanguages](/ml-kit/vision/digital-ink-recognition/base-models), and it's not\nalways necessary to put every language inside the feature during installation.\nFor that purpose, we provide the third installation option, in which models are\ndownloaded on demand after installation. Currently, only [Digital ink\nrecognition](/ml-kit/vision/digital-ink-recognition),\n[Translation](/ml-kit/language/translation) and [Entity\nextraction](/ml-kit/language/entity-extraction) have this option."]]