-
Notifications
You must be signed in to change notification settings - Fork 4k
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
File descriptor support for Android/Java/JNI #3507
Comments
See #3331 |
That PR adds the option of using an array or string instead of the path. I have an |
Yes, please have a look at the discussions about that: long story short, as much as I can remember, TensorFlow does not allows us to do this. Current implementation already relies on Putting the model into the app data directory should avoid requesting extra permissions. |
This is what I would like to keep doing
There are two data directories on Android:
I looked into the TensorFlow code. It seems that, sadly, only file paths not file descriptors are supported. I will have to find another solution then |
Maybe try to open the issue upstream ? Tensorflow folks might be interested. They are usually open. |
I would like this issue to be reopened. This issue was closed because we deferred the action to upstream. Today upstream just implemented their part to support the functionality (tensorflow/tensorflow@555034b). I would appreciate it if this request was reconsidered, now that there are no more technical limitations |
That's a bit of a long shot, it's still on current master, and we would need to update to the release branch containing this. If you want this feature, now that upstream allows, you might need to send PR though. |
I would like the Android/Java/JNI bindings to support file descriptors. Currently, they only support paths.
I am using Android's SAF (the OS's graphical file picker) to open the model and scorer files. It avoids asking for invasive permissions but returns a file descriptor instead of a path. On Android 10, I could just convert the file descriptor into a path using the expression
"/proc/self/fd/" + fd
. After updating to Android 11, this fails with a permission denied error. A workaround might be to request for access to the entire internal storage, but this is not ideal for privacy reasons.I heard that
dup
works whilefopen
doesn't. This leads to two possible solutions:int
to use as a file descriptor, and pass that all the way into native code/proc/self/fd/
, and if it does, use the existing file descriptor instead of opening a fileIf you've found a bug, or have a feature request, then please create an issue with the following information:
implementation 'org.mozilla.deepspeech:libdeepspeech:0.9.2'
The text was updated successfully, but these errors were encountered: