【问题标题】:MediaPipe TensorflowLite Iris ModelMediaPipe TensorflowLite 虹膜模型
【发布时间】:2020-08-22 20:55:32
【问题描述】:

我正在尝试了解 mediapipe 提供的 tflite Iris landmarks model 的输出。

model card 将输出描述为 71 个 2D 地标和 5 个 2D 地标。检查模型时如下:

interpreter = tf.lite.Interpreter(model_path='iris_landmark.tflite')
interpreter.allocate_tensors()
output_details = interpreter.get_output_details()

print(output_details)
[{'dtype': numpy.float32,
  'index': 384,
  'name': 'output_eyes_contours_and_brows',
  'quantization': (0.0, 0),
  'quantization_parameters': {'quantized_dimension': 0,
   'scales': array([], dtype=float32),
   'zero_points': array([], dtype=int32)},
  'shape': array([  1, 213], dtype=int32),
  'shape_signature': array([  1, 213], dtype=int32),
  'sparsity_parameters': {}},
 {'dtype': numpy.float32,
  'index': 385,
  'name': 'output_iris',
  'quantization': (0.0, 0),
  'quantization_parameters': {'quantized_dimension': 0,
   'scales': array([], dtype=float32),
   'zero_points': array([], dtype=int32)},
  'shape': array([ 1, 15], dtype=int32),
  'shape_signature': array([ 1, 15], dtype=int32),
  'sparsity_parameters': {}}]

我在模型输出中看到 213 个值和 15 个值 - 所以我假设我得到了每个点的 x/y/z 坐标。在图像上运行模型后,我得到 -7000 到 +7000 范围内的值。我的输入是一个 64x64 的图像,你知道这些点如何对应于原始图像吗?

我想要眼睛关键点的像素坐标,它们在媒体管道示例中呈现。

【问题讨论】:

    标签: computer-vision tensorflow-lite mediapipe


    【解决方案1】:

    模型卡貌似错了,其实是输出3D坐标,模型输入输出也有一些归一化,不清楚,是用来画2d地标的。

    我用我的发现 here 打开了一个 github 问题。我没有看到任何与模型卡相关的变化。

    我创建了一个 colab 来演示如何正确使用 here。您可以忽略 z 坐标并将 x/y 坐标绘制到图像上以查看地标。

    我可能应该用虹膜图片示例更新 colab。

    【讨论】:

      猜你喜欢
      • 2022-06-29
      • 1970-01-01
      • 2020-05-24
      • 2021-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-14
      • 1970-01-01
      相关资源
      最近更新 更多