Skip to content

Commit

Permalink
update dependencies and migrate from TFLite to LiteRT
Browse files Browse the repository at this point in the history
  • Loading branch information
solrudev committed Nov 12, 2024
1 parent 131adab commit f477cce
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ kotlin {
}

base {
archivesName.set(packageName)
archivesName = packageName
}

android {
Expand Down Expand Up @@ -122,7 +122,7 @@ dependencies {
implementation(libs.viewbindingpropertydelegate)
implementation(libs.insetter)
implementation(libs.mlkit.facedetection)
implementation(libs.bundles.tensorflow)
implementation(libs.bundles.litert)

debugImplementation(androidx.multidex)

Expand Down
10 changes: 9 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@

#### Miscellaneous
-keep,allowobfuscation,allowshrinking class org.tensorflow.lite.gpu.GpuDelegateFactory$Options$GpuBackend
-keep,allowobfuscation,allowshrinking class org.tensorflow.lite.gpu.GpuDelegateFactory$Options
-keep,allowobfuscation,allowshrinking class org.tensorflow.lite.gpu.GpuDelegateFactory$Options

-dontwarn javax.lang.model.SourceVersion
-dontwarn javax.lang.model.element.Element
-dontwarn javax.lang.model.element.ElementKind
-dontwarn javax.lang.model.element.Modifier
-dontwarn javax.lang.model.type.TypeMirror
-dontwarn javax.lang.model.type.TypeVisitor
-dontwarn javax.lang.model.util.SimpleTypeVisitor8
8 changes: 4 additions & 4 deletions gradle/androidx.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
navigation = "2.7.7"
camera = "1.3.4"
navigation = "2.8.3"
camera = "1.4.0"

[libraries]
activity = { module = "androidx.activity:activity", version = "1.9.0" }
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version = "1.6.2" }
activity = { module = "androidx.activity:activity", version = "1.9.3" }
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version = "1.8.5" }
navigation-fragment = { module = "androidx.navigation:navigation-fragment", version.ref = "navigation" }
navigation-ui = { module = "androidx.navigation:navigation-ui", version.ref = "navigation" }
multidex = { module = "androidx.multidex:multidex", version = "2.0.1" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/dagger.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
dagger = "2.51.1"
dagger = "2.52"
hilt = "1.2.0"

[libraries]
Expand Down
28 changes: 13 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[versions]
android-gradleplugin = "8.5.1"
kotlin = "2.0.0"
kotlin-ksp = "2.0.0-1.0.22"
kotlinx-coroutines = "1.8.1"
tensorflow-lite = "0.4.4"
tensorflow-gpu = "2.15.0"
android-gradleplugin = "8.6.1"
kotlin = "2.0.21"
kotlin-ksp = "2.0.21-1.0.26"
kotlinx-coroutines = "1.9.0"
litert = "1.0.1"

[libraries]
materialcomponents = { module = "com.google.android.material:material", version = "1.12.0" }
Expand All @@ -14,21 +13,20 @@ kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-t
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
junit-platform-commons = { module = "org.junit.platform:junit-platform-commons", version = "1.10.1" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version = "5.10.1" }
mlkit-facedetection = { module = "com.google.mlkit:face-detection", version = "16.1.6" }
tensorflow-taskvision = { module = "org.tensorflow:tensorflow-lite-task-vision", version = "0.4.4" }
tensorflow-gpudelegateplugin = { module = "org.tensorflow:tensorflow-lite-gpu-delegate-plugin", version.ref = "tensorflow-lite" }
tensorflow-gpu = { module = "org.tensorflow:tensorflow-lite-gpu", version.ref = "tensorflow-gpu" }
tensorflow-gpu-api = { module = "org.tensorflow:tensorflow-lite-gpu-api", version.ref = "tensorflow-gpu" }
tensorflow-metadata = { module = "org.tensorflow:tensorflow-lite-metadata", version.ref = "tensorflow-lite" }
tensorflow-support = { module = "org.tensorflow:tensorflow-lite-support", version.ref = "tensorflow-lite" }
mlkit-facedetection = { module = "com.google.mlkit:face-detection", version = "16.1.7" }
mediapipe-tasksvision = { module = "com.google.mediapipe:tasks-vision", version = "0.10.18" }
litert-gpu = { module = "com.google.ai.edge.litert:litert-gpu", version.ref = "litert" }
litert-gpu-api = { module = "com.google.ai.edge.litert:litert-gpu-api", version.ref = "litert" }
litert-metadata = { module = "com.google.ai.edge.litert:litert-metadata", version.ref = "litert" }
litert-support = { module = "com.google.ai.edge.litert:litert-support", version.ref = "litert" }
insetter = { module = "dev.chrisbanes.insetter:insetter", version = "0.6.1" }

[bundles]
junit = ["junit-platform-commons", "junit-jupiter"]
tensorflow = ["tensorflow-taskvision", "tensorflow-gpudelegateplugin", "tensorflow-gpu", "tensorflow-gpu-api", "tensorflow-metadata", "tensorflow-support"]
litert = ["mediapipe-tasksvision", "litert-gpu", "litert-gpu-api", "litert-metadata", "litert-support"]

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradleplugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "kotlin-ksp" }
android-cachefix = { id = "org.gradle.android.cache-fix", version = "3.0" }
android-cachefix = { id = "org.gradle.android.cache-fix", version = "3.0.1" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.

0 comments on commit f477cce

Please sign in to comment.