Skip to content
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

How to load image from local file ? #9

Closed
phanoophong opened this issue Jan 7, 2018 · 2 comments
Closed

How to load image from local file ? #9

phanoophong opened this issue Jan 7, 2018 · 2 comments

Comments

@phanoophong
Copy link

How to load image from local file ?

@maxkuzmin
Copy link

image: data.path.replace('file://', '') works for me as temp workaround.

@reneweb
Copy link
Owner

reneweb commented Feb 5, 2018

If you are using the image recognition API then you should be able to pass the path to the image prop, potentially stripping off the file:// part at the beginning as described by @maxkuzmin.
If you are using the "Direct Api" it is quite a bit more complex. To load a file in this case you will want to use a library like react-native-fs, load the file as base64 and then convert it to the required format. This has several drawbacks as described here: https://github.com/reneweb/react-native-tensorflow/blob/master/README.md#known-issues (there is currently not a really good way to use the direct api unfortunately)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants