【发布时间】:2021-04-14 04:03:38
【问题描述】:
我已经下载并正在使用Tensorflow Lite Posenet Model 实现一个机器学习应用程序。这个模型的输出是一个热图,它是 CNN 的一部分,我是新手。
处理输出所需的一条信息是“输出步幅”。它用于计算在原始图像中找到的关键点的原始坐标。
keypointPositions = heatmapPositions * outputStride + offsetVectors
但是documentation 没有指定输出步幅。 tensorflow 中是否有可用的信息或方法可用于获取此(任何)预训练模型的输出步幅?
- img 的输入形状为:
(257,257,3) - 输出形状为:
(9,9,17)(1 [9x9] 17 个不同关键点的热图)
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)
【问题讨论】:
标签: python tensorflow tensorflow-lite pose-estimation