Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

fix/Imagesegmentation-App #289

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions ImageSegmentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 12 additions & 4 deletions ImageSegmentation/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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')

}
3 changes: 2 additions & 1 deletion ImageSegmentation/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="org.pytorch.imagesegmentation.MainActivity">
<activity android:name="org.pytorch.imagesegmentation.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
3 changes: 3 additions & 0 deletions ImageSegmentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}

Expand Down