atharvakale31 / Real-Time_Face_Recognition_Android

Real-Time Face Recognition App using Tensorflow Lite
https://play.google.com/store/apps/details?id=com.atharvakale.facerecognition
178 stars 68 forks source link

Need to upgrade the depreciated versions #30

Open Ganeshkumar1010 opened 1 year ago

Ganeshkumar1010 commented 1 year ago

Interpreter - Which is depreciated and need some solution for this. image

vasantharaj1972 commented 1 year ago

Upgrade the following packages in gradle(app) file

implementation 'com.google.mlkit:face-detection:16.1.5' ... implementation('org.tensorflow:tensorflow-lite:+') { changing = true } implementation('org.tensorflow:tensorflow-lite-gpu:+') { changing = true } implementation('org.tensorflow:tensorflow-lite-support:+') { changing = true }

atharvakale31 commented 1 year ago

@binayshaw7777 You updated this in the last pull, right? Or are these more recent ones?

binayshaw7777 commented 1 year ago

@atharvakale31 I already updated the Gradle in my last PR, well the changes mentioned by @vasantharaj1972 didn't work for me when I was using it, it was crashing.

binayshaw7777 commented 1 year ago

@vasantharaj1972 please check #28

vasantharaj1972 commented 1 year ago

Hi Binayshaw,

My Gradle setting file content is

plugins { id 'com.android.application' }

android { compileSdkVersion 29 buildToolsVersion "30.0.2"

defaultConfig {
    applicationId "com.atharvakale.facerecognition"
    minSdkVersion 21
    targetSdkVersion 29
    versionCode 3
    versionName "1.2"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
aaptOptions {
    noCompress "tflite"
}

buildTypes {
    release {

        minifyEnabled true
        shrinkResources true

// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }

dependencies {

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'

implementation 'com.google.mlkit:face-detection:16.1.5'

implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment:2.3.2'
implementation 'androidx.navigation:navigation-ui:2.3.2'
implementation 'com.google.code.gson:gson:2.8.6'
def lottieVersion = "3.4.0"
implementation "com.airbnb.android:lottie:$lottieVersion"
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.squareup.picasso:picasso:2.71828'
// CameraX core library using the camera2 implementation
def camerax_version = "1.0.0-rc01"
// The following line is optional, as the core library is included indirectly by camera-camera2
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
// If you want to additionally use the CameraX Lifecycle library
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
// If you want to additionally use the CameraX View class
implementation "androidx.camera:camera-view:1.0.0-alpha20"
// If you want to additionally use the CameraX Extensions library
implementation "androidx.camera:camera-extensions:1.0.0-alpha20"
implementation 'com.android.volley:volley:1.2.1'
implementation('org.tensorflow:tensorflow-lite:+') { changing = true }
implementation('org.tensorflow:tensorflow-lite-gpu:+') { changing = true }
implementation('org.tensorflow:tensorflow-lite-support:+') { changing = true }
implementation 'br.com.simplepass:loading-button-android:1.14.0'
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
binayshaw7777 commented 1 year ago

@vasantharaj1972 Is it working in your case? If it's not working, try pulling the new changes, it seems your one is outdated.

Change to: compileSdkVersion 33 buildToolsVersion "30.0.3" targetSdkVersion 33

Also change tensorflow dependencies, I don't remember the exact article where I found out those were the main issues.

New: implementation 'org.tensorflow:tensorflow-lite-task-vision:0.3.0' implementation 'org.tensorflow:tensorflow-lite-support:0.3.0' implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly-SNAPSHOT'

vasantharaj1972 commented 1 year ago

@binayshaw7777 It is working for me and the mentioned one is latest and updated one. image

binayshaw7777 commented 1 year ago

@vasantharaj1972 cool, I'll test out your changes and let you know. You can contribute via PR, you can ask @atharvakale31.