Skip to content

Commit 426184d

Browse files
committed
init
0 parents  commit 426184d

Some content is hidden

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

43 files changed

+2271
-0
lines changed

.gitignore

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Built application files
2+
*.apk
3+
*.aar
4+
*.ap_
5+
*.aab
6+
7+
# Files for the ART/Dalvik VM
8+
*.dex
9+
10+
# Java class files
11+
*.class
12+
13+
# Generated files
14+
bin/
15+
gen/
16+
out/
17+
# Uncomment the following line in case you need and you don't have the release build type files in your app
18+
# release/
19+
20+
# Gradle files
21+
.gradle/
22+
build/
23+
24+
# Local configuration file (sdk path, etc)
25+
local.properties
26+
27+
# Proguard folder generated by Eclipse
28+
proguard/
29+
30+
# Log Files
31+
*.log
32+
33+
# Android Studio Navigation editor temp files
34+
.navigation/
35+
36+
# Android Studio captures folder
37+
captures/
38+
39+
# IntelliJ
40+
*.iml
41+
.idea/workspace.xml
42+
.idea/tasks.xml
43+
.idea/gradle.xml
44+
.idea/assetWizardSettings.xml
45+
.idea/dictionaries
46+
.idea/libraries
47+
# Android Studio 3 in .gitignore file.
48+
.idea/caches
49+
.idea/modules.xml
50+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
51+
.idea/navEditor.xml
52+
53+
# Keystore files
54+
# Uncomment the following lines if you do not want to check your keystore files in.
55+
#*.jks
56+
#*.keystore
57+
58+
# External native build folder generated in Android Studio 2.2 and later
59+
.externalNativeBuild
60+
.cxx/
61+
62+
# Google Services (e.g. APIs or Firebase)
63+
# google-services.json
64+
65+
# Freeline
66+
freeline.py
67+
freeline/
68+
freeline_project_description.json
69+
70+
# fastlane
71+
fastlane/report.xml
72+
fastlane/Preview.html
73+
fastlane/screenshots
74+
fastlane/test_output
75+
fastlane/readme.md
76+
77+
# Version control
78+
vcs.xml
79+
80+
# lint
81+
lint/intermediates/
82+
lint/generated/
83+
lint/outputs/
84+
lint/tmp/
85+
# lint/reports/

.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-kapt'
4+
apply plugin: 'kotlin-android-extensions'
5+
6+
android {
7+
compileSdkVersion 29
8+
buildToolsVersion "29.0.2"
9+
defaultConfig {
10+
applicationId "com.say.pytorchkotlindemo"
11+
minSdkVersion 21
12+
targetSdkVersion 29
13+
versionCode 1
14+
versionName "1.0"
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
30+
kotlinOptions {
31+
jvmTarget = JavaVersion.VERSION_1_8.toString()
32+
}
33+
34+
dataBinding{
35+
enabled=true
36+
}
37+
}
38+
39+
dependencies {
40+
def lifecycle_version = "2.2.0"
41+
def activity_version = "1.1.0"
42+
def arch_core_version = "2.1.0"
43+
def core_ktx_version = "1.1.0"
44+
def dexter_version = "6.0.2"
45+
def pytorch_version = "1.4.0"
46+
47+
implementation fileTree(dir: 'libs', include: ['*.jar'])
48+
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
49+
implementation 'androidx.appcompat:appcompat:1.1.0'
50+
implementation 'androidx.core:core-ktx:1.1.0'
51+
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
52+
testImplementation 'junit:junit:4.12'
53+
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
54+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
55+
implementation "com.karumi:dexter:$dexter_version"
56+
//core
57+
implementation "androidx.core:core-ktx:$core_ktx_version"
58+
// ViewModel
59+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
60+
// LiveData
61+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
62+
// activity
63+
implementation "androidx.activity:activity-ktx:$activity_version"
64+
// runtime
65+
implementation "androidx.arch.core:core-runtime:$arch_core_version"
66+
67+
implementation "org.pytorch:pytorch_android:$pytorch_version"
68+
implementation "org.pytorch:pytorch_android_torchvision:$pytorch_version"
69+
}

app/proguard-rules.pro

+21
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.say.pytorchkotlindemo
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.say.pytorchkotlindemo", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.say.pytorchkotlindemo">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/AppTheme">
12+
<activity android:name=".MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>

app/src/main/assets/model_1.pt

44.7 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.say.pytorchkotlindemo
2+
3+
class AnalysisResult(
4+
val topNClassNames: Array<String>,
5+
val topNScores: FloatArray,
6+
val moduleForwardDuration: Long,
7+
val analysisDuration: Long
8+
)

0 commit comments

Comments
 (0)