Skip to content

Commit cf01cb2

Browse files
psiddhGithub Executorch
andauthored
Add Android RealTime Bird watching App (#122)
Two-stage ML pipeline: YOLO object detection (finds birds) + EfficientNet classifier (identifies 525 species) Co-authored-by: Github Executorch <[email protected]>
1 parent 342213e commit cf01cb2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2755
-0
lines changed

Yolo/android/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
.idea
5+
.DS_Store
6+
/build
7+
/captures
8+
.externalNativeBuild
9+
.cxx
10+
local.properties
11+
*.so
12+
*.aar

Yolo/android/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Yolo/android/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

Yolo/android/app/build.gradle.kts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
plugins {
10+
id("com.android.application")
11+
id("org.jetbrains.kotlin.android")
12+
}
13+
14+
val qnnVersion: String? = project.findProperty("qnnVersion") as? String
15+
val useLocalAar: Boolean? = (project.findProperty("useLocalAar") as? String)?.toBoolean()
16+
17+
android {
18+
namespace = "com.example.executorchyolodemo"
19+
compileSdk = 34
20+
21+
defaultConfig {
22+
applicationId = "com.example.executorchyolodemo"
23+
minSdk = 28
24+
targetSdk = 33
25+
versionCode = 1
26+
versionName = "1.0"
27+
28+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
29+
vectorDrawables { useSupportLibrary = true }
30+
externalNativeBuild { cmake { cppFlags += "" } }
31+
}
32+
33+
buildTypes {
34+
release {
35+
isMinifyEnabled = false
36+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
37+
}
38+
}
39+
compileOptions {
40+
sourceCompatibility = JavaVersion.VERSION_1_8
41+
targetCompatibility = JavaVersion.VERSION_1_8
42+
}
43+
kotlinOptions { jvmTarget = "1.8" }
44+
buildFeatures { compose = true }
45+
composeOptions { kotlinCompilerExtensionVersion = "1.4.3" }
46+
packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } }
47+
}
48+
49+
dependencies {
50+
implementation("androidx.core:core-ktx:1.9.0")
51+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
52+
implementation("androidx.activity:activity-compose:1.7.0")
53+
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
54+
implementation("androidx.compose.ui:ui")
55+
implementation("androidx.compose.ui:ui-graphics")
56+
implementation("androidx.compose.ui:ui-tooling-preview")
57+
implementation("androidx.compose.material3:material3")
58+
implementation("androidx.appcompat:appcompat:1.6.1")
59+
implementation("androidx.camera:camera-core:1.3.0-rc02")
60+
implementation("androidx.constraintlayout:constraintlayout:2.2.0-alpha12")
61+
implementation("com.facebook.fbjni:fbjni:0.5.1")
62+
implementation("com.google.code.gson:gson:2.8.6")
63+
implementation(files("libs/executorch.aar"))
64+
65+
implementation("com.google.android.material:material:1.12.0")
66+
implementation("androidx.activity:activity:1.9.0")
67+
implementation("org.json:json:20250107")
68+
testImplementation("junit:junit:4.13.2")
69+
androidTestImplementation("androidx.test.ext:junit:1.1.5")
70+
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
71+
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
72+
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
73+
debugImplementation("androidx.compose.ui:ui-tooling")
74+
debugImplementation("androidx.compose.ui:ui-test-manifest")
75+
76+
implementation ("androidx.camera:camera-camera2:1.3.0")
77+
implementation ("androidx.camera:camera-lifecycle:1.3.0")
78+
implementation ("androidx.camera:camera-view:1.3.0")
79+
implementation ("com.google.code.gson:gson:2.10.1")
80+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.CAMERA" />
6+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
7+
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
8+
9+
<application
10+
android:allowBackup="false"
11+
android:dataExtractionRules="@xml/data_extraction_rules"
12+
android:fullBackupContent="@xml/backup_rules"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
17+
android:theme="@style/Theme.DeepLabV3Demo"
18+
android:extractNativeLibs="true"
19+
tools:targetApi="34">
20+
21+
<activity
22+
android:name=".BirdDetectionActivity"
23+
android:exported="true"
24+
android:screenOrientation="portrait"
25+
android:theme="@style/Theme.DeepLabV3Demo">
26+
<intent-filter>
27+
<action android:name="android.intent.action.MAIN" />
28+
<category android:name="android.intent.category.LAUNCHER" />
29+
</intent-filter>
30+
</activity>
31+
32+
<activity
33+
android:name=".BirdLogActivity"
34+
android:exported="false" />
35+
36+
<uses-native-library
37+
android:name="libcdsprpc.so"
38+
android:required="false" />
39+
</application>
40+
</manifest>

0 commit comments

Comments
 (0)