title: Printing label for Tf Lite model Image Classification
body: <p>I am working on a Image Claasification TF Lite model to detect mask or no mask from human faces using this <a href="https://heartbeat.comet.ml/running-tensorflow-lite-image-classification-models-in-python-92ef44b4cd47" rel="nofollow noreferrer">link</a>. I followed the link and trained an image multi class classification in vertex AI and downloaded the TF lite model. The labels of the model are &quot;mask&quot; and &quot;no_mask&quot;. In order to test the model, I wrote the following code:</p>
  <pre><code>interpret= tf.lite.Interpreter(model_path=&quot;&lt;FILE_PATH&gt;&quot;)
  input= interpret.get_input_details()
  output= interpret.get_output_details()
  
  interpret.allocate_tensors()
  
  pprint(input)
  pprint(output)
  
  data= cv2.imread(&quot;file.jpeg&quot;)
  new_image= cv2.resize(data,(224,224))
  
  interpret.resize_tensor_input(input[0][&quot;index&quot;],[1,224,224,3])
  interpret.allocate_tensors()
  interpret.set_tensor(input[0][&quot;index&quot;],[new_image])
  interpret.invoke()
  result= interpret.get_tensor(output[0]['index'])
  
  print (&quot; Prediction is - {}&quot;.format(result))
  
  </code></pre>
  <p>Using this code for one of my image is giving me the result as :</p>
  <pre><code>[[30 246]]
  </code></pre>
  <p>Now I want to print the label in the result as well. For example:</p>
  <p>mask: 30</p>
  <p>no_mask: 46</p>
  <p>Is there any way I can implement this?</p>
  <p>Please help as I am new to TF Lite</p>