Closed ayalma closed 5 years ago
@ayalma does the download ever complete or are you stuck waiting for the model indefinitely? Also is this specific to a certain device or network?
Yes , it's stuck in waiting. I tested in my friend Lg device and problem exist. And for network i tested it with wifi and mobile date and even i used vpn for that and still this problem exist .
This happens to me one time, I only w8 like 10 minutes because the device is downloading the model, and later work without problem
@samtstern I think that this issue also ties in with #586
@the-dagger I can confirm we're making some internal progress on #586, I've seen some good API proposals going around!
Awesome, thanks!
I also have this problem(any devices) there is a solution?
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-ml-vision:18.0.2'
take image and call method
mCamera.takePicture(null, null, new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] bytes, Camera camera) {
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 1, stream);
imageView.setImageBitmap(bitmap);
fetch(bitmap);
}
});
private void fetch(Bitmap bitmap) {
final FirebaseVisionImage firebaseVisionImage = FirebaseVisionImage.fromBitmap(bitmap);
FirebaseVisionTextRecognizer firebaseVisionTextRecognizer = FirebaseVision.getInstance().getOnDeviceTextRecognizer();
firebaseVisionTextRecognizer.processImage(firebaseVisionImage)
.addOnSuccessListener(new OnSuccessListener<FirebaseVisionText>() {
@Override
public void onSuccess(FirebaseVisionText firebaseVisionText) {
btn.setEnabled(true);
Log.i(TAG, "onFailure: " + firebaseVisionText.getText());
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
btn.setEnabled(true);
e.printStackTrace();
Log.i(TAG, "onFailure: " + e.getMessage());
}
});
}
error message : Waiting for the text recognition model to be downloaded. Please wait.
There doesn't seem to be evidence here that anything is broken, models can sometimes take a long time to download on a slower or spottier connection. Let's close this and I will update on when we have a better API for these downloads in #586.
This pops up for me after trying on-device OCR on Android 11 DP 1.
On previous versions, everything worked fine (the models are also mentioned in the manifest to be downloaded via com.google.firebase.ml.vision.DEPENDENCIES
).
But it seems that even with FirebaseModelManager
I cannot check the status of on-device models (see firebase/firebase-android-sdk#47)?!
Is this a known problem with Android 11?
Add this dependency. It worked for me.
implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.0.2'
This might be a workaround. But the auto-download will be fixed, right?
@shubh261096 which dependency do I need for OCR?
Do you have a workaround? @samtstern samtstern
I am having the same issue. Can anyone please help me?
Add this dependency. It worked for me.
implementation 'com.google.firebase:firebase-ml-vision-barcode-model:16.0.2'
Does not work, it shows duplicate classes when using mlkit's ocr. Anyone solved the issue?
The problem seems to be of play services version, on emulator it's not working but on physical device it is. Anyone having problem should check that one.
This problem isn't specific to emulators; it happens on "Samsung S20" and OnePlus devices as well. Does anyone has a solution?
Still seeing this issue. Does anyone found any solution?
I'm seeing an increasing number of users that report broken OCR. For many it has started with a recent Android Update but I cannot reproduce it.
It's fixable by clearing all google play services data on affected devices, but how are we supposed to communicate this towards end-users.
I'm experiencing this issue on many many recent Android devices (11 & 12)... The download just fail somehow, waiting is not an option (it just won't download).
how i fixed this,
1 - your android emulator is not a version that include google play services.
2 - google play store need to be logged to be able to download the model
3 - your google play services is not updated on emulator or physical devices
adb logcat -c
to clean the log files and felt confuse because the error doesn't go away from the logs, make sure to do that before check logs againthose steps solved for me
Firebase/Play Services SDK version: All my dependency's // ML Kit dependencies implementation 'com.google.firebase:firebase-core:16.0.6' implementation 'com.google.firebase:firebase-ml-vision:18.0.2' implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2' implementation 'com.google.firebase:firebase-ml-vision-face-model:17.0.2' implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.4' implementation 'org.tensorflow:tensorflow-lite:1.12.0'
And classpath 'com.google.gms:google-services:4.2.0'
problem
Text detection failed.com.google.firebase.ml.common.FirebaseMLException: Waiting for the text recognition model to be downloaded. Please wait.
Steps to reproduce:
I just cloned your repo
Observed Results: