google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.55k stars 5.16k forks source link

Building AAR leads to unstable Pose Landmark Tracking #4642

Open TarikTaoui opened 1 year ago

TarikTaoui commented 1 year ago

OS Platform and Distribution

Linux Ubuntu 20.04

Compiler version

gcc/g++ 9.4.0

Programming Language and version

C++

Installed using virtualenv? pip? Conda?(if python)

No response

MediaPipe version

0.8.9

Bazel version

5.2.0

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

ndk 21

Android AAR (if android)

Yes

OpenCV version (if running on desktop)

3.4.10

Describe the problem

I am trying to implement Pose Landmark Tracking in my Android app. The problem is when i use an AAR file I found in github, it works fine, but when I generate my own AAR and integrate it into the Android app, it works but it gives a lot of false detections (even when faced to a wall it detects landmarks).

I followed the "getting started" guide to generate my AAR, but i am not sure if I am doing something wrong.

Complete Logs

bazel build -c opt --strip=ALWAYS     --host_crosstool_top=@bazel_tools//tools/cpp:toolchain     --fat_apk_cpu=arm64-v8a,armeabi-v7a     --legacy_whole_archive=0     --features=-legacy_whole_archive     --copt=-fvisibility=hidden     --copt=-ffunction-sections     --copt=-fdata-sections     --copt=-fstack-protector     --copt=-Oz     --copt=-fomit-frame-pointer     --copt=-DABSL_MIN_LOG_LEVEL=2     --linkopt=-Wl,--gc-sections,--strip-all     //mediapipe/examples/android/src/java/com/google/mediapipe/apps/poseheadtracking:pose_head_tracking.aar

This is the command I use for my own custom solution, but i tried with the existing Pose Landmark Tracking solution provided with mediapipe and it leads to the same problem.
kuaashish commented 1 year ago

@TarikTaoui,

Thank you for bringing out again to our notice. This issue is already known to us. We will let you know once any update becomes available from our end.

TarikTaoui commented 1 year ago

Hello @kuaashish,

Thank you for your response.

Is there any old version of Ubuntu, Bazel and Mediapipe that should produce a stable AAR file ?

TarikTaoui commented 1 year ago

Hello @jiuqiant @kuaashish Like i requested in my previous response, is there any old version of Ubuntu, Bazel and Mediapipe that should produce a stable AAR file ? Would Appreciate to hear from you as soon as possible and thank you for your time.

kuaashish commented 9 months ago

Hi @TarikTaoui,

Could you please confirm if you still require assistance with this matter? If so, we would like to inform you that AAR solutions for app development are no longer under maintenance, and we anticipate that the reported issue will not be resolved.

Instead, we recommend utilizing our new Face Detection Task API. This API is an enhanced version of our legacy Face Detection Solution. Further details can be found here.

Furthermore, please refer to the associated Overview documentation and implementation instructions for Android on this page.

Should you encounter any challenges during the implementation process, we kindly request you to report them to us promptly for further assistance.

Thank you!

TarikTaoui commented 9 months ago

Since the AAR solution is no longer maintained, is it still possible to create custom graphs and use them in an Android app using the Task API ? Since my goal is to build upon the graphs that you provide and not use them as they are.