Tensorflow lite 在 Android 和 iOS 中的性能差异

Performance difference of Tensorflow lite in Android and iOS

我已经训练了一个模型来检测要在移动设备中使用的自定义对象(Android 和 iOS),我的代码基于 iOS and Android 的 tensorflow 示例。在我的测试中,我注意到 Android 应用程序和 iOS 应用程序的性能差异。

一些性能示例(检测到的对象数量):

IMG - iOS - Android

img1 - 57 - 74

img2 - 9 - 33

img3 - 43 - 78

img4 - 17 - 25

我在两个平台上都使用了 70% 的置信度阈值。实际对象数量比Android的结果多一点。

我使用 tensorflow model zoo and samples anotated by labelImg. The training process I did on google cloud following this tutorialssd_mobilenet_v2_quantized_coco 进行了迁移学习。

我的问题是:我应该调查什么来了解性能差异的原因并解决它?我的模型应该在两个移动平台上为客户提供相同的结果。

如果有什么不清楚的地方请告诉我,任何帮助都会很棒。谢谢!

据研究,问题出在 tensorflow 示例应用程序上。 Android 版本工作正常,但 iOS 版本预处理逻辑有问题。对于浮点模型,这个问题已经解决了 github issue some days ago, but for quantized models it's still not solved (my case). If someone is interested in contribute or be in touch with more details on this, chek out the issue I've opened on github.