Giter VIP home page Giter VIP logo

nsfw-detector-android's Introduction

License: MIT

NSFW(Nude Content) Detector Android

NSFW Content detector using Firebase MlKit (AutoML) . This module developed using Firebase on device AutoML and Firebase Vision.

This module contains pre trained TensorFlow Lite(tflite) model that compatible with AutoML. And this is an OnDeviceAutoMLImageLabeler.

Installation

  1. Add the JitPack repository to your build file
    Add it in your project build.gradle at the end of repositories:
buildscript {
    ...
    dependencies {
        ...
        classpath 'com.google.gms:google-services:<latest_version>'
    }
}

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add nsfw-detector and rest of the firebase dependencies
    Add it in your app build.gradle
...
android {
    ...
    aaptOptions {
        noCompress "tflite"
    }
}

dependencies {
    ...
    api "com.google.firebase:firebase-ml-vision:<latest_version>"
    implementation "com.google.firebase:firebase-ml-vision-automl:<latest_version>"
    implementation "com.google.firebase:firebase-ml-model-interpreter:<latest_version>"

    implementation 'com.github.nipunru:nsfw-detector-android:1.0.0'
}

apply plugin: 'com.google.gms.google-services'
  1. Run the gradle sync

Note: Since this is on device image method, It will take some time to download the tflite model.

  1. Enable Firebase Please follow this documentation Make sure to add google-service.json file to your project.

Usage

  • Initialize Firebase
    Add this before call the NSFWDetector
FirebaseApp.initializeApp(context)
  • Scan for NSFW
val bitmap: Bitmap //Image that you want to scan
val confidenceThreshold: Float //(Optional) Default is 0.7

NSFWDetector.isNSFW(bitmap,confidenceThreshold) { isNSFW, confidence, image ->
    if (isNSFW){
        Toast.makeText(this, "NSFW with confidence: $confidence", Toast.LENGTH_SHORT).show()
    } else {
        Toast.makeText(this, "SFW with confidence: $confidence", Toast.LENGTH_SHORT).show()
    }
}

License

MIT License

Copyright (c) 2020 Nipun Ruwanpathirana

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

nsfw-detector-android's People

Contributors

nipunru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nsfw-detector-android's Issues

Loading model error

HI, it seems that loading model not working on version 1.0.0
2021-10-12 18:02:33.028 12322-14215/com.phollow.app.dev E/ODAutoMLImgLabelerTask: Error while loading the AutoML image labeling model. android.os.RemoteException at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:89) at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78) at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53) at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7) at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24) at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32) at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6) at android.os.Looper.loop(Looper.java:246) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.firebase.ml.common.FirebaseMLException: Local model load failed with the model options: Local model path: automl/manifest.json. Remote model name: unspecified. at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:36) at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85) at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: com.google.firebase.ml.common.FirebaseMLException: Loading AutoML model failed at com.google.firebase.ml.vision.automl.zzb.zzpl(com.google.firebase:firebase-ml-vision-automl@@18.0.3:16) at com.google.firebase.ml.vision.automl.zzb.load(com.google.firebase:firebase-ml-vision-automl@@18.0.3:7) at com.google.firebase.ml.common.internal.modeldownload.zzj.zzb(com.google.firebase:firebase-ml-common@@22.0.1:59) at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:21) at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85)  at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed at android.content.res.AssetManager.nativeOpenAssetFd(Native Method) at android.content.res.AssetManager.openFd(AssetManager.java:950) at com.google.firebase.ml.vision.automl.zzg.zza(com.google.firebase:firebase-ml-vision-automl@@18.0.3:12) at com.google.firebase.ml.vision.automl.zzb.zzpl(com.google.firebase:firebase-ml-vision-automl@@18.0.3:14) at com.google.firebase.ml.vision.automl.zzb.load(com.google.firebase:firebase-ml-vision-automl@@18.0.3:7)  at com.google.firebase.ml.common.internal.modeldownload.zzj.zzb(com.google.firebase:firebase-ml-common@@22.0.1:59)  at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:21)  at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85)  at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  2021-10-12 18:02:33.029 12322-14215/com.phollow.app.dev E/ModelResourceManager: Error preloading model resource com.google.firebase.ml.common.FirebaseMLException: Cannot load the AutoML image labeling model. at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:83) at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53) at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7) at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24) at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32) at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6) at android.os.Looper.loop(Looper.java:246) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: android.os.RemoteException at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:89) at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78) at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: com.google.firebase.ml.common.FirebaseMLException: Local model load failed with the model options: Local model path: automl/manifest.json. Remote model name: unspecified. at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:36) at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85) at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: com.google.firebase.ml.common.FirebaseMLException: Loading AutoML model failed at com.google.firebase.ml.vision.automl.zzb.zzpl(com.google.firebase:firebase-ml-vision-automl@@18.0.3:16) at com.google.firebase.ml.vision.automl.zzb.load(com.google.firebase:firebase-ml-vision-automl@@18.0.3:7) at com.google.firebase.ml.common.internal.modeldownload.zzj.zzb(com.google.firebase:firebase-ml-common@@22.0.1:59) at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:21) at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85)  at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed at android.content.res.AssetManager.nativeOpenAssetFd(Native Method) at android.content.res.AssetManager.openFd(AssetManager.java:950) at com.google.firebase.ml.vision.automl.zzg.zza(com.google.firebase:firebase-ml-vision-automl@@18.0.3:12) at com.google.firebase.ml.vision.automl.zzb.zzpl(com.google.firebase:firebase-ml-vision-automl@@18.0.3:14) at com.google.firebase.ml.vision.automl.zzb.load(com.google.firebase:firebase-ml-vision-automl@@18.0.3:7)  at com.google.firebase.ml.common.internal.modeldownload.zzj.zzb(com.google.firebase:firebase-ml-common@@22.0.1:59)  at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:21)  at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85)  at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.zznx(com.google.firebase:firebase-ml-common@@22.0.1:7)  at com.google.android.gms.internal.firebase_ml.zzpz$zza.call(com.google.firebase:firebase-ml-common@@22.0.1:24)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  2021-10-12 18:02:33.077 12322-14215/com.phollow.app.dev E/ODAutoMLImgLabelerTask: Error while loading the AutoML image labeling model. android.os.RemoteException at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:89) at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78) at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53) at com.google.android.gms.internal.firebase_ml.zzpj.zza(com.google.firebase:firebase-ml-common@@22.0.1:30) at com.google.android.gms.internal.firebase_ml.zzpl.call(Unknown Source:8) at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32) at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6) at android.os.Looper.loop(Looper.java:246) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: com.google.firebase.ml.common.FirebaseMLException: Local model load failed with the model options: Local model path: automl/manifest.json. Remote model name: unspecified. at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:36) at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85) at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpj.zza(com.google.firebase:firebase-ml-common@@22.0.1:30)  at com.google.android.gms.internal.firebase_ml.zzpl.call(Unknown Source:8)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: com.google.firebase.ml.common.FirebaseMLException: Loading AutoML model failed at com.google.firebase.ml.vision.automl.zzb.zzpl(com.google.firebase:firebase-ml-vision-automl@@18.0.3:16) at com.google.firebase.ml.vision.automl.zzb.load(com.google.firebase:firebase-ml-vision-automl@@18.0.3:7) at com.google.firebase.ml.common.internal.modeldownload.zzj.zzb(com.google.firebase:firebase-ml-common@@22.0.1:59) at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:21) at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85)  at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpj.zza(com.google.firebase:firebase-ml-common@@22.0.1:30)  at com.google.android.gms.internal.firebase_ml.zzpl.call(Unknown Source:8)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed at android.content.res.AssetManager.nativeOpenAssetFd(Native Method) at android.content.res.AssetManager.openFd(AssetManager.java:950) at com.google.firebase.ml.vision.automl.zzg.zza(com.google.firebase:firebase-ml-vision-automl@@18.0.3:12) at com.google.firebase.ml.vision.automl.zzb.zzpl(com.google.firebase:firebase-ml-vision-automl@@18.0.3:14) at com.google.firebase.ml.vision.automl.zzb.load(com.google.firebase:firebase-ml-vision-automl@@18.0.3:7)  at com.google.firebase.ml.common.internal.modeldownload.zzj.zzb(com.google.firebase:firebase-ml-common@@22.0.1:59)  at com.google.firebase.ml.common.internal.modeldownload.zzj.zza(com.google.firebase:firebase-ml-common@@22.0.1:21)  at com.google.firebase.ml.vision.automl.zzk.zznu(com.google.firebase:firebase-ml-vision-automl@@18.0.3:85)  at com.google.android.gms.internal.firebase_ml.zzrx.zznu(com.google.firebase:firebase-ml-vision@@24.0.1:78)  at com.google.android.gms.internal.firebase_ml.zzpz.zzf(com.google.firebase:firebase-ml-common@@22.0.1:53)  at com.google.android.gms.internal.firebase_ml.zzpj.zza(com.google.firebase:firebase-ml-common@@22.0.1:30)  at com.google.android.gms.internal.firebase_ml.zzpl.call(Unknown Source:8)  at com.google.android.gms.internal.firebase_ml.zzpf.zza(com.google.firebase:firebase-ml-common@@22.0.1:32)  at com.google.android.gms.internal.firebase_ml.zzpe.run(Unknown Source:4)  at android.os.Handler.handleCallback(Handler.java:938)  at android.os.Handler.dispatchMessage(Handler.java:99)  at com.google.android.gms.internal.firebase_ml.zze.dispatchMessage(com.google.firebase:firebase-ml-common@@22.0.1:6)  at android.os.Looper.loop(Looper.java:246)  at android.os.HandlerThread.run(HandlerThread.java:67)  2021-10-12 18:02:33.162 12322-12322/com.phollow.app.dev E/NSFWDetector: Cannot load the AutoML image labeling model.

While Added Dependency to Gradle

Getting this error while adding Gradle dependecy

Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.0.
2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Share the Dataset Used

Could you please share the dataset you used because I need to train it for remote access?

Error when using Text Recognition dependency

add this to app's build.gradle:
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.3'

runtime error when using nfsw detector:
java.lang.NoSuchFieldError: No static field AUTOML of type Lcom/google/mlkit/common/sdkinternal/ModelType;

Duplicate Class issue is happening while i am trying to add ml using firebase bom on the latest version of everything

Duplicate class com.google.android.gms.internal.vision.zze found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzf found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzg found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzh found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzi found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzv found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzw found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)

this is the error message
Screenshot_20210105_214729

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.