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

fix/Objectdetection-App #291

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
8 changes: 4 additions & 4 deletions ObjectDetection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions ObjectDetection/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -37,6 +37,13 @@ dependencies {
implementation "androidx.camera:camera-core:$camerax_version"
implementation "androidx.camera:camera-camera2:$camerax_version"

implementation 'org.pytorch:pytorch_android_lite:1.10.0'
implementation 'org.pytorch:pytorch_android_torchvision_lite:1.10.0'
implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3'

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')
// implementation(name:'pytorch_android_torchvision-release', ext:'aar')

}
3 changes: 2 additions & 1 deletion ObjectDetection/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:configChanges="orientation"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
3 changes: 3 additions & 0 deletions ObjectDetection/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