tacsotai / flutter_mediapipe

BSD 3-Clause "New" or "Revised" License
23 stars 8 forks source link

pose detection modification #9

Closed congnguyenthe closed 3 years ago

congnguyenthe commented 3 years ago

Hi,

First of all, thank you for spending time working up and publish this. This is very kind of you. I have tried this and it works great. However, I would like to create another version for pose detection, I have re-compile the aar, copy the tflite and binary graph as you suggest. I also modify the NativeView to set the graph name and output, but when I run it, I got segfault like following:

E/DecorView(25629): mWindow.mActivityCurrentConfig is null                     
I/OpenGLRenderer(25629): onPositionUpdated - left: 0.000000, right: 1080.000000, top: 0.000000, botton: 1836.000000
I/OpenGLRenderer(25629): doUpdatePositionAsync is called and callVoidMethod
D/ExternalTextureConv(25629): Created output texture: 2 width: 720 height: 1280
I/native  (25629): I20210716 11:18:11.265153 29341 graph.cc:474] Start running the graph, waiting for inputs.
I/native  (25629): I20210716 11:18:11.265355 29341 gl_context_egl.cc:163] Successfully initialized EGL. Major : 1 Minor: 4
I/native  (25629): I20210716 11:18:11.266983 29435 gl_context.cc:331] GL version: 3.2 (OpenGL ES 3.2 v1.r19p0-01rel0.###other-sha0123456789ABCDEF0###)
W/diapipe_exampl(25629): 0xebadde09 skipped times: 0         
F/libc    (25629): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 29427 (mediapipe/29427), pid 25629 (diapipe_example)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  
Build fingerprint: 'samsung/starltexx/starlte:10/QP1A.190711.020/G960FXXUFFUE1:user/release-keys'
Revision: '26'                                                                                       
ABI: 'arm64'                                                                                         
Timestamp: 2021-07-16 11:18:11+0700                                                                  
pid: 25629, tid: 29427, name: mediapipe/29427  >>> co.sotai.flutter_mediapipe_example <<<            
uid: 10672                                                                                           
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0             
Cause: null pointer dereference
    x0  0000000000000000  x1  696c66742e6c6c75  x2  67616e616d5f6574  x3  0000000000000002
    x4  0000000000000000  x5  0000006f070b2947  x6  20646c756f63203b  x7  6461657220746f6e
    x8  0101010101010101  x9  0000007fc9a03110  x10 000000000000000b  x11 00000000fffffff5
    x12 0000000000000041  x13 00000000fffffff5  x14 0000006f1f1dc5c2  x15 0000000000000054
    x16 0000006f1f408158  x17 0000007030d22a60  x18 0000006ef829e000  x19 0000006f9b237840
    x20 0000006f9b237860  x21 0000000000000000  x22 0000006f070c0a20  x23 0000000000000020
    x24 0000006f9b238020  x25 0000006f9b237861  x26 0000000000000020  x27 0000006f070bfa00
    x28 5441505f454c4946  x29 0000006f9b2377f0                                                       
    sp  0000006f9b237740  lr  0000006f1eadd8bc  pc  0000007030d22a70
backtrace:                                                                                           
      #00 pc 000000000007fa70  /apex/com.android.runtime/lib64/bionic/libc.so (strlen+16) (BuildId: 3f350ca06c3b80560f65755286daf320)
      #01 pc 00000000005bd8b8  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::PathToResourceAsFile(std::__ndk1::basic_string<char, std::__
ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)+572)  
      #02 pc 00000000004d4c7c  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::LocalFileContentsCalculator::Open(mediapipe::CalculatorConte
xt*)+520)                                                                                            
      #03 pc 00000000009ef7cc  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::CalculatorNode::OpenNode()+840)
      #04 pc 00000000009dd6e0  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::internal::SchedulerQueue::OpenCalculatorNode(mediapipe::Calc
ulatorNode*)+276)                                                                                                                                                                                          
      #05 pc 00000000009dd47c  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::internal::SchedulerQueue::RunNextTask()+220)
      #06 pc 0000000000a10c50  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::ThreadPool::RunWorker()+392)
      #07 pc 0000000000a10894  /data/app/co.sotai.flutter_mediapipe_example-en2_bY7qoV6mAkxsYJl_Cg==/lib/arm64/libmediapipe_jni.so (mediapipe::ThreadPool::WorkerThread::ThreadBody(void*)+1388)
      #08 pc 00000000000e3b24  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 3f350ca06c3b80560f65755286daf320)
      #09 pc 0000000000085330  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 3f350ca06c3b80560f65755286daf320)

Do you have any idea on what is it about and how to fix it? Actually, I can make the sample work with AAR and Java but never try with flutter before.

Thanks

congnguyenthe commented 3 years ago

just find the cause, the tflite model is missing. New version of mediapipe uses a different model name...