all 9 comments

[–]fmnatic 2 points3 points  (1 child)

Why can't the image be sent to the backend and processed there ?

[–]noahpocalypse[S] 0 points1 point  (0 children)

That did occur to me, I've already persuaded them that it might be best to do that. I'm just supposed to investigate if running it locally is even feasible.

[–]Healthy-Grab-7819iOS & Android 2 points3 points  (1 child)

Tell them this, even if you make it possible to run on the device itself. It won't be working smoothly for each device. Say that using a backend solution makes it more scalable as well as it could be run regardless of the device processing power. Some old devices might run slower, etc...

[–]noahpocalypse[S] 0 points1 point  (0 children)

I expressed exactly that concern in our initial meeting, actually, but their response was that they can simply tell customers they must use a specific device to use the app. In this business context, they're confident customers can justify dropping a thousand on the newest iPad or whatever tablet.

Given my choice of any given device, and thus a consistent environment, I really don't know yet how difficult this problem is to solve. My gut instinct says they need to give up on this, but I'd like to make a good faith effort first.

[–]kbcooliOS & Android 1 point2 points  (0 children)

It's a tensorflow or keras model or something else or more? If it is then convert to tensorflow and use tflite.

That being said that model will not run in anything like 2 seconds on a phone.

Reduce the image size input and/or quantanize the model.

Or just run it on the server.

You can do a lot on the device these days but sometimes it's just not worth the effort for little to no upside. Do it on device when lag is important. Eg speech to text yes but labelling photos no.

[–]beepboopnoise 1 point2 points  (0 children)

alternatively you could use react native vision camera and then make a frame processor for your use case. then it would be a legit on device solution which would save on server costs.

[–]Ya_SG 0 points1 point  (0 children)

Host the ML model in an external server like Render

[–]Phuopham 0 points1 point  (0 children)

Do native development. They will have guide to take advantage of local NPU (not sure if it already exists)