Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ML for driver aggression estimation and data sync fixes #117

Merged
merged 27 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
446ec29
Added ML DataSource and Interactor to access `CustomModels` from.
HLCaptain Aug 13, 2023
3d7e2f9
Added ML downloads and ML Settings screen.
HLCaptain Aug 13, 2023
297b085
Changed how screen height is calculated.
HLCaptain Aug 13, 2023
4d6957e
Added warning screen before `MLSettings`.
HLCaptain Aug 13, 2023
d793784
Small UI refactors, started preparing data input to Custom ML Model.
HLCaptain Aug 13, 2023
9235328
Version bump to `0.4.0`. :)
HLCaptain Aug 13, 2023
de6664d
Fixed DropdownSetting shifting to the start when opened.
HLCaptain Aug 14, 2023
8ac4d19
Implemented basic Aggression evaluation and data syncing.
HLCaptain Aug 18, 2023
b637dcb
Compressing sensor events.
HLCaptain Aug 19, 2023
dd82316
Upgraded dependencies. Migrated Dagger/Hilt from Kapt to KSP. Theming…
HLCaptain Sep 6, 2023
44b1d97
Merge remote-tracking branch 'origin/60-implement-machine-learning' i…
HLCaptain Sep 6, 2023
4fbc847
ML model processes after a few seconds, then shows the output on `Ses…
HLCaptain Sep 9, 2023
9eb8015
Now able to interpolate sensor events at an interval. ML model output…
HLCaptain Sep 10, 2023
88c8bb0
Crash fix when empty list is given to sensor fusion.
HLCaptain Sep 10, 2023
d1c943b
Fixed aggression UI bug.
HLCaptain Sep 10, 2023
a6bb1ad
Dependency upgrades.
HLCaptain Jan 13, 2024
97efc59
Dependency upgrades.
HLCaptain Apr 1, 2024
2e7db42
Dependency upgrades.
HLCaptain Jul 30, 2024
8d8d468
Fixed crash due to offset not accessible on first frame.
HLCaptain Jul 30, 2024
b4c1057
Changed aggression tab color to disabled when no models are available.
HLCaptain Jul 30, 2024
9d10ac4
Fixed aggression handling.
HLCaptain Jul 30, 2024
79913e4
Changed name to milli from timestamp.
HLCaptain Jul 30, 2024
ffe8e24
Navigate to BME button is DEBUG only from now.
HLCaptain Jul 30, 2024
02207d3
Added Room auto migrations and syncing aggression values.
HLCaptain Jul 30, 2024
62209e8
Added v35 Room database schema for auto migration.
HLCaptain Jul 30, 2024
e63ad3f
Added aggression value syncs to cloud and disk.
HLCaptain Jul 30, 2024
6419752
Fixed crashes.
HLCaptain Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
.gradle
/build
/app/build
/app/benchmark/build

# Kotlin K2
/.kotlin

# Android Studio
# Needed for configuration only
Expand Down
91 changes: 66 additions & 25 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* Copyright (c) 2024 Balázs Püspök-Kiss (Illyan)
*
* Jay is a driver behaviour analytics app.
*
* This file is part of Jay.
*
* Jay is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
* Jay is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jay.
* If not, see <https://www.gnu.org/licenses/>.
*/

import com.google.android.libraries.mapsplatform.secrets_gradle_plugin.loadPropertiesFile

/*
* Copyright (c) 2022-2023 Balázs Püspök-Kiss (Illyan)
*
Expand All @@ -18,29 +38,31 @@

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.androidx.room)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.jetbrains.kotlin.kapt)
alias(libs.plugins.jetbrains.kotlin.parcelize)
alias(libs.plugins.jetbrains.kotlin.serialization)
// alias(libs.plugins.jetbrains.kotlin.jvm)
alias(libs.plugins.google.gms.services)
alias(libs.plugins.google.secrets)
alias(libs.plugins.firebase.crashlytics)
alias(libs.plugins.hilt)
alias(libs.plugins.junit5)
alias(libs.plugins.ksp)
alias(libs.plugins.compose.compiler)
}

android {
compileSdk = 34
compileSdk = 35

namespace = "illyan.jay"

defaultConfig {
applicationId = "illyan.jay"
minSdk = 21
targetSdk = 34
versionCode = 17
versionName = "0.3.6-alpha"
minSdk = 23
targetSdk = 35
versionCode = 18
versionName = "0.4.0-alpha"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -68,10 +90,30 @@ android {
"proguard-rules.pro"
)
}
create("benchmark") {
initWith(getByName("release"))
signingConfig = signingConfigs.getByName("debug")
matchingFallbacks += listOf("release")
}

signingConfigs {
val properties = loadPropertiesFile("../local.properties").toMap()

val debugStorePath = properties["DEBUG_KEY_PATH"].toString()
val debugKeyAlias = properties["DEBUG_KEY_ALIAS"].toString()
val debugStorePassword = properties["DEBUG_KEYSTORE_PASSWORD"].toString()
val debugKeyPassword = properties["DEBUG_KEY_PASSWORD"].toString()
getByName("debug") {
storeFile = file(debugStorePath)
keyAlias = debugKeyAlias
storePassword = debugStorePassword
keyPassword = debugKeyPassword
}
val releaseStorePath = properties["RELEASE_KEY_PATH"].toString()
val releaseKeyAlias = properties["RELEASE_KEY_ALIAS"].toString()
val releaseStorePassword = properties["RELEASE_KEYSTORE_PASSWORD"].toString()
val releaseKeyPassword = properties["RELEASE_KEY_PASSWORD"].toString()
create("release") {
storeFile = file(releaseStorePath)
keyAlias = releaseKeyAlias
storePassword = releaseStorePassword
keyPassword = releaseKeyPassword
}
}

Expand All @@ -90,10 +132,6 @@ android {
buildConfig = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.orNull
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down Expand Up @@ -158,6 +196,9 @@ dependencies {
// Item Swipe
implementation(libs.saket.swipe)

// Math for interpolation
implementation(libs.apache.commons.math3)

// Mapbox
implementation(libs.mapbox.maps)
implementation(libs.mapbox.search)
Expand All @@ -170,7 +211,7 @@ dependencies {

// Hilt
implementation(libs.hilt)
kapt(libs.hilt.compiler)
ksp(libs.hilt.compiler)
implementation(libs.hilt.navigation.compose)

// Timber
Expand Down Expand Up @@ -212,12 +253,12 @@ dependencies {

// Firebase
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.auth.ktx)
implementation(libs.firebase.config.ktx)
implementation(libs.firebase.analytics.ktx)
implementation(libs.firebase.crashlytics.ktx)
implementation(libs.firebase.firestore.ktx)
implementation(libs.firebase.perf.ktx)
implementation(libs.firebase.auth)
implementation(libs.firebase.config)
implementation(libs.firebase.analytics)
implementation(libs.firebase.crashlytics)
implementation(libs.firebase.firestore)
implementation(libs.firebase.perf)

// Firebase ML
implementation(libs.firebase.ml.modeldownloader)
Expand All @@ -243,10 +284,10 @@ dependencies {
coreLibraryDesugaring(libs.desugar.jdk.libs)
}

kapt {
correctErrorTypes = true
}

hilt {
enableAggregatingTask = true
}

room {
schemaDirectory("$projectDir/schemas")
}
Loading
Loading