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

Selfie segmentation leads to crash flutter app #393

Closed
IraDolynska opened this issue Jan 13, 2023 · 4 comments
Closed

Selfie segmentation leads to crash flutter app #393

IraDolynska opened this issue Jan 13, 2023 · 4 comments
Labels
Selfie Segmentation Issues corresponding to Selfie Segmentation API

Comments

@IraDolynska
Copy link

I am using https://pub.dev/packages/google_mlkit_selfie_segmentation plugin in Flutter app in this way:

 final SelfieSegmenter segmenter =
      SelfieSegmenter(mode: SegmenterMode.single, enableRawSizeMask: false);
 InputImage inputImage = InputImage.fromFile(file);
 SegmentationMask? mask = await segmenter.processImage(inputImage);

The app crashed after segmenter.processImage(inputImage) line with error:

I0000 00:00:1673613739.739530       2 gl_context.cc:352] GL version: 3.0 (OpenGL ES 3.0 Metal - 99)
I0000 00:00:1673613739.741681       2 gl_context.cc:352] GL version: 3.0 (OpenGL ES 3.0 Metal - 99)
I0000 00:00:1673613739.742395       2 gl_context.cc:352] GL version: 3.0 (OpenGL ES 3.0 Metal - 99)
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=2098 MB, unused=0x0)
    frame #0: 0x000000021b4c2928 libsystem_platform.dylib`_platform_memmove + 88
libsystem_platform.dylib`:
->  0x21b4c2928 <+88>:  stnp   q0, q1, [x3]
    0x21b4c292c <+92>:  add    x3, x3, #0x20
    0x21b4c2930 <+96>:  ldnp   q0, q1, [x1]
    0x21b4c2934 <+100>: add    x1, x1, #0x20
Target 0: (Runner) stopped.
Lost connection to device.

This start to reproduce very often after flutter upgrade.
Current Flutter version is 3.3.4.

Are there any changes and improvements planned for this package? Because this is really core feature of my project and now it is working very unstable because of this issue.

@Snehal-Singh174
Copy link

I am facing the same issue, getting the following error:
java.lang.OutOfMemoryError: Failed to allocate a 55380616 byte allocation with 25165824 free bytes and 30MB until OOM, target footprint 261761336, growth limit 268435456
I even tried the stackoverflow solution, but it didn't worked
https://stackoverflow.com/questions/32244851/androidjava-lang-outofmemoryerror-failed-to-allocate-a-23970828-byte-allocatio

@m-salmani78
Copy link

m-salmani78 commented Feb 13, 2023

I am using google_mlkit_pose_detection package and have the same issue.
The only solution I found for it is https://developers.google.com/ml-kit/known-issues
But I don't know how to implement it inside Flutter.

-keep class com.google.mlkit.nl.languageid.internal.LanguageIdentificationJni { *; }

@maciejbrzezinski
Copy link

In my case It was caused with face detection on iOS by Flutter bug, here more info: flutter/flutter#122792

It was repaired, I was testing on master channel and it works fine now

@fbernaly fbernaly added the Selfie Segmentation Issues corresponding to Selfie Segmentation API label Jun 9, 2023
@fbernaly
Copy link
Collaborator

That will be fixed in this PR: #473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Selfie Segmentation Issues corresponding to Selfie Segmentation API
Projects
None yet
Development

No branches or pull requests

5 participants