Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Tensorflow with react-native? [closed]

I've looked around the web and cant seem to find a way to use React Native with TensorFlow.

I don't think TF supports react-native (at least not officially) integration but i hope someone in the community has found a way.

How can one use TensorFlow in a React Native project?

Thanks.


CONTRIBUTOR UPDATE: Now is possible

TensorFlow.js PoseNet in React Native!

like image 780
Ally Jr Avatar asked Jan 27 '17 21:01

Ally Jr


People also ask

Can you use TensorFlow With react-native?

tfjs-react-native provides a TensorFlow. js platform adapter for react native. All symbols are named exports from the tfjs-react-native package.

Can I use TensorFlow With react JS?

js (ReactJS) TensorFlow. js (or, in short, tfjs) is a library that lets you create, train, and use trained Machine Learning models in Javascript!


2 Answers

This article explains using tensorflow with native android development. https://omid.al/posts/2017-02-20-Tutorial-Build-Your-First-Tensorflow-Android-App.html

I also needs a tf supporting library for react-native. But it seems as you said there is no library yet.

Here they have built an adroid app with react native with tensorflow support, have a look, https://github.com/NorthFoxz/whatsthis

like image 163
Dinuka Salwathura Avatar answered Sep 21 '22 12:09

Dinuka Salwathura


Came across the following Platform Adapter for React Native.

This package provides a TensorFlow.js platform adapter for react native. It provides GPU accelerated execution of TensorFlow.js supporting all major modes of tfjs usage


There is also a library react-native-tensorflow bridging tensorflow with react-native.

A TensorFlow inference library for react native.

They have recently added support for iOS, so it's available for both Android and iOS platforms.

To get started:

$ npm install react-native-tensorflow --save

Perform library link:

$ react-native link react-native-tensorflow

For iOS you will also need to use CocoaPods with content:

target '<ProjectName>'
       pod 'TensorFlow-experimental'

There are performance limitations due to the nature of react-native bridge when transferring large data between native side and JS. For other known issues and usage check out the library's documentation.

like image 22
Antoni4 Avatar answered Sep 19 '22 12:09

Antoni4