mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Face Dectection(Mediapipe) crash on latest version of android devices(14) on line FaceDetector.createFromOptions(context, options).

Open AkmalAfzal opened this issue 1 year ago • 3 comments

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

windows 11

Mobile device if the issue happens on mobile device

s23 ultra

Browser and version if the issue happens on browser

No response

Programming Language and version

kotlin

MediaPipe version

0.20230731

Bazel version

No response

Solution

Need solution

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

App crashes when activity start and start compile FaceDetector.createFromOptions this line of code

Describe the expected behaviour

As like all other devices perform well i expect this for arm64-v8a devices too

Standalone code/steps you may have used to try to get what you need

private fun setupFaceDetector() {
    
//        if(System.getProperty("os.arch")?.equals("x86_64") == true) return
        val baseOptionsBuilder = BaseOptions.builder()
        baseOptionsBuilder.setModelAssetPath("face_detection_short_range.tflite")
     
        val baseOptions = baseOptionsBuilder.build()

        try {
            val optionsBuilder =
                FaceDetector.FaceDetectorOptions.builder()
                    .setBaseOptions(baseOptions)
                    .setMinDetectionConfidence(THRESHOLD_DEFAULT)
                    .setRunningMode(RunningMode.IMAGE)

            val options = optionsBuilder.build()
            faceDetector = FaceDetector.createFromOptions(context, options)

          

        } catch (e: Exception) {
            Log.e(TAG, "TFLite failed to load model with error: " + e.message)
        }
    }

Other info / Complete Logs

i test on samsung codelab and device name is s23Ultra

AkmalAfzal avatar Dec 27 '23 09:12 AkmalAfzal

Do you have any logs for us? Does this crash only occur on the latest version of MediaPipe?

schmidt-sebastian avatar Jan 02 '24 02:01 schmidt-sebastian

There is also https://github.com/google/mediapipe/issues/5039, I wonder if you are hitting the same issue.

schmidt-sebastian avatar Jan 02 '24 02:01 schmidt-sebastian

yes this issue occurs on latest version of MediaPipe. I test my app on samsung remote lab test device so log list is very long and i am unable get the exact log.

AkmalAfzal avatar Jan 03 '24 10:01 AkmalAfzal

Hello.

I had the same issue with an Android S23 but managed to resolve it by using the latest version of Mediapipe (0.10.10)!

victorchacn avatar Feb 27 '24 12:02 victorchacn

Yes i resolved it by using this version. Thanks

AkmalAfzal avatar Mar 19 '24 05:03 AkmalAfzal

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Mar 19 '24 05:03 google-ml-butler[bot]