0

I trained a custom yolo5 model, and then converted it to tflite. Model works completely fine in both stages. I want to use this model in Flutter.

Right now I am using Google ML kit models, which works perfectly fine, but when I replace their model with my tflite file, it gives an error of

[ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(ObjectDetectionError, com.google.mlkit.common.MlKitException: Failed to initialize detector. Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images., null, null)

Any lead how I can solve this issue?

Tedinoz
  • 5,911
  • 3
  • 25
  • 35

1 Answers1

2

The yolo5 is not image classification model which is required by the Custom models with ML Kit.

One way to solve this is to use a custom image classifier models with ML Kit tag from the TFHub .

Damir Tenishev
  • 1,275
  • 3
  • 14