Skip to content

Instantly share code, notes, and snippets.

@admataz
Last active June 5, 2020 20:15
Show Gist options
  • Save admataz/275d461bfa650da061b7a1c5e8b5f9c6 to your computer and use it in GitHub Desktop.
Save admataz/275d461bfa650da061b7a1c5e8b5f9c6 to your computer and use it in GitHub Desktop.
YCM - React Native notes - 05 June

YCM Sign 2 Word - React Native notes 5 June

1. Using Tensorflow.js in react native apps

Good news! there’s a module that will help with Tensorflow ML stuff made for React Native apps: @tensorflow/tfjs-react-native - npm

From the introduction it looks like it will support most of what you need for Sign2Word - and works well with Expo managed apps too

These points seemed relevant:

has full support for training and fine tuning models that TensorFlow.js supplies. You can customize models based on user data while keeping that data on the client device.

provide two new IOHandlers that allow loading models which are bundled with the app bundle itself (and thus do not require a remote network call). This also saves customized models to local storage

Image & Video Handling

See (TensorFlow.js for React Native is here! — The TensorFlow Blog for more

Further reading about the loading of models and bundling with local app assets - there are ways to do this, but may mean ejecting from the Expo managed app (not a big deal - needs native compiling with Xcode or Android studio)

See: bundleResourceIO TensorFlow.js React Native API

Expo guides and documentation

Other links worth checking “Assorted Guides in the Expo Guides: Guides to get things done - Expo Documentation Assorted Guides

Also the API Reference - Expo Documentation for more technical descriptions

Some specifics relevant to the questions we are discussing:

Storing data and content/files on the device

Offline Support - Expo Documentation Expo can bundle assets into your standalone binary during the build process so that they will be available immediately, even if the user has never run your app before.

Persisting data in React Native

FileSystem - Expo Documentation

AsyncStorage - Expo Documentation AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage.

Layout with Flexbox:

Layout with Flexbox - Expo Documentation This is well described with diagrams in the docs

Navigation/Routing

Routing & Navigation - Expo Documentation I’ll have a look for a good (simple) example !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment