android-vision icon indicating copy to clipboard operation
android-vision copied to clipboard

Callback for Vision Dependencies Download

Open NamrataBagerwal opened this issue 9 years ago • 11 comments

Hi, I had been playing around with Mobile Vision Apis recently and it worked well on few of my devices. But on two of my devices I found that the libraries are currently in download or there is not enough space which I inferred from log but what if I were an end user how would I come to know what is the problem that the application is not detecting any barcode. So it would be better if there were a callback kind of thing to get an exact status regarding Vision Dependencies whether in downloading stage or there is not enough space to download so that we can show the message to an End user accordingly. For a time being, I have used timer which is called at regular intervals to check whether the detector has become operational as a fix.

Thanks and Regards, Namrata

NamrataBagerwal avatar Sep 03 '15 10:09 NamrataBagerwal

Thanks for your feedback. We are looking into ways to improve the download experience for a future release, and a callback mechanism is something that we are considering.

pm0733464 avatar Sep 03 '15 14:09 pm0733464

The fact that a download is needed, and that it can easily fail, is really making this library a lot less attractive. This is a huge possible point of failure. We're working on an app that needs to work without a network connection too, and started out using the vision library, but may have to reconsider due to this issue. It is a huge liability, and I really wish the library could just include the code it needs.

DagAgren avatar Sep 14 '15 11:09 DagAgren

Thank you for your feedback. We are looking into this.

pm0733464 avatar Sep 14 '15 20:09 pm0733464

We updated the sample apps to include a low storage check. For example:

        // Check for low storage.  If there is low storage, the native library will not be
        // downloaded, so detection will not become operational.
        IntentFilter lowstorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW);
        boolean hasLowStorage = registerReceiver(null, lowstorageFilter) != null;

        if (hasLowStorage) {
            Toast.makeText(this, R.string.low_storage_error, Toast.LENGTH_LONG).show();
            Log.w(TAG, getString(R.string.low_storage_error));
        }

https://github.com/googlesamples/android-vision/blob/master/visionSamples/photo-demo/app/src/main/java/com/google/android/gms/samples/vision/face/photo/PhotoViewerActivity.java#L91

We are still considering other improvements to the download mechanism as well.

pm0733464 avatar Sep 16 '15 19:09 pm0733464

@pm0733464

I found out that the Samsung S5 does not "download" these libraries when on Android 5.0. I tested another Samsung S5 with 5.1 and the barcode scanning works fine and the libraries "download". I hope this helps you figure out the issue.

mitchross avatar Sep 16 '15 20:09 mitchross

We are in a similar boat to @DagAgren in that without better mechanisms for detecting error conditions, the user experience is degraded for certain phones. We just added a check for isOperational and I guess now we'll add similar refinements for low storage but ideally, these low level concerns would be addressed at the library level instead of inside of application logic. Otherwise, developers will have to write boilerplate wrappers around things like BarcodeDetector to make them more useable in production.

gmale avatar Sep 16 '15 20:09 gmale

@mitchross - On the Samsung, I believe they come with sync'ing turned off, you might want to check that setting on the device that is not working.

claywilkinson avatar Sep 16 '15 21:09 claywilkinson

@claywilkinson No luck. Syncing was already on.

mitchross avatar Sep 17 '15 13:09 mitchross

Nexus 7 OS 5.0, the native libraries are not downloading at all, the detector operational state is always returned as false. Is there any update in mobile vision download improvements. Which is a huge drawback to consider this library in the production applications. Atleast Provide a way to download the native library and integrate it with the application instead of play services do It automatically( force download and load the native library by application it self (or ) pulling the native library from Google maven at compile time) in this way lot of download issues will be addressed. Please address the download issues as early as possible because these issues are there from very long back.

vrvmadan avatar Apr 10 '18 21:04 vrvmadan

i found out that clearing the cache of google play services solves this problem.

ysfelouardi avatar Oct 22 '18 09:10 ysfelouardi

I am running into same issue:

I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:2702
    Selected remote version of com.google.android.gms.vision.dynamite, version >= 2702
W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.face not found.
I/DynamiteModule: Considering local module com.google.android.gms.vision.face:0 and remote module com.google.android.gms.vision.face:0
E/Vision: Error loading module com.google.android.gms.vision.face optional module true: gm: No acceptable module found. Local version is 0 and remote version is 0.
I/Vision: Request download for engine face is a no-op because rate limiting
I/FaceDetectorCreator: Fallback loading v1 model while waiting for v2 model to download.
I/Vision: Loading library libmobile_vision_face.so
I/Vision: libmobile_vision_face.so library load status: false
I/Vision: Request download for engine face is a no-op because rate limiting
I/Vision: Request download for engine face is a no-op because rate limiting

mainakbiswas avatar May 28 '20 15:05 mainakbiswas