openvino_contrib icon indicating copy to clipboard operation
openvino_contrib copied to clipboard

[java_api] Android demo application for ARM CPUs

Open IRONICBo opened this issue 3 years ago • 6 comments

This is the Android demo application using arm_plugin to reach inference engine.

Using object detection model and recognition model to locate and recognize attributes of detected vehicles.

IRONICBo avatar Jun 25 '22 22:06 IRONICBo

Running result.

openvino_demo (3)

IRONICBo avatar Jul 15 '22 07:07 IRONICBo

@IRONICBo hello. If you use arm plugin as base plugin in your example. Please move the example to arm plugin directory.

allnes avatar Jul 16 '22 17:07 allnes

@IRONICBo hello. If you use arm plugin as base plugin in your example. Please move the example to arm plugin directory.

OK, I have changed them. :)

IRONICBo avatar Jul 18 '22 01:07 IRONICBo

@IRONICBo please upgrade source code and dependencies to OpenVINO 2022.1 and use OpenVINO Java API 2.0

likholat avatar Aug 18 '22 09:08 likholat

Please find demo for java api 2.0 this

allnes avatar Aug 23 '22 16:08 allnes

OK,I will do that :)

IRONICBo avatar Aug 30 '22 01:08 IRONICBo

New result. image

IRONICBo avatar Sep 06 '22 15:09 IRONICBo

Refer to https://github.com/openvinotoolkit/openvino_contrib/issues/420 and https://github.com/openvinotoolkit/openvino_contrib/pull/422, API update process is still in progress.

IRONICBo avatar Sep 06 '22 15:09 IRONICBo

Update to Java API 2.0

image

IRONICBo avatar Sep 08 '22 13:09 IRONICBo

Update to Java API 2.0

image

Could you share demo's video :)

allnes avatar Sep 08 '22 13:09 allnes

Update to Java API 2.0 image

Could you share demo's video :)

OK, I have upload a GIF. result3

2022-9-14

IRONICBo avatar Sep 08 '22 16:09 IRONICBo

Hello, this check pipeline openvino_contrib-android-arm64 failed, the error message is not clear, how can I solve it? image

IRONICBo avatar Sep 10 '22 23:09 IRONICBo

Hello, this check pipeline openvino_contrib-android-arm64 failed, the error message is not clear, how can I solve it?

@IRONICBo, full error message below. I think it's unrelated to this PR.

FAILED: src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o 
/agent/_work/1/_w/android_tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android29 --gcc-toolchain=/agent/_work/1/_w/android_tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/agent/_work/1/_w/android_tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DIE_BUILD_POSTFIX=\"\" -DPROJECT_ROOT_DIR=\"/agent/_work/1/openvino/src\" -I/agent/_work/1/openvino/src/common/legacy/include -I/agent/_work/1/openvino/src/common/legacy/src -I/agent/_work/1/openvino/src/inference/src -I/agent/_work/1/openvino/src/common/transformations/include -I/agent/_work/1/openvino/src/core/dev_api -I/agent/_work/1/openvino/src/inference/dev_api -I/agent/_work/1/openvino/src/common/low_precision_transformations/include -I/agent/_work/1/openvino/src/common/preprocessing -I/agent/_work/1/openvino/src/core/include -I/agent/_work/1/openvino/src/frontends/common/include -I/agent/_work/1/openvino/src/inference/include -I/agent/_work/1/openvino/src/inference/include/ie -I/agent/_work/1/openvino/src/common/itt/include -I/agent/_work/1/openvino/src/common/util/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fsigned-char -ffunction-sections -fdata-sections -fdiagnostics-show-option -Wundef -Wreturn-type -Wunused-variable -Wuninitialized -Winit-self -Winconsistent-missing-override -Wstring-plus-int -O2 -DNDEBUG   -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -MD -MT src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o -MF src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o.d -o src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o -c /agent/_work/1/openvino/src/common/legacy/src/network_serializer_v7.cpp
In file included from /agent/_work/1/openvino/src/common/legacy/src/network_serializer_v7.cpp:17:
/agent/_work/1/openvino/src/inference/dev_api/xml_parse_utils.h:15:10: fatal error: 'pugixml.hpp' file not found
#include <pugixml.hpp>
         ^~~~~~~~~~~~~

dkurt avatar Sep 12 '22 07:09 dkurt

Please remove .png file modules/arm_plugin/demos/coco_detection_android_demo/app/src/main/res/drawable/openvino_icon.png. It's better not to add binaries in source code.

dkurt avatar Sep 12 '22 07:09 dkurt

Is modules/arm_plugin/demos/coco_detection_android_demo/gradle/wrapper/gradle-wrapper.jar a required file or can be generated by SDK?

dkurt avatar Sep 12 '22 07:09 dkurt

Hello, this check pipeline openvino_contrib-android-arm64 failed, the error message is not clear, how can I solve it?

@IRONICBo, full error message below. I think it's unrelated to this PR.

FAILED: src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o 
/agent/_work/1/_w/android_tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android29 --gcc-toolchain=/agent/_work/1/_w/android_tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/agent/_work/1/_w/android_tools/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DIE_BUILD_POSTFIX=\"\" -DPROJECT_ROOT_DIR=\"/agent/_work/1/openvino/src\" -I/agent/_work/1/openvino/src/common/legacy/include -I/agent/_work/1/openvino/src/common/legacy/src -I/agent/_work/1/openvino/src/inference/src -I/agent/_work/1/openvino/src/common/transformations/include -I/agent/_work/1/openvino/src/core/dev_api -I/agent/_work/1/openvino/src/inference/dev_api -I/agent/_work/1/openvino/src/common/low_precision_transformations/include -I/agent/_work/1/openvino/src/common/preprocessing -I/agent/_work/1/openvino/src/core/include -I/agent/_work/1/openvino/src/frontends/common/include -I/agent/_work/1/openvino/src/inference/include -I/agent/_work/1/openvino/src/inference/include/ie -I/agent/_work/1/openvino/src/common/itt/include -I/agent/_work/1/openvino/src/common/util/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fsigned-char -ffunction-sections -fdata-sections -fdiagnostics-show-option -Wundef -Wreturn-type -Wunused-variable -Wuninitialized -Winit-self -Winconsistent-missing-override -Wstring-plus-int -O2 -DNDEBUG   -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++11 -MD -MT src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o -MF src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o.d -o src/common/legacy/CMakeFiles/inference_engine_legacy_obj.dir/src/network_serializer_v7.cpp.o -c /agent/_work/1/openvino/src/common/legacy/src/network_serializer_v7.cpp
In file included from /agent/_work/1/openvino/src/common/legacy/src/network_serializer_v7.cpp:17:
/agent/_work/1/openvino/src/inference/dev_api/xml_parse_utils.h:15:10: fatal error: 'pugixml.hpp' file not found
#include <pugixml.hpp>
         ^~~~~~~~~~~~~

OK, thanks :)

IRONICBo avatar Sep 12 '22 08:09 IRONICBo

Please remove .png file modules/arm_plugin/demos/coco_detection_android_demo/app/src/main/res/drawable/openvino_icon.png. It's better not to add binaries in source code.

OK, I have done it. :)

IRONICBo avatar Sep 12 '22 09:09 IRONICBo

Is modules/arm_plugin/demos/coco_detection_android_demo/gradle/wrapper/gradle-wrapper.jar a required file or can be generated by SDK?

These gradle configuration files are used to unify the configuration of gradle. Removing the .jar file will prevent the execution of the gradle-wrapper command. But I removed the configuration about gradle-wrapper in the new commit, these can be generated by the IDE, only the environment needs to be configured with gradle.

IRONICBo avatar Sep 12 '22 09:09 IRONICBo

@IRONICBo, please edit PR title to something like "[ARM plugin] GSoC 2022: Android demo application for ARM CPUs".

dkurt avatar Sep 13 '22 12:09 dkurt

@IRONICBo, please edit PR title to something like "[ARM plugin] GSoC 2022: Android demo application for ARM CPUs".

OK, got it! :)

IRONICBo avatar Sep 13 '22 15:09 IRONICBo

Please fix code style warning: https://github.com/openvinotoolkit/openvino_contrib/actions/runs/3037037332 (download patch from artifacts section)

dkurt avatar Sep 14 '22 07:09 dkurt

Please fix code style warning: https://github.com/openvinotoolkit/openvino_contrib/actions/runs/3037037332 (download patch from artifacts section)

Ok, I didn't find a log from the previous code style check that solves this problem. I've done the changes in the new commit.

IRONICBo avatar Sep 14 '22 07:09 IRONICBo

Thanks, now that the code style check has been passed. :)

image

IRONICBo avatar Sep 14 '22 08:09 IRONICBo

@alvoron, @ilya-lavrenov, please prioritize this PR as this is a part of student's Google Summer Of Code challenge.

dkurt avatar Sep 14 '22 14:09 dkurt

Thanks! :)

IRONICBo avatar Sep 15 '22 10:09 IRONICBo

may I know what is ARM specific in this demo? Why is it not a Java API demo?

ilya-lavrenov avatar Sep 15 '22 20:09 ilya-lavrenov

may I know what is ARM specific in this demo? Why is it not a Java API demo?

This is an demo of running OpenVINO API 2.0 with ARM plugin on ARM CPUs Android(arm64-v8a). On Android, I need to use Java API 2.0 wrappers to get the inference engine.

And the suggestions are from allnes https://github.com/openvinotoolkit/openvino_contrib/pull/382#issuecomment-1186250920 and Adrian

IRONICBo avatar Sep 16 '22 00:09 IRONICBo

blog link: https://medium.com/openvino-toolkit/object-detection-demo-on-coco-dataset-using-openvino-toolkit-java-api-2-0-with-arm-plugin-28ce1f44bb80

IRONICBo avatar Sep 16 '22 03:09 IRONICBo

Hello, I can not reach these links, what should I do to solve these checks? image

IRONICBo avatar Sep 28 '22 01:09 IRONICBo

Hi @IRONICBo The pre-commit check build_ubuntu20_release has been failed because of internal infrastructure issue. I've already contacted with dev team, they will fix the issue shortly and restart the check.

I also see that your branch is out of date. Could you please update it and merge the latest changes from master?

alvoron avatar Sep 28 '22 08:09 alvoron