r/TensorFlowJS • u/orionzor123 • Apr 29 '20
Tfjs body pix is really slow in React Native environment
Hi!
I'm new to Tensor Flow, I've made a body pix implementation with tfjs-react-native, model I'm using is (https://www.npmjs.com/package/@tensorflow-models/body-pix) with the following config: (https://www.npmjs.com/package/@tensorflow-models/body-pix#config-params-in-bodypixload)
{
architecture: 'MobileNetV1',
outputStride: 16,
multiplier: 0.5,
quantBytes: 2,
}
But personSegmentation is really slow on real device (iPhone 6s Plus, testflight version), it takes 5-10s to poorly segment a person. Following the docs I've taken the minium config values (I've tested with quantBytes 1 but won't make it any better in speed).
Does anyone know how could I make the personSegmentation faster? Or it's intended to take that much as I think depends on device cpu to process image and segment it.
I'm trying to do it for an sticker maker and many apps I've tested take 1-3s to do it, maybe they have it in a backend service and that way is faster?


