-
Notifications
You must be signed in to change notification settings - Fork 3.9k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
[firebase_ml_vision] Only works on ResolutionPreset.high CameraController #1518
Comments
We fixed the issue by changing the final newCameraController = CameraController(
cameras.first,
ResolutionPreset.high,
enableAudio: false,
); We are only using the camera preview for scanning a QR code, so high resolution is overkill for our use case. On lower-end devices it causes dropped frames to set the camera controller to high. Would love to be able to use this plugin on lower resolution presets. |
Same issue, high resolution is overkill, medium crash |
I'm seeing the same thing with a Nexus 5x, on medium it doesn't find anything. |
For anyone else looking only to scan QR codes, we decided to use https://pub.dev/packages/qrcode Running the firebase_ml_vision for QR codes was overkill, even more so with the resolution pinned at high. |
I met the issue when I run app on pixel 3a with camera streaming and ml_vision. But this problem not appear when I debug on Samsung s8 and iPhone 6s. Any solution ? |
Same issue, the example app doesn't even work on Android. |
Similar thing also happened here, I am writing a real time face detection app using face detector, and I was setting ResolutionPreset to medium, which results no faces detected at all, it took me days to find out the reason. My device is Samsung S9 running Android X(api 29), face detection working fine if preset is not set to medium. |
I can relate to this. Text OCR works on ResolutionPreset.HIGH, but on slower devices it might stutter a bit. On Samsung S8 it stutters hell a lot and is completely unusable. Switching to ResolutionPreset.MEDIUM fixes the Samsung S8 issue, but completely disables other devices as they no longer recognize a single character from the image. |
Same Problem here. The medium resolution was not working at all. I looked closer at what happened, and I found that my phone (redmi 4X) added a padding to each row of the planes when the medium resolution was selected (but not with high or low resolution). In my case the image format is a YUV 4:2:0, meaning the image is decomposed in 3 planes (Y, U, V), with 8 bits per pixel for Y, and 4 for U and V. Each plane is a matrix of ~pixel stored in a 1D-array. They come with a As 1 - I can't help and dig more into this than I actually did. 2 - I wrote 2 workarounds (A and B) that keep the data consistency:
// For each plane
FirebaseVisionImagePlaneMetadata(
bytesPerRow: plane.bytesPerRow,
width: plane.bytesPerRow,
height: image.height,
)
...
int newWidth = planes[0].bytesPerRow;
// Build image metadata
var metadata = FirebaseVisionImageMetadata(
rawFormat: image.format.raw,
size: Size(newWidth.toDouble(), image.height.toDouble()),
rotation: ImageRotation.rotation90,
planeData: planesMetadata,
);
... Both are working for my own but they still are workaround. |
Bar Code scanner won't run iPhone 8 device while set it max resolution. if i set resolution to medium at the time it work's fine but can't able to scan the lower quality bar code in printed copies. while set to max resolution iPhone 6, 6s, 7, 7 plus, 8, 8 plus memory consumption is more than gb and it leads to crash. Attached Memory usage screen shot. |
I have the same problem on my Pixel 3a. Only works with max resolution, and in max resolution the memory builds until the app crashes. |
ResolutionPreset.high or even ultra didn't help me on OnePlus 6t :( |
whats new? |
I'm having the same problem on a Google Pixel (1) and Pixel 4 XL. Only with |
nothing, by the looks of it. This issue has been opened for over a year now, so I'm assuming that nobody's looking at this. If I were you I would be looking at using another library |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe the bug
I'm building an android app using flutter that has a QR code scanning feature. I've broken out the QR code logic into a minimum reproduction case here.
Oddly enough, the QR scanning only works on my Samsung devices. My Google Pixel XL and Oneplus 6 both do not detect anything when scanning a QR code using google/firebase ml vision barcode scanning model.
To Reproduce
Steps to reproduce the behavior
Key code locations in the repository are:
android/app/build.gradle
where I include the barcode model api:lib/src/bloc/services/qr_service.dart
where I run the barcode detection on the image:I'm hoping I'm doing something wrong. But it is very weird that this minimum repro works flawlessly on my Samsung S8, Samsung J7, and Samsung S10+ while it does not work on my Oneplus 6 (android 10) and it does not work on my Google Pixel XL (android 9).
Additional context
Dependency Versions
Device List
Working on these devices
Not working on these devices
flutter doctor -v
Posted on Stack Overflow as well in case I'm doing something wrong and this isn't actually a bug with firebase ML vision
The text was updated successfully, but these errors were encountered: