From 07e6693c1d5bf6c8ff28182bd371cf12919ba551 Mon Sep 17 00:00:00 2001 From: xmyqsh Date: Mon, 17 Feb 2020 12:00:43 +0800 Subject: [PATCH] Simplify point-wise multiply by matrix multiply --- code/models/geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/models/geometry.py b/code/models/geometry.py index 7ad46a9..0e61585 100755 --- a/code/models/geometry.py +++ b/code/models/geometry.py @@ -257,7 +257,7 @@ def batch_warp_inverse_depth(p_x, p_y, p_invD, pose, K): x_y_1 = torch.cat((p_x, p_y, I), dim=1) warped = torch.bmm(R, x_y_1.view(B,3,H*W)) + \ - t.view(B,3,1).expand(B,3,H*W) * p_invD.view(B, 1, H*W).expand(B,3,H*W) + torch.bmm(t.view(B,3,1), p_invD.view(B,1,H*W)) x_, y_, s_ = torch.split(warped, 1, dim=1) fx, fy, cx, cy = torch.split(K, 1, dim=1)