Yolov3-tiny-416.tflite is a tflite model for yolov3 tiny model created from yolov3-tiny.weights I had tried to use this from ML kit Vision module provided by google in android. In repo: https://github.com/googlesamples/mlkit/tree/master/android/vision-quickstart
This is the way I have load and and choose detection options for yolo v3 tiny tflite model.
LocalModel localModel = new LocalModel.Builder()
.setAssetFilePath("yolov3-tiny-416.tflite")
.build();
CustomObjectDetectorOptions customObjectDetectorOptions = PreferenceUtils.getCustomObjectDetectorOptionsForLivePreview(this,localModel);
cameraSource.setMachineLearningFrameProcessor(new ObjectDetectorProcessor(this,customObjectDetectorOptions));
Now, I have encounterd a error that says:
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.
As I know from error, I need to specify NormalizationOptions Metadata to process Image. So, How the problem can be solved? any Suggestion?
ObjectDetector.ObjectDetectorOptions objoptions = ObjectDetector.ObjectDetectorOptions.InvokeBuilder().SetScoreThreshold(0.6f).Build(); ObjectDetector objdetector = ObjectDetector.CreateFromFileAndOptions(Application.Context, "model.tflite", objoptions);
How do I makeObjectDetectorOptions
to specifyNormalizationOptions
? – Defiance