androidtensorflowkotlintensorflow-lite

How to extract labels.txt file from tflite file?


I am trying to extract labels.txt file from coco_ssd_mobilenet_v1_1.0_quant.tflite but I don't know how to do it

output file should look like below :

apple boy bat phone

like this but I can't be able to do it for using it in Kotlin android app development. I am a beginner so sorry for my mistake.

Link of the Tensor flow file

Link of the docs


Solution

  • There is no easy way to extract label file from a model(You can make use of debugger or model inspector's for the same) . The tensorflow lite file you have referred along with the labels can be found at Tensorflow's github . The path for the label is :

    https://github.com/tensorflow/examples/blob/master/lite/examples/object_detection/android/app/src/main/assets/labelmap.txt

    This are the labels for the which the model is trained for .