From c34e7794e641569ba7e83f4c8312bf892e490c33 Mon Sep 17 00:00:00 2001 From: Indra Narayan Dutta Date: Thu, 25 Jul 2024 15:02:58 +0200 Subject: [PATCH 1/4] Build.gradle for linux build environment --- modules/java_api/build.gradle | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/modules/java_api/build.gradle b/modules/java_api/build.gradle index 2520ac234..b82f8a509 100644 --- a/modules/java_api/build.gradle +++ b/modules/java_api/build.gradle @@ -5,7 +5,7 @@ plugins { import org.gradle.internal.os.OperatingSystem println 'Operating system: ' + OperatingSystem.current() -def arch = System.getProperty("os.arch") +def arch = System.getenv('CURRENT_ANDROID_PLATFORM_TYPE') ?: "arm-v8" def ov_arch = arch; println 'CPU architecture: ' + arch @@ -14,7 +14,7 @@ def nativesCPP; def openvinoVersion = "2024.2" def native_resources = [] -def tbb_dir = System.getenv('TBB_DIR') +def tbb_dir = System.getenv('TBB_DIR') ?: "/openvino-android/one-tbb-install/lib/cmake/TBB" if (tbb_dir) { if (new File(tbb_dir + "/../lib/").exists()) { native_resources.add(tbb_dir + "/../lib/"); @@ -34,15 +34,18 @@ if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") { ov_arch = "armhf"; } +def openVinoDir = System.getenv('INTEL_OPENVINO_DIR') ?: "/openvino-android/openvino_install" +println ">>> INTEL_OPENVINO_DIR -> ${openVinoDir}" + if (OperatingSystem.current().isMacOsX()) { nativesCPP = 'macosx-' - native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch + "/Release"); + native_resources.add(openVinoDir + "/runtime/lib/" + ov_arch + "/Release"); } else if (OperatingSystem.current().isLinux()) { nativesCPP = 'linux-' - native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch); + native_resources.add(openVinoDir + "/runtime/lib/" + ov_arch); } else if (OperatingSystem.current().isWindows()) { nativesCPP = 'windows-' - native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/bin/" + ov_arch + "/Release"); + native_resources.add(openVinoDir + "/runtime/bin/" + ov_arch + "/Release"); } else { logger.warn('Unknown operating system!') } @@ -58,6 +61,7 @@ native_resources.each { tree.visit { FileVisitDetails details -> if (!details.file.isDirectory()) { resources_list += details.file.name + "\n" + println ">>> Adding ${details.file.name} to native_resources" } } } @@ -91,4 +95,4 @@ test { systemProperty 'MODELS_PATH', System.getProperty('MODELS_PATH') systemProperty 'device', System.getProperty('device') } -test.onlyIf { project.hasProperty('run_tests') } \ No newline at end of file +test.onlyIf { project.hasProperty('run_tests') } From fc6b8f361d627b7a2479dbb177b9e3d02170aaa0 Mon Sep 17 00:00:00 2001 From: Indra Narayan Dutta Date: Thu, 25 Jul 2024 15:04:24 +0200 Subject: [PATCH 2/4] Using ssd_mobilenet_v1_coco --- .../app/src/main/java/org/intel/openvino/MainActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/android_demos/coco_detection_android_demo/app/src/main/java/org/intel/openvino/MainActivity.java b/modules/android_demos/coco_detection_android_demo/app/src/main/java/org/intel/openvino/MainActivity.java index d15035757..32699513d 100644 --- a/modules/android_demos/coco_detection_android_demo/app/src/main/java/org/intel/openvino/MainActivity.java +++ b/modules/android_demos/coco_detection_android_demo/app/src/main/java/org/intel/openvino/MainActivity.java @@ -52,9 +52,9 @@ public class MainActivity extends CameraActivity implements CvCameraViewListener public static final float CONFIDENCE_THRESHOLD = 0.6F; public static final float NMS_THRESHOLD = 0.6F; public static final String OPENCV_LIBRARY_NAME = "opencv_java4"; - public static final String MODEL_XML = "ssd_mobilenet_v2_coco.xml"; + public static final String MODEL_XML = "ssd_mobilenet_v1_coco.xml"; public static final String COCO_LABELS = "labels.txt"; - public static final String MODEL_BIN = "ssd_mobilenet_v2_coco.bin"; + public static final String MODEL_BIN = "ssd_mobilenet_v1_coco.bin"; public static final String DEVICE_NAME = "CPU"; public static String[] COCO_CLASSES_91; From 9afa53fb971dcce8c51b2abeed51dec5ed96d701 Mon Sep 17 00:00:00 2001 From: Indra Narayan Dutta Date: Wed, 31 Jul 2024 16:52:05 +0200 Subject: [PATCH 3/4] Update modules/java_api/build.gradle Co-authored-by: Anna Likholat --- modules/java_api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/java_api/build.gradle b/modules/java_api/build.gradle index b82f8a509..b99b1f002 100644 --- a/modules/java_api/build.gradle +++ b/modules/java_api/build.gradle @@ -14,7 +14,7 @@ def nativesCPP; def openvinoVersion = "2024.2" def native_resources = [] -def tbb_dir = System.getenv('TBB_DIR') ?: "/openvino-android/one-tbb-install/lib/cmake/TBB" +def tbb_dir = System.getenv('TBB_DIR') ?: System.getenv('OPV_HOME_DIR') + "/one-tbb-install/lib/cmake/TBB" if (tbb_dir) { if (new File(tbb_dir + "/../lib/").exists()) { native_resources.add(tbb_dir + "/../lib/"); From 6d897ac4fd27ae5f1ccbc0741c606c3404c44ba3 Mon Sep 17 00:00:00 2001 From: Indra Narayan Dutta Date: Thu, 1 Aug 2024 12:50:55 +0200 Subject: [PATCH 4/4] Update build.gradle --- modules/java_api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/java_api/build.gradle b/modules/java_api/build.gradle index b99b1f002..fea73c273 100644 --- a/modules/java_api/build.gradle +++ b/modules/java_api/build.gradle @@ -34,7 +34,7 @@ if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") { ov_arch = "armhf"; } -def openVinoDir = System.getenv('INTEL_OPENVINO_DIR') ?: "/openvino-android/openvino_install" +def openVinoDir = System.getenv('INTEL_OPENVINO_DIR') ?: System.getenv('OPV_HOME_DIR') + "/openvino_install" println ">>> INTEL_OPENVINO_DIR -> ${openVinoDir}" if (OperatingSystem.current().isMacOsX()) {