From f94a41e3c98ff9d7dfff13a7ad408d5e626d20b1 Mon Sep 17 00:00:00 2001 From: Jagadeesh J Date: Tue, 20 Dec 2022 11:40:38 +0530 Subject: [PATCH 1/2] fix/Objectdetection-App Signed-off-by: Jagadeesh J --- ObjectDetection/app/build.gradle | 11 +++++++++-- ObjectDetection/app/src/main/AndroidManifest.xml | 3 ++- ObjectDetection/build.gradle | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ObjectDetection/app/build.gradle b/ObjectDetection/app/build.gradle index 80ed949f..32c73ab1 100644 --- a/ObjectDetection/app/build.gradle +++ b/ObjectDetection/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 30 + compileSdkVersion 33 buildToolsVersion "30.0.2" defaultConfig { applicationId "org.pytorch.demo.objectdetection" minSdkVersion 28 - targetSdkVersion 30 + targetSdkVersion 33 versionCode 1 versionName "1.0" @@ -37,6 +37,13 @@ dependencies { implementation "androidx.camera:camera-core:$camerax_version" implementation "androidx.camera:camera-camera2:$camerax_version" + implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3' + implementation 'org.pytorch:pytorch_android_lite:1.10.0' implementation 'org.pytorch:pytorch_android_torchvision_lite:1.10.0' + + // Uncomment below lines for using libs built from src + // implementation(name:'pytorch_android-release', ext:'aar') + // implementation(name:'pytorch_android_torchvision-release', ext:'aar') + } \ No newline at end of file diff --git a/ObjectDetection/app/src/main/AndroidManifest.xml b/ObjectDetection/app/src/main/AndroidManifest.xml index b2a531ca..dea27873 100644 --- a/ObjectDetection/app/src/main/AndroidManifest.xml +++ b/ObjectDetection/app/src/main/AndroidManifest.xml @@ -14,7 +14,8 @@ android:theme="@style/AppTheme"> + android:screenOrientation="portrait" + android:exported="true"> diff --git a/ObjectDetection/build.gradle b/ObjectDetection/build.gradle index 6754c23d..ed52541d 100644 --- a/ObjectDetection/build.gradle +++ b/ObjectDetection/build.gradle @@ -16,6 +16,9 @@ allprojects { repositories { google() jcenter() + flatDir { + dirs 'libs' + } } } From 30e1e315038d983764165ee777edb6383a4322b8 Mon Sep 17 00:00:00 2001 From: Jagadeesh J Date: Mon, 30 Jan 2023 08:08:01 +0530 Subject: [PATCH 2/2] change pt version Signed-off-by: Jagadeesh J --- ObjectDetection/README.md | 8 ++++---- ObjectDetection/app/build.gradle | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ObjectDetection/README.md b/ObjectDetection/README.md index c17be305..87d09412 100644 --- a/ObjectDetection/README.md +++ b/ObjectDetection/README.md @@ -8,9 +8,9 @@ ## Prerequisites -* PyTorch 1.10.0 and torchvision 0.11.1 (Optional) +* PyTorch 1.13.0 and torchvision 0.14.1 (Optional) * Python 3.8 (Optional) -* Android Pytorch library pytorch_android_lite:1.10.0, pytorch_android_torchvision_lite:1.10.0 +* Android Pytorch library pytorch_android_lite:1.13.0, pytorch_android_torchvision_lite:1.13.0 * Android Studio 4.0.1 or later ## Quick Start @@ -52,8 +52,8 @@ Note that small sized version of the YOLOv5 model, which runs faster but with le Start Android Studio, then open the project located in `android-demo-app/ObjectDetection`. 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' ``` ### 3. Run the app diff --git a/ObjectDetection/app/build.gradle b/ObjectDetection/app/build.gradle index 32c73ab1..37d177c4 100644 --- a/ObjectDetection/app/build.gradle +++ b/ObjectDetection/app/build.gradle @@ -39,8 +39,8 @@ dependencies { implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3' - 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 built from src // implementation(name:'pytorch_android-release', ext:'aar')