MediaPipe TensorflowLite Iris模型

问题描述

我试图了解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,'sparsity_parameters': {}},{'dtype': numpy.float32,'index': 385,'name': 'output_iris','shape': array([ 1,15],'shape_signature': array([ 1,'sparsity_parameters': {}}]

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

我想获得在mediapipe示例中呈现的眼睛关键点的像素坐标。

解决方法

模型卡好像是错的,其实输出的是3D坐标,模型输入输出也有一些归一化不清楚,但是用来绘制2d地标。

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

我创建了一个 colab,展示了正确的用法,here。您可以忽略 z 坐标并将 x/y 坐标绘制到图像上以查看地标。

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...