Re: Mobile Development Using expo(react native) and tensorflow?

Hi, so I was wondering if anyone had any insight into whether it’s better to use tensorflow mobilenet, tensorflow lite, tensorflow react-native, or just train a tensorflow js model and deploy into my mobile app that involves real time object detection?

Its better to use Tensorflow lite to perform object detection on Mobile app.
Example for Objection detection model on Mobile app using Tensorflow lite is well demonstrated here
.

1 Like

Are the object detection models in tensorflow lite less intensive and therefore bettter for expo js usage? Because I was under the impression for object detection that tensorflow react-native was a better library for mobile development for expo apps. But if im wrong please let me know.

I don’t know what is your scope but you need to really evaluate many valid limits deploying your model just with flask:

well the app I’m building is needing to have your iphone or android first detect the object I want with known physical size, draw a bouncing box around it, and then use the detected object’s size and or pixel ratio as a reference to measure different objects in the same frame as it. Like using a card of known size 1 inch by 1 inch taking up 365x365 pixels to measure the length of a pencil next to it. My first idea was to see how many pixels were taken up by the size of the reference object while it is between 1 and 2 feet away from the camera, and use that to have people be able to measure whatever they want

I still suggest to use on the server side:

An alternative to explore could be:

If you interest is limited to Reactive native you could also check:

Edit:
Check also tfjs/README.md at master · tensorflow/tfjs · GitHub

yea . Im down to use whatever is the best one to use in expo. tf lite isnt compatible in expo but tf-js-react native are and i belive mobile net is

There is also an experimental TFlite model support in TF.js:

For Expo check this Expo compatibility section:

MobileNet usually describes a model architecture, not a platform. You should be able to run a MobileNet model in TensorFlow.js, TensorFlow Lite or any of the other TensorFlow platforms. I’m not familiar with Expo though, so a link might help if I’ve misunderstood.

If you are trying to get the reach and scale of the web but want to still run on device client side then TensorFlow.js is a great option for Web Apps (such as PWA) as you can get running in minutes, write in one language and deploy to all types of devices. Our image recognition runs in real time for MobileNet for example.

Check out my code that you can fork in minutes on Glitch here that shows how to use our COCO-SSD model:

And if you want to make your own version of “teachable machine” that can retrain itself live in the browser to recognize any object you want, then a great codelab is here:

Finally if you want to retrain YOLO and get it running in browser we have this great tutorial too:

Happy hacking!

Ah. Thanks jason for the info. So tensorflow js models being used in a expo react native project to run as apps on iphone and android should be suffice?

I am not a react person myself but we do have a react native implementation for TensorFlow.js that may be of use to you, but someone else on the team will have to answer any questions around that as that is not my area of expertise.

for sure. Is it possible to get into contact with them?

The SWEs on the TensorFlow.js team check the forum from time to time and monitor any posts tagged with the TFJS tag here so hopefully someone will see. Probably best to leave your precise questions for when they do so they can answer as they see it vs waiting for your question about React. Provide any details you are having issues with / error messages / links to code etc as needed so they can best reply.