[Face Detection] Galaxy Tab A7 face recognition doesn't work
Bug report
Describe the bug I ran the example of face recognition feature on Android "Mobile Phone" & it worked probably. Also I've even tried it on another tablet "Galaxy Tab A -SM-T295" and it worked just fine. But when I'm trying it on "Galaxy Tab A7 - SM-T505N" It doesn't even work or even give any error, it just keep telling me there is 0 faces, but when I choose to take image from camera or gallery it works fine. Have been trying all orientations, rotations, landscape modes, portrait modes but nothing really works.
Steps to reproduce
Steps to reproduce the behavior:
Run Example on "Galaxy Tab A7 - SM-T505N" and it won't work
Expected behavior
That it would work fine
Flutter doctor
Click To Expand
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.18363.1646], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.0) [√] Android Studio (version 4.1.0) [√] IntelliJ IDEA Community Edition (version 2020.3) [√] VS Code (version 1.55.1) [√] Connected device (4 available)
• No issues found!
Flutter dependencies
Click To Expand
- animated_text_kit 2.5.4 [flutter characters]
- camera 0.5.8+17 [flutter]
- cupertino_icons 0.1.3
- firebase_core 1.0.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_messaging 10.0.2 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta]
- firebase_ml_vision 0.12.0 [flutter]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
- http 0.12.2 [http_parser path pedantic]
- image 2.1.19 [archive xml meta]
- intl 0.17.0 [clock path]
- lottie 0.6.0 [flutter archive characters charcode collection logging meta path vector_math]
- native_device_orientation 1.0.0 [flutter meta]
- path 1.8.0
- path_drawing 0.4.1+1 [vector_math meta path_parsing flutter]
- path_provider 2.0.2 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- provider 4.3.3 [collection flutter nested]
- qr_code_scanner 0.4.0 [flutter]
- qr_flutter 3.2.0 [flutter qr]
- screen 0.0.5 [flutter]
- shared_preferences 2.0.6 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows]
dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
dependency overrides:
- firebase_core 1.0.1 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_core_platform_interface 4.0.0 [flutter meta plugin_platform_interface]
- firebase_core_web 1.0.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
transitive dependencies:
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.5.0 [collection]
- boolean_selector 2.1.0 [source_span string_scanner]
- characters 1.1.0
- charcode 1.2.0
- clock 1.1.0
- collection 1.15.0
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- fake_async 1.2.0 [clock collection]
- ffi 1.1.2
- file 6.1.2 [meta path]
- firebase_messaging_platform_interface 3.0.2 [firebase_core flutter meta plugin_platform_interface]
- firebase_messaging_web 2.0.2 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta]
- flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- js 0.6.3
- logging 0.11.4
- matcher 0.12.10 [stack_trace]
- meta 1.3.0
- nested 1.0.0 [flutter]
- path_parsing 0.1.4 [vector_math meta]
- path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 2.0.0 [flutter]
- path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface]
- path_provider_windows 2.0.1 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.11.1
- petitparser 3.1.0 [meta]
- platform 3.0.0
- plugin_platform_interface 2.0.0 [meta]
- process 4.2.1 [file path platform]
- qr 1.3.0 [meta]
- shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 2.0.0 [flutter]
- shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows]
- sky_engine 0.0.99
- source_span 1.8.0 [charcode collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- string_scanner 1.1.0 [charcode source_span]
- term_glyph 1.2.0
- test_api 0.2.19 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0 [collection]
- vector_math 2.1.0
- win32 2.0.5 [ffi]
- xdg_directories 0.2.0 [meta path process]
- xml 4.5.1 [collection convert meta petitparser]
The same with Google Pixel 3
Same problem with Xiaomi POCO M3
@alessandrosilva @Sotatek-HieuVu Add this in your androidManifest.xml and try again let me know if it works.
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="face" />
I did that but it didn't solve the problem, I also increased CameraController's resolution as I saw in another issue, but it didn't solve it either.
Remember that the problem only occurs when using the camera in real time, if you use a photo from the gallery everything is ok.
It's not works for me either. And I agree with @alessandrosilva. If you taking a picture, or pick photo from gallery, it works fine. Issue only happen when I detect realtime on camera
I tried with 2 to 3 devices and did not come across any problems.
@Sotatek-HieuVu @alessandrosilva Was face detection in live camera working with v6.0 the one currently available on pub.dev on your devices or it's not working the code currently on master.
i got this issue when run on xiaomi redmi9T, android 10 QKQ1.200830.00
- Unhandled Exception: CameraException(error, Attempt to invoke virtual method 'android.view.Surface android.media.ImageReader.getSurface()' on a null object reference).
@CaoGiaHieu-dev Please mention the plugin version, if you are using 7.0 and it's not working, try with 6.0 and please update me if it works with 6.0, so I can make a fix.
@bharat-biradar hi . i down to version 0.6.0 but it still get the same error
@CaoGiaHieu-dev I think your issue is actually related to the Camera plugin rather than our plugin, as you are experiencing the same problem with both same versions and further google_ml_kit does not depend on camera plugin. I found a similar issue reported on the original flutter repo, maybe you might get some help there.
@bharat-biradar that might be true, thanks for your support btw . can you answer issue #103 .
@CaoGiaHieu-dev Your issue looks a bit familiar to #97 please try following the instructions given there, if that doesn't fix ping fbernaly, I am not good with the IOS side of things.
I also have the same problem.Followed all the steps as instructed, versions of: camera: ^0.8.1+7, google_ml_kit: ^0.7.0 tflite_flutter: ^0.8.0 tflite_flutter_helper: ^0.2.0 and I've added
<meta-data
android:name="com.google.mlkit.vision.DEPENDENCIES"
android:value="face" />
Run on device:
- Samsung Galaxy Tab A7 SM-T505
- Operating system : android 10 but still not showing the identification frame. Help me please!
@HuongNTY please check with version 6.0 and tell me if it works, we switched from bundled to unbundled model from in 7.0 if that is that cause I want to revert this change for now.
I tried changing version 6.0 but it still doesn't work
Hi guys. I have the very same issue when using real time face detection on Moto G9 Power device. It seems that the processImage function on face_detector.dart return an empty list. Going deeper this function, I realized that the following:
final result = await Vision.channel.invokeListMethod
( 'vision#startFaceDetector', <String, dynamic>{ 'options': <String, dynamic>{ 'enableClassification': options.enableClassification, 'enableLandmarks': options.enableLandmarks, 'enableContours': options.enableContours, 'enableTracking': options.enableTracking, 'minFaceSize': options.minFaceSize, 'mode': _enumToString(options.mode), }, 'imageData': inputImage._getImageData(), });
returns an empty list.
When using both Samsung A9 and Samsung Tab A (T295) the code works properly, and faces are recognized as expected.
Have anyone tried coding on the Java/Kotlin side of the Method Channel? I would appreciate any help on how to fix this.
Edit: I already tested on versions 0.5.1, 0.6.0 and 0.7.0, but the issue persists; Edit2: Camera Controller resolution is already set to ResolutionPreset.high;
Can someone having problem detecting in some devices try this approach instead and see if it works?
Can someone having problem detecting in some devices try this approach instead and see if it works?
I already tried it with this configuration, it didn't solve the problem.
Has anyone able to fix the issue in Galaxy Tab A7. I recognized that the below method return an empty face list. So custom paint is also not drawn in the mentioned device.
final faces = await faceDetector.processImage(inputImage);
Run on device: Galaxy Tab A7
Dependencies:
environment: sdk: ">=2.12.0 <3.0.0"
dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 google_ml_kit: ^0.7.2 camera: ^0.8.1+3 image_picker: ^0.8.1+3 path_provider: ^2.0.2 retrofit: ^2.0.1 logger: ^1.0.0 dio: ^4.0.0 built_value: any json_annotation: any flutter_secure_storage: ^4.2.0 shared_preferences: ^2.0.6 easy_localization: ^3.0.0 flutter_screenutil: ^5.0.0+2 device_info: ^2.0.2 geolocator: ^7.4.0 permission_handler: ^6.0.1 introduction_screen: ^2.1.0 http: ^0.13.3
I'm experiencing the same issue, even with latest camera version (0.9.2+2) and mlkit (0.7.2): face is not being recognized. My device is Galaxy Tab A7 SM-T500