AutoML 학습 이미지 분류 모델을 커스텀 모델에 전달할 수 있습니다. API에 액세스할 수 있습니다 앱 내부에 모델을 계속 번들로 묶거나 호스팅할 수 있습니다. 을 커스텀 모델로 생성했습니다. AutoML Image Labeling API는 커스텀 모델 이미지로 완전히 대체되었으므로 ML Kit에서 삭제됨 라벨 지정 API
API | 어떤 점이 달라지나요? |
---|---|
AutoML Vision Edge 이미지 라벨 지정 API | 커스텀 모델 이미지 라벨 지정 API로 완전히 대체됩니다. 기존 AutoML Vision Edge 이미지 라벨 지정 API가 삭제되었습니다. |
현재 AutoML Vision Edge API를 사용하는 ML Kit 사용자인 경우 Android 및 iOS용 이전 안내를 따릅니다.
자주 묻는 질문(FAQ)
변경되는 이유
이를 통해 ML Kit API를 간소화하고 ML Kit를 있습니다. 이번 변경을 통해 정확한 위치에서 AutoML 학습 모델을 사용할 수 있습니다. 커스텀 모델과 동일한 방식으로 작동합니다. 또한 AutoML 학습 모델을 사용하여 이미지 라벨 지정 외에도 Google에서 제공하는 있습니다. 또한 커스텀 모델 API는 메타데이터에 삽입된 라벨 맵, 그리고 별도의 매니페스트와 라벨 파일의 역할을 합니다.
새 SDK로 이전하면 어떤 이점이 있나요?
- 새로운 기능: 두 이미지 라벨 지정 모두에 AutoML 학습 모델을 사용할 수 있는 기능 객체 감지 및 라벨 맵이 있는 모델 추적 및 사용 기능 확인할 수 있습니다
Android용 이전 가이드
1단계: Gradle 가져오기 업데이트
모듈에서 ML Kit Android 라이브러리의 종속 항목을 업데이트합니다.
(앱 수준) Gradle 파일 (일반적으로 app/build.gradle
)은 다음과 같습니다.
표:
기능 | 오래된 아티팩트 | 새로운 아티팩트 |
---|---|---|
원격 모델을 다운로드하지 않고 이미지 라벨 지정 AutoML | com.google.mlkit:image-labeling-automl:16.2.1 | com.google.mlkit:image-labeling-custom:16.0.0-beta5 |
원격 모델 다운로드로 이미지 라벨 지정 AutoML |
com.google.mlkit:image-labeling-automl:16.2.1 com.google.mlkit:linkfirebase:16.0.1 |
com.google.mlkit:image-labeling-custom:16.0.0-beta5 com.google.mlkit:linkfirebase:17.0.0 |
2단계: 클래스 이름 업데이트
수업이 이 표에 나타나면 다음과 같이 변경하세요.
이전 클래스 | 새 수업 |
---|---|
com.google.mlkit.vision.label.automl.AutoMLImageLabelerLocalModel | com.google.mlkit.common.model.LocalModel |
com.google.mlkit.vision.label.automl.AutoMLImageLabelerRemoteModel | com.google.mlkit.common.model.CustomRemoteModel |
com.google.mlkit.vision.label.automl.AutoMLImageLabelerOptions | com.google.mlkit.vision.label.custom.CustomImageLabelerOptions |
3단계: 메서드 이름 업데이트
최소한의 코드 변경사항이 있습니다.
LocalModel
는 이제 모델 파일 경로 (모델에 라벨 맵이 포함된 메타데이터가 있는 경우) 또는 모델 매니페스트 파일 경로 (매니페스트, 모델, 라벨이 별도의 파일에 있는 경우)로 초기화할 수 있습니다.- Firebase Console을 통해 커스텀 모델을 원격으로 호스팅하고
FirebaseModelSource
를 사용하여CustomRemoteModel
를 초기화할 수 있습니다.
다음은 기존 및 새 Kotlin 메서드의 몇 가지 예입니다.
변경 전
val localModel = AutoMLImageLabelerLocalModel.Builder() .setAssetFilePath("automl/manifest.json") // or .setAbsoluteFilePath(absolute file path to manifest file) .build() val optionsWithLocalModel = AutoMLImageLabelerOptions.Builder(localModel) .setConfidenceThreshold(0.5f) .build() val remoteModel = AutoMLImageLabelerRemoteModel.Builder("automl_remote_model") .build() val optionsWithRemoteModel = AutoMLImageLabelerOptions.Builder(remoteModel) .build()
신규
val localModel = LocalModel.Builder() .setAssetManifestFilePath("automl/manifest.json") // or .setAbsoluteManifestFilePath(absolute file path to manifest file) .build() val optionsWithLocalModel = CustomImageLabelerOptions.Builder(localModel) .setConfidenceThreshold(0.5f) .build() val firebaseModelSource = FirebaseModelSource.Builder("automl_remote_model") .build() val remoteModel = CustomRemoteModel.Builder(firebaseModelSource).build() val optionsWithRemoteModel = CustomImageLabelerOptions.Builder(remoteModel) .build()
다음은 기존 및 신규 Java 메서드의 몇 가지 예입니다.
변경 전
AutoMLImageLabelerLocalModel localModel = new AutoMLImageLabelerLocalModel.Builder() .setAssetFilePath("automl/manifest.json") // or .setAbsoluteFilePath(absolute file path to manifest file) .build(); AutoMLImageLabelerOptions optionsWithLocalModel = new AutoMLImageLabelerOptions.Builder(localModel) .setConfidenceThreshold(0.5f) .build(); AutoMLImageLabelerRemoteModel remoteModel = new AutoMLImageLabelerRemoteModel.Builder("automl_remote_model").build(); AutoMLImageLabelerOptions optionsWithRemoteModel = new AutoMLImageLabelerOptions.Builder(remoteModel) .build();
신규
LocalModel localModel = new LocalModel.Builder() .setAssetManifestFilePath("automl/manifest.json") // or .setAbsoluteManifestFilePath(absolute file path to manifest file) .build() CustomImageLabelerOptions optionsWithLocalModel = new CustomImageLabelerOptions.Builder(localModel) .setConfidenceThreshold(0.5f) .build(); FirebaseModelSource firebaseModelSource = new FirebaseModelSource.Builder("automl_remote_model").build(); CustomRemoteModel remoteModel = new CustomRemoteModel.Builder(firebaseModelSource).build(); CustomImageLabelerOptions optionsWithRemoteModel = new CustomImageLabelerOptions.Builder(remoteModel).build();
iOS용 이전 가이드
기본 요건
- Xcode 13.2.1 이상이 필요합니다.
1단계: CocoaPods 업데이트하기
앱의 Podfile에서 ML Kit iOS CocoaPods의 종속 항목을 업데이트합니다.
기능 | 이전 포드 이름 | 새 포드 이름 |
---|---|---|
원격 모델을 다운로드하지 않고 이미지 라벨 지정 AutoML | GoogleMLKit/ImageLabelingAutoML | GoogleMLKit/ImageLabelingCustom |
원격 모델 다운로드로 이미지 라벨 지정 AutoML |
GoogleMLKit/ImageLabelingAutoML GoogleMLKit/LinkFirebase |
GoogleMLKit/ImageLabelingCustom GoogleMLKit/LinkFirebase |
2단계: 클래스 이름 업데이트
수업이 이 표에 나타나면 다음과 같이 변경하세요.
Swift
이전 클래스 | 새 수업 |
---|---|
AutoMLImageLabelerLocalModel | LocalModel |
AutoMLImageLabelerRemoteModel | CustomRemoteModel |
AutoMLImageLabelerOptions | CustomImageLabelerOptions |
Objective-C
이전 클래스 | 새 수업 |
---|---|
MLKAutoMLImageLabelerLocalModel | MLKLocalModel |
MLKAutoMLImageLabelerRemoteModel | MLKCustomRemoteModel |
MLKAutoMLImageLabelerOptions | MLKCustomImageLabelerOptions |
Objective-C
3단계: 메서드 이름 업데이트
최소한의 코드 변경사항이 있습니다.
LocalModel
는 이제 모델 파일 경로 (모델에 라벨 맵이 포함된 메타데이터가 있는 경우) 또는 모델 매니페스트 파일 경로 (매니페스트, 모델, 라벨이 별도의 파일에 있는 경우)로 초기화할 수 있습니다.- Firebase Console을 통해 커스텀 모델을 원격으로 호스팅하고
FirebaseModelSource
를 사용하여CustomRemoteModel
를 초기화할 수 있습니다.
다음은 기존 및 신규 Swift 메서드의 몇 가지 예입니다.
변경 전
let localModel = AutoMLImageLabelerLocalModel(manifestPath: "automl/manifest.json") let optionsWithLocalModel = AutoMLImageLabelerOptions(localModel: localModel) let remoteModel = AutoMLImageLabelerRemoteModel(name: "automl_remote_model") let optionsWithRemoteModel = AutoMLImageLabelerOptions(remoteModel: remoteModel)
신규
guard let localModel = LocalModel(manifestPath: "automl/manifest.json") else { return } let optionsWithLocalModel = CustomImageLabelerOptions(localModel: localModel) let firebaseModelSource = FirebaseModelSource(name: "automl_remote_model") let remoteModel = CustomRemoteModel(remoteModelSource: firebaseModelSource) let optionsWithRemoteModel = CustomImageLabelerOptions(remoteModel: remoteModel)
다음은 기존 및 신규 Objective-C 메서드의 몇 가지 예입니다.
변경 전
MLKAutoMLImageLabelerLocalModel *localModel = [[MLKAutoMLImageLabelerLocalModel alloc] initWithManifestPath:"automl/manifest.json"]; MLKAutoMLImageLabelerOptions *optionsWithLocalModel = [[MLKAutoMLImageLabelerOptions alloc] initWithLocalModel:localModel]; MLKAutoMLImageLabelerRemoteModel *remoteModel = [[MLKAutoMLImageLabelerRemoteModel alloc] initWithManifestPath:"automl/manifest.json"]; MLKAutoMLImageLabelerOptions *optionsWithRemoteModel = [[MLKAutoMLImageLabelerOptions alloc] initWithRemoteModel:remoteModel];
신규
MLKLocalModel *localModel = [[MLKLocalModel alloc] initWithManifestPath:"automl/manifest.json"]; MLKCustomImageLabelerOptions *optionsWithLocalModel = [[MLKCustomImageLabelerOptions alloc] initWithLocalModel:localModel]; MLKFirebaseModelSource *firebaseModelSource = [[MLKFirebaseModelSource alloc] initWithName:@"automl_remote_model"]; MLKCustomRemoteModel *remoteModel = [[MLKCustomRemoteModel alloc] initWithRemoteModelSource:firebaseModelSource]; MLKCustomImageLabelerOptions *optionsWithRemoteModel = [[MLKCustomImageLabelerOptions alloc] initWithRemoteModel:remoteModel];