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

face detection error face image in only android #684

Open
GeonSeon opened this issue Sep 26, 2024 · 15 comments
Open

face detection error face image in only android #684

GeonSeon opened this issue Sep 26, 2024 · 15 comments
Labels
Face Detection Issues corresponding to Face Detection API

Comments

@GeonSeon
Copy link

Describe your issue. If applicable, add screenshots to help explain your problem.

processImage function error only android
packge version
google_mlkit_face_detection: ^0.11.1
google_mlkit_commons: 0.8.1

but packge version
google_mlkit_face_detection: ^0.11.0
google_mlkit_commons: 0.7.1

works fine without any problems.

Everything goes well regardless of the ios.

Steps to reproduce.

E/ImageError( 9584): Getting Image failed
E/ImageError( 9584): java.lang.IllegalArgumentException
D/Camera2CameraImpl( 9584): {Camera@253ad19[id=1]} Use case androidx.camera.core.ImageAnalysis-4940151d-7719-4cfd-92ba-a8973df00dcd49725171 INACTIVE
D/UseCaseAttachState( 9584): Active and attached use case: [androidx.camera.core.ImageCapture-2bdca64f-a070-4134-b383-ac7893b44085251716653, androidx.camera.core.Preview-1bc41ef1-bfb2-4253-b08b-9f9048b183f1235416022] for camera: 1
E/flutter ( 9584): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
E/flutter ( 9584): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
E/flutter ( 9584): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter ( 9584):
E/flutter ( 9584): #2 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:520:35)
E/flutter ( 9584):
E/flutter ( 9584): #3 FaceDetector.processImage (package:google_mlkit_face_detection/src/face_detector.dart:23:20)
E/flutter ( 9584):

What is the expected result?

Face detection should be done.

Did you try our example app?

Yes

Is it reproducible in the example app?

Yes

Reproducible in which OS?

Android

Flutter/Dart Version?

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (4 available)

[✓] Network resources

• No issues found!

Plugin Version?

Android
google_mlkit_face_detection: ^0.11.0
google_mlkit_commons: 0.7.1

IOS
google_mlkit_face_detection: ^0.11.1
google_mlkit_commons: 0.8.1

@bilalali1
Copy link

It occurs with my code too. I even updated the google_mlkit_face_detection version to 0.11.1, but still no luck

@bilalali1
Copy link

@fbernaly @bharat-biradar

@jihuncha
Copy link

is same at google_mlkit_barcode_scanning package too. is there any solution??

@bilalali1
Copy link

@jihuncha since when you faced this issue?

@jihuncha
Copy link

jihuncha commented Sep 27, 2024

@bilalali1 today. I fixed downgrade version 0.11.0 and downgrade camera plugin version to 0.10.6 and it works fine.

@wantroba
Copy link

wantroba commented Oct 2, 2024

Similar problem here:

I/flutter ( 8867): PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
I/flutter ( 8867): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
I/flutter ( 8867): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
I/flutter ( 8867):
I/flutter ( 8867): #2 TextRecognizer.processImage (package:google_mlkit_text_recognition/src/text_recognizer.dart:23:20)
I/flutter ( 8867):

But I'm using Text Recognition:
camera: ^0.11.0+2
google_mlkit_text_recognition: ^0.13.1

@pvlKryu
Copy link

pvlKryu commented Oct 9, 2024

Working Configuration:

  google_mlkit_face_detection: 0.11.0
  camera: 0.11.0+2
  camera_android_camerax: 0.6.7+2

Problem:
The issue arises when using google_mlkit_face_detection: ^0.11.0 or google_mlkit_face_detection: 0.12.0 without explicitly specifying the version camera_android_camerax: 0.6.7+2. This happens because camera: 0.11.0+2 uses camera_android_camerax: 0.6.8+2 under the hood, which causes build errors.

Solution:
By explicitly setting camera_android_camerax: 0.6.7+2 and google_mlkit_face_detection: 0.11.0. Using this config it is still the new camera_android_camerax under the hood in the camera package.

@wapoywapa
Copy link

Unfortunately, because of this issue:

https://issuetracker.google.com/issues/362452861

Downgrading isn't an option, as ML Kit pre 0.12.0 no longer works on iOS with the latest Firebase packages

So the solution by @pvlKryu isn't an option for us

@santhoshAndroid
Copy link

Could anyone please help with resolving the issue of face detection not working on Android?

@emakar
Copy link

emakar commented Oct 23, 2024

camera_android_camerax 0.6.10 and google_mlkit_text_recognition 0.13.0 works for me
but google_mlkit_text_recognition 0.13.1 / 0.14.0 fails again

@morrowyn
Copy link

morrowyn commented Oct 28, 2024

This works for me on Android:

flutter 3.24.4
camera 0.11.0+2
google_mlkit_commons-0.7.1
google_mlkit_barcode_scanning 0.11.1

I do receive the following Note:

google_mlkit_commons-0.7.1\android\src\main\java\com\google_mlkit_commons\InputImageConverter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

When using the following:
flutter 3.24.4
camera 0.11.0+2
google_mlkit_commons 0.8.1
google_mlkit_barcode_scanning 0.12.1

or

flutter 3.24.4
camera 0.11.0+2
google_mlkit_commons 0.9.0
google_mlkit_barcode_scanning 0.13.0

You will receive when the camera is turned on. You do see the camera preview, though. Using the camera_view.dart from the provided examples.

E/ImageError( 4621): Getting Image failed
E/ImageError( 4621): java.lang.IllegalArgumentException
I/flutter ( 4621): PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)

@simeonangelov94
Copy link

The moment you move to google_mlkit_text_recognition to 0.14 and try ObjectDetector objectDetector.processImage(InputImage); doesn't work on Android device.

I tried with camera_android_camerax 0.6.10 also not working.

E/ImageError(17308): Getting Image failed
E/ImageError(17308): java.lang.IllegalArgumentException
E/flutter (17308): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(InputImageConverterError, java.lang.IllegalArgumentException, null, null)
E/flutter (17308): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
E/flutter (17308): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (17308):
E/flutter (17308): #2 ObjectDetector.processImage (package:google_mlkit_object_detection/src/object_detector.dart:21:20)
E/flutter (17308):
E/flutter (17308): #3 _ObjectDetectionFeedState.doObjectDetectionOnFrame
E/flutter (17308):

Copy link

github-actions bot commented Dec 2, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Dec 2, 2024
@wantroba
Copy link

wantroba commented Dec 2, 2024

The problem wasn’t solved yet

@github-actions github-actions bot removed the stale label Dec 3, 2024
@erdemalpr
Copy link

same error

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

No branches or pull requests