【问题标题】:why my app can’t use FirebaseVisionLabelDetectorOptions class为什么我的应用不能使用 FirebaseVisionLabelDetectorOptions 类
【发布时间】:2020-05-28 23:16:31
【问题描述】:

我尝试从 FirebaseVisionLabelDetectorOptions 类创建一个对象,但我的应用没有导入它 I got this error 。这是我的依赖项

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.3.0'
implementation 'com.wonderkiln:camerakit:0.13.1'
implementation 'com.github.d-max:spots-dialog:1.1@aar'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-ml-vision:24.0.3'

【问题讨论】:

    标签: android firebase android-studio firebase-mlkit google-mlkit


    【解决方案1】:

    您正在使用 the Cloud Landmarks API,因此您需要 Cloud Options 类

    FirebaseVisionCloudDetectorOptions options =
        new FirebaseVisionCloudDetectorOptions.Builder()
                .setModelType(FirebaseVisionCloudDetectorOptions.LATEST_MODEL)
                .setMaxResults(15)
                .build();
    

    基于云的 API 与设备端 API 的工作方式不同,因此选项会略有不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-15
      • 2011-01-14
      • 2012-05-02
      • 1970-01-01
      相关资源
      最近更新 更多