【问题标题】:Tensorflow: Determine the output stride of a pretrained CNN modelTensorflow:确定预训练 CNN 模型的输出步幅
【发布时间】: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


    【解决方案1】:

    输出步幅可以通过以下等式获得:

    resolution = ((InputImageSize - 1) / OutputStride) + 1

    示例宽度225像素和输出的输入图像 16 的步幅导致输出大小为 15

    15 = ((225 - 1) / 16) + 1

    对于 tflite PoseNet 模型(分辨率为 9):

    9 = ((257-1)/ x) + 1 x = 32 所以输出步幅是 32

    Source

    【讨论】:

    • 你能否详细说明一下pose net中的输出步幅是多少,在Pose net模型中它的重要性,它是如何计算的以及应该是哪个数字! .请简单解释一下?
    • 请看附件源:在里面,它解释说:“这个参数影响神经网络中层的高度和宽度。在高层次上,它影响精度和速度位姿估计. 输出步幅值越低精度越高但速度越慢, 值越大速度越快但精度较低. 查看输出步幅对输出质量影响的最佳方法是玩单姿势估计演示。”
    • 我想知道为什么会这样,PoseNET里面的原因是什么?
    猜你喜欢
    • 1970-01-01
    • 2020-11-24
    • 2016-07-18
    • 2019-08-15
    • 1970-01-01
    • 2019-09-02
    • 1970-01-01
    • 2019-06-25
    • 1970-01-01
    相关资源
    最近更新 更多