如何在 Tensorflow Lite 中为从 Github 获取的模型添加元数据?

Asa*_*ain 5 metadata kotlin android-studio tensorflow tensorflow-lite

我使用了 Github 上的这个项目: https: //github.com/nicknochnack/TFODCourse

该项目包含一个可以检测给定车辆图像上的车牌的模型。Github 存储库还包含将模型转换为 Tensorflow Lite 文件的代码。

我使用该代码生成 TFLite 文件。

然后,我点击了此链接:https ://developers.google.com/codelabs/tflite-object-detection-android

我下载了对象检测模型的示例应用程序并按照说明操作,将 TFLite 文件复制到 Android 应用程序中。

现在,如果我运行该应用程序并拍照,它会给我这个错误,

/TaskJniUtils: Error getting native address of native library: task_vision_jni
    java.lang.RuntimeException: Error occurred when initializing ObjectDetector: Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images.
        at org.tensorflow.lite.task.vision.detector.ObjectDetector
Run Code Online (Sandbox Code Playgroud)

我知道我必须在 TFLite 模型中添加元数据。所以,我搜索了它并最终找到了这个链接: https: //www.tensorflow.org/lite/models/convert/metadata#model_with_metadata_format

但我根本不明白我到底应该做什么。任何人都可以帮助我指出正确的方向,特别是对于我的问题,我到底需要做什么?