I trained a model with yolov4. The inference is perfect and so are the metrics. I converted the model to tensorflow lite to be able to use it on android. I would like to view the accuracy, precision and recall values of the converted model. How can I do?
CodePudding user response:
There is no direct API that can be used to measure the accuracy, precision, and recall of the tflite model on Android, but you can always create a TfLite Interpreter instance from the TfLite flatbuffer model, run inference on the testing data, and measure the accuracy/precision/recall on your own.
Here is the link to the official TensorFlow Lite Colab with Java/Android sample code: https://www.tensorflow.org/lite/examples/on_device_training/overview#run_inference_using_trained_weights.
The Java code snippet shows how to create an interpreter instance and run inference on the test data. Once the list of predicted labels is comprised, you can compare it with the list of true labels and come up with precision/recall after computing True/False Positives/Negatives.