I have .tflite trained model ( model-fp16.tflite ) in my android kotlin app, which I converted from yolov5.pt with this repo , but i'm unable to load my model.
getting this exception
org...lite.examples.objectdetection E 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.
My model properties are here in this Image , i have tried many solutions and documentation of TensorFlow, but nothing happens,
i have tried StackoverFlow Answer 1 and Answer 2, but nothing happens, here are the lines where this error occurred
val modelName = "model-fp16.tflite"
try {
objectDetector =
ObjectDetector.createFromFileAndOptions(context, modelName, optionsBuilder.build())
} catch (e: IllegalStateException) {
objectDetectorListener?.onError(
"Object detector failed to initialize. See error logs for details"
)
Log.e("Test", "TFLite failed to load model with error: " + e.message)
}
i WANT to load my model and calculate detection results.
Thanks in advance.