【问题标题】:How do I replace the tflites in Tensorflow's image classification example for Android with my own tflite?如何用我自己的 tflite 替换 Android 的 Tensorflow 图像分类示例中的 tflite?
【发布时间】:2020-07-12 22:35:57
【问题描述】:

我克隆了Tensorflow's Android image classification example,现在我想使用从here 下载的我自己的tflite 对食物进行分类。如何用我自己的 tflite 替换默认的 tflite?我只有一个 tflite,而在 Android 示例中有一对,所以我不确定要摆脱哪个 tflite。

【问题讨论】:

    标签: android android-studio tensorflow tensorflow-lite


    【解决方案1】:

    首先,将模型添加到assets 文件夹中。或者,您可以直接从 TFHub 下载模型,方法类似于the models in download.gradle

    然后如果你使用任务库来运行推理(这更简单),你需要添加一个类似的ClassifierFloatEfficientNet.java类并提供模型信息。在Classifier.java 注册您的新课程。

    如果您使用 TFLite 支持库来运行推理,您将添加新类,例如 this one

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多