Yolov3-tiny-416.tflite 是从 yolov3-tiny.weights 创建的 yolov3 tiny 模型的 tflite 模型,我曾尝试在 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));
Run Code Online (Sandbox Code Playgroud)
现在,我遇到了一个错误:
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.
Run Code Online (Sandbox Code Playgroud)
据我从错误中得知,我需要指定 NormalizationOptions 元数据来处理图像。那么,问题如何解决呢?有什么建议吗?