-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbuild.gradle
64 lines (55 loc) · 2.55 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
plugins {
id 'com.android.application'
}
android {
compileSdk Integer.valueOf(androidCompileSDK)
defaultConfig {
applicationId "com.quicinc.imageclassification"
minSdk Integer.valueOf(androidMinSDK)
targetSdk Integer.valueOf(androidTargetSDK)
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue( "string", "tfLiteModelAsset", project.properties['classification_tfLiteModelAsset'])
resValue( "string", "tfLiteLabelsAsset", project.properties["classification_tfLiteLabelsAsset"])
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.valueOf("VERSION_$javaSourceCompatibilityVersion")
targetCompatibility JavaVersion.valueOf("VERSION_$javaTargetCompatibilityVersion")
}
preBuild.doFirst {
if (!file("./src/main/assets/" + project.properties["classification_tfLiteModelAsset"]).exists()) {
throw new RuntimeException(missingModelErrorMsg)
}
for (int i = 1; i <= 3; ++i) {
String filename = "./src/main/assets/images/Sample${i}.png"
File fp = file(filename)
// If the image is too small, it is likely an ascii file with LFS information
if (!fp.exists() || fp.length() < 1000) {
throw new RuntimeException(missingLfsErrorMsg)
}
}
}
namespace 'com.quicinc.imageclassification'
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
api 'org.tensorflow:tensorflow-lite:2.16.1'
api 'org.tensorflow:tensorflow-lite-support:0.4.4'
implementation 'org.tensorflow:tensorflow-lite-gpu:2.16.1'
implementation 'org.tensorflow:tensorflow-lite-gpu-api:2.16.1'
implementation 'org.tensorflow:tensorflow-lite-gpu-delegate-plugin:0.4.4'
implementation "com.qualcomm.qti:qnn-runtime:$qnnVersion"
implementation "com.qualcomm.qti:qnn-litert-delegate:$qnnVersion"
}
if (System.getProperty("user.dir") != project.rootDir.path) {
throw new RuntimeException("This project should be opened from the `android` directory (parent of ImageClassification directory), NOT the ImageClassification directory.")
}