I have downloaded and am implementing a ML application using the Tensorflow Lite Posenet Model. The output of this model is a heatmap, which is a part of CNN's I am new to.
One piece of information required to process the output is the "output stride". It is used to calculate the original coordinates of the keypoints found in the original image.
keypointPositions = heatmapPositions * outputStride + offsetVectors
But the documentation doesn't specify the output stride. Is there information or a way available in tensorflow I can use to get the output stride for this (any) pre-trained model?
- The input shape for an img is:
(257,257,3)
- The output shape is:
(9,9,17)
(1 [9x9] heatmap for 17 different keypoints)
import tensorflow as tf
import numpy as np
import json
model = tf.lite.Interpreter('models\posenet_mobilenet_v1_100_257x257_multi_kpt_stripped.tflite')
model.allocate_tensors()
with open('model_details.json', 'w') as outfile:
info = dict(list(enumerate(model.get_tensor_details())))
s = json.dumps(str(info))
outfile.write(s)