Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS application struck(crashes), when using TensorFlowLiteSwift and MediaPipeTasksVision together #340

Open
umartariq247 opened this issue Mar 15, 2024 · 0 comments

Comments

@umartariq247
Copy link

Few weeks ago, I faced an issue of duplicate symbols in my iOS application when using TensorFlowLiteSwift and MediaPipeTasksVision together and application couldn't build but after the release of version 0.10.10, the duplicate symbols issue resolved but now when i intialize mediapipe in my application

static func liveStreamGestureRecognizerService(
    modelPath: String?,
    minHandDetectionConfidence: Float,
    minHandPresenceConfidence: Float,
    minTrackingConfidence: Float,
    liveStreamDelegate: GestureRecognizerServiceLiveStreamDelegate?) -> GestureRecognizerService? {
      let gestureRecognizerService = GestureRecognizerService(
        modelPath: modelPath,
        runningMode: .liveStream,
        minHandDetectionConfidence: minHandDetectionConfidence,
        minHandPresenceConfidence: minHandPresenceConfidence,
        minTrackingConfidence: minTrackingConfidence)
      gestureRecognizerService?.liveStreamDelegate = liveStreamDelegate

      return gestureRecognizerService
    }

My application hangs, I removed TensorFlowLiteSwift from podfile and then build application again, Mediapipe runs successfully. This is output I am receiving when application crashes

W0000 00:00:1710464977.511861  313262 gesture_recognizer_graph.cc:129] Hand Gesture Recognizer contains CPU only ops. Sets HandGestureRecognizerGraph acceleration to Xnnpack.
I0000 00:00:1710464977.540596  313262 hand_gesture_recognizer_graph.cc:250] Custom gesture classifier is not defined.
Thread Performance Checker: -[AVCaptureSession startRunning] should be called from background thread. Calling it on the main thread can lead to UI unresponsiveness
PID: 2578, TID: 312431
Backtrace
=================================================================
3   hgid                                0x000000010457cb48 $s4hgid20CameraViewControllerC05setupB033_2970083884695F337CDCB6A0B28447A6LL8positionySo23AVCaptureDevicePositionV_tFyyScMYccfU_ + 1796
4   hgid                                0x000000010457beb8 $sIegh_IeyBh_TRTm + 28
5   libdispatch.dylib                   0x000000010808bf08 _dispatch_call_block_and_release + 24
6   libdispatch.dylib                   0x000000010808d7a0 _dispatch_client_callout + 16
7   libdispatch.dylib                   0x000000010809c34c _dispatch_main_queue_drain + 920
8   libdispatch.dylib                   0x000000010809bfa4 _dispatch_main_queue_callback_4CF + 40
9   CoreFoundation                      0x00000001b318d9ac 8ED7639C-5070-3A5D-9ED8-599199E62B93 + 596396
10  CoreFoundation                      0x00000001b3171648 8ED7639C-5070-3A5D-9ED8-599199E62B93 + 480840
11  CoreFoundation                      0x00000001b3175d20 CFRunLoopRunSpecific + 584
12  GraphicsServices                    0x00000001eb241998 GSEventRunModal + 160
13  UIKitCore                           0x00000001b540880c A2226BA1-B58E-377D-BEF8-D69D8B81E53B + 3610636
14  UIKitCore                           0x00000001b5408484 UIApplicationMain + 312
15  hgid                                0x0000000104578630 main + 80
16  dyld                                0x00000001d092c344 AFB645B3-5CD0-3C02-88DE-A05D0B57177C + 82756
2024-03-15 06:09:38.193128+0500 hgid[2578:313262] Metal GPU Frame Capture Enabled
2024-03-15 06:09:38.195926+0500 hgid[2578:313262] Metal API Validation Enabled
I0000 00:00:1710464978.791932  313262 gl_context.cc:357] GL version: 3.0 (OpenGL ES 3.0 Metal - 99), renderer: Apple A11 GPU
2024-03-15 06:09:38.795479+0500 hgid[2578:313331] Initialized TensorFlow Lite runtime.
INFO: Initialized TensorFlow Lite runtime.
2024-03-15 06:09:38.802634+0500 hgid[2578:313331] Created TensorFlow Lite XNNPACK delegate for CPU.
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.

Please guide me as It is important for me to use both mediapipe and tflite. I have attached screenshot as well of logs

Screenshot 2024-03-15 at 6 56 05 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant