【问题标题】:it requires specifying NormalizationOptions metadata to preprocess input images它需要指定 NormalizationOptions 元数据来预处理输入图像
【发布时间】:2021-04-03 08:47:51
【问题描述】:

Yolov3-tiny-416.tflite 是 yolov3 tiny 模型的 tflite 模型,由 yolov3-tiny.weights 创建 我曾尝试从谷歌在 android 中提供的 ML kit Vision 模块中使用它。在回购:https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart

这是我为 yolo v3 tiny tflite 模型加载和选择检测选项的方式。

LocalModel localModel = new LocalModel.Builder()
              .setAssetFilePath("yolov3-tiny-416.tflite")
              .build();
CustomObjectDetectorOptions customObjectDetectorOptions = PreferenceUtils.getCustomObjectDetectorOptionsForLivePreview(this,localModel);
cameraSource.setMachineLearningFrameProcessor(new ObjectDetectorProcessor(this,customObjectDetectorOptions));

现在,我遇到了一个错误,上面写着:

E/MobileVisionBase: Error preloading model resource
b.a.d.a.a: Failed to initialize detector. Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images. 

据我所知,我需要指定 NormalizationOptions 元数据来处理 Image。那么,如何解决这个问题呢?有什么建议吗?

【问题讨论】:

    标签: android tensorflow yolo google-mlkit


    【解决方案1】:

    这是 ML Kit 自定义对象检测和跟踪的自定义模型要求。 https://developers.google.com/ml-kit/custom-models 如果您检查页面底部的元数据部分,它有一些关于添加 NormalizationOptions 元数据的说明。

    但是,ML Kit 自定义对象检测和跟踪的最基本要求是模型需要是图像分类模型,而 yolov3 不是。

    如果您想使用 ML Kit 对更多对象进行分类,您可以尝试 TFHub 上带有 ML Kit 标签的自定义图像分类器模型之一。 https://tfhub.dev/ml-kit/collections/image-classification/1 或使用 AutoML 或 TFLite ModelMaker 训练您自己的分类器(请参阅 https://developers.google.com/ml-kit/custom-models#automl_vision_edge)。

    最好的,

    【讨论】:

      猜你喜欢
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-16
      • 2019-01-31
      • 2022-07-20
      • 2020-04-19
      • 1970-01-01
      相关资源
      最近更新 更多