diff --git a/ImageSegmentation/README.md b/ImageSegmentation/README.md index 517f73e8..41e24043 100644 --- a/ImageSegmentation/README.md +++ b/ImageSegmentation/README.md @@ -34,8 +34,8 @@ The Python script `deeplabv3.py` is used to generate the TorchScript-formatted m Open the ImageSegmentation project using Android Studio. Note the app's `build.gradle` file has the following lines: ``` -implementation 'org.pytorch:pytorch_android_lite:1.10.0' -implementation 'org.pytorch:pytorch_android_torchvision_lite:1.10.0' +implementation 'org.pytorch:pytorch_android_lite:1.13.0' +implementation 'org.pytorch:pytorch_android_torchvision_lite:1.13.0' ``` and in the MainActivity.java, the code below is used to load the model: diff --git a/ImageSegmentation/app/build.gradle b/ImageSegmentation/app/build.gradle index 8a38847f..7882cfae 100644 --- a/ImageSegmentation/app/build.gradle +++ b/ImageSegmentation/app/build.gradle @@ -8,13 +8,13 @@ repositories { android { - compileSdkVersion 30 + compileSdkVersion 33 buildToolsVersion "30.0.2" defaultConfig { applicationId "org.pytorch.demo.imagesegmentation" minSdkVersion 28 - targetSdkVersion 30 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -32,9 +32,17 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.2' testImplementation 'junit:junit:4.12' + + implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' - implementation 'org.pytorch:pytorch_android_lite:1.10.0' - implementation 'org.pytorch:pytorch_android_torchvision_lite:1.10.0' + implementation 'org.pytorch:pytorch_android_lite:1.13.0' + implementation 'org.pytorch:pytorch_android_torchvision_lite:1.13.0' + + // Uncomment below lines for using libs from src build + // implementation(name:'pytorch_android-release', ext:'aar') + // implementation(name:'pytorch_android_torchvision-release', ext:'aar') + } \ No newline at end of file diff --git a/ImageSegmentation/app/src/main/AndroidManifest.xml b/ImageSegmentation/app/src/main/AndroidManifest.xml index 31ac6752..ded23a2c 100644 --- a/ImageSegmentation/app/src/main/AndroidManifest.xml +++ b/ImageSegmentation/app/src/main/AndroidManifest.xml @@ -9,7 +9,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/ImageSegmentation/build.gradle b/ImageSegmentation/build.gradle index 6754c23d..ed52541d 100644 --- a/ImageSegmentation/build.gradle +++ b/ImageSegmentation/build.gradle @@ -16,6 +16,9 @@ allprojects { repositories { google() jcenter() + flatDir { + dirs 'libs' + } } }