TFG|已知物体空间位置估计

TensorFlow又出了一个好玩的开源库：Graphics，主要解决从渲染器最终渲染结果逆推出各Mesh的Transform和Rotation。本文为官方提供的入门项目Object pose estimation的阅读笔记，代码均摘自源文件中。

Object pose alignment

• 机器学习：使用一个简单的神经网络进行深度学习。
• 数学优化

1.深度学习方法

定义模型

• 拆分输出项：将(,7)拆分为(,4)(,3)
• 用预测值对3D模型形变
• 用正确值还原对3D模型的形变
• 求出所有顶点偏移距离的平方（二阶范数）和
• 返回单个batch的error平均值

2. Mathematical optimization

Here the problem is tackled using mathematical optimization, which is another traditional way to approach the problem of object pose estimation. Given correspondences between the object in ‘rest pose’ (pastel lemon color) and its rotated and translated counter part (pastel honeydew color), the problem can be formulated as a minimization problem. The loss function can for instance be defined as the sum of Euclidean distances between the corresponding points using the current estimate of the rotation and translation of the transformed object. One can then compute the derivative of the rotation and translation parameters with respect to this loss function, and follow the gradient direction until convergence. The following cell closely follows that procedure, and uses gradient descent to align the two objects. It is worth noting that although the results are good, there are more efficient ways to solve this specific problem. The interested reader is referred to the Kabsch algorithm for further details.

Note: press play multiple times to sample different test cases.

Define the loss and gradient functions:

Create the optimizer.

Initialize the random transformation, run the optimization and animate the result.

Share