Pytorch mobile object detection example

Hi everyone, Is there some example for object detection model yet that deployed on android?

1 Like

The demo app has a classification example, but we have not posted any detection demos yet. Stay tuned!

2 Likes

Glad to hear that. Hope it will arrive soon enough

Any updates on this?
Need to deploy on Android and main option currently is TFLite, which means working in TF…really hoping PyTorch will be a competitive option soon.

I didn’t deploy any object detection model with Pytorch but from docs and app code, Pytorch Mobile should work fine with these type of models. The only limitations that I’m aware are the missing support for nms and roi_align torchivision operations (see post). I think that TFLite doesn’t support NMS. So, a mobilenet + ssd/ssdlite head or similar should work fine.

That said, It would be nice to have some reference implementation. At least, to view the predicted bbox.

If you are worried about pytorch performance, you may want to take a look into this issue. I found that Hello World App performance to be much worse than Pytorch Demo App. Demo App runs nearly as fast as TFLite under the same conditions without any hassle :smiley:

Finally, last month I was searching for mobile object detection models and I found DiceNet. It’s interesting and researchers have used Pytorch.

2 Likes

Thanks @vferrer for the info!

I tried to quantize the model but fail(details write in this post), could you quantize it?

https://github.com/qfgaohao/pytorch-ssd this is working for me i could export it with torchscript and got it loading into android using the pytorch demo apps, it fails when i try to interpret the output.
Would be good to have an android demo with bboxes.

failing to get the Tensor output which is 2D into a java array without flattening it

1 Like

Detection is available now?