简体   繁体   English

如何用我自己的 tflite 替换 Tensorflow 的 Android 图像分类示例中的 tflite?

[英]How do I replace the tflites in Tensorflow's image classification example for Android with my own tflite?

I cloned the Tensorflow's Android image classification example and I want to now use my own tflite that I have downloaded from here to classify food.我克隆了Tensorflow 的 Android 图像分类示例,现在我想使用从这里下载的我自己的 tflite 对食物进行分类。 How do I replace the default tflites with my own tflite?如何用我自己的 tflite 替换默认的 tflite? I only have one tflite while in the Android example there's a couple so I'm not sure which tflite to get rid of.我只有一个 tflite,而在 Android 示例中有一对,所以我不确定要摆脱哪个 tflite。

First, add the model into the assets folder.首先,将 model 添加到assets文件夹中。 Alternatively, you can directly download the model from TFHub in the similar way as the models in download.gradle .或者,您可以直接从 TFHub 下载 model,方法与download.gradle 中的模型类似。

Then if you use Task library to run inference (which is simpler), you will need to add a similar class of ClassifierFloatEfficientNet.java and provide the model info.那么如果你使用任务库来运行推理(更简单),你需要添加一个类似的ClassifierFloatEfficientNet.java的 class 并提供 Z20F35E630DAF44DBFA4C3F68F539D 信息。 Register your new class in Classifier.java .Classifier.java中注册您的新 class 。

If you use the TFLite Support library to run inference, you'll add the new class like this one .如果您使用 TFLite Support 库来运行推理,您将像这样添加新的 class 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tensorflow 图像分类 Android 示例无法构建 - Tensorflow image classification Android example fails to build 如何在android studio中使用.tflite model进行图像分类 - How to use .tflite model in android studio for image classification 如何替换我自己的“电话铃声”屏幕而不是android的默认屏幕? - how can i replace my own “Phone Ringing” screen instead of android's default one? 如何将.png图像转换为字节数组-Android,TFLITE应用程序 - How do I convert a .png image to a Byte Array - Android, TFLITE application 如何将 tensorflow 图像分类数据存储在 android 应用程序的内部存储中? - How to store the tensorflow image classification data in the internal storage for android app? 如何通过自己的Android应用程序与Facebook的API接口? - How do I interface with Facebook's API through my own Android application? 如何用图像中的蓝色半透明替换我的Android应用程序谷歌地图半径圆圈? - How do I replace my android app Google maps radius circle with a blue translucent one as in image? 是否可以用我自己的ContentProvider Android的默认值替换? - Is it possible to replace by my own ContentProvider Android's default one? 如何在Android XML中使用自己的颜色 - How do I use my own colors in android XML 我如何为三星银河建立自己的机器人 - How do I build my own android for the samsung galaxy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM