如何使用TensorFlow Lite配置Android对象检测模型?

时间:2020-08-10 23:51:58

标签: java android tensorflow yolo object-detection-api

我一直在使用the TensorFlow Lite Android example创建自定义对象检测应用。构建示例应用程序可以在我的Pixel 2XL上正常运行。

我想在应用程序中使用我的自定义TFLite模型,但不确定如何配置它。在DetectionActivity.java中,有一些配置字段:

  // Configuration values for the prepackaged SSD model.
  private static final int TF_OD_API_INPUT_SIZE = 300;
  private static final boolean TF_OD_API_IS_QUANTIZED = true;
  private static final String TF_OD_API_MODEL_FILE = "detect.tflite";
  private static final String TF_OD_API_LABELS_FILE = "file:///android_asset/labelmap.txt";
  private static final DetectorMode MODE = DetectorMode.TF_OD_API;

不是很确定如何确定我需要什么。我尝试用自定义模型替换TF_OD_API_MODEL_FILE,并用具有自定义类的文本文件替换TF_OD_API_LABELS_FILE,但是应用程序在我的手机上不断崩溃。我有一个经过YOLOv4训练的TFLite模型。

0 个答案:

没有答案
相关问题