From 4a7ed690a5c7d10059d30f827b46d876351f4acb Mon Sep 17 00:00:00 2001 From: zylo117 Date: Sat, 20 Apr 2024 16:33:29 +0800 Subject: [PATCH] no need to normalize a normalized tensor --- unidepth/models/unidepthv1/decoder.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/unidepth/models/unidepthv1/decoder.py b/unidepth/models/unidepthv1/decoder.py index 7b86657..c29fd09 100644 --- a/unidepth/models/unidepthv1/decoder.py +++ b/unidepth/models/unidepthv1/decoder.py @@ -209,21 +209,9 @@ def forward( # camera_embedding # torch.cuda.synchronize() # start = time() - rays_embedding_16 = F.normalize( - flat_interpolate(rays_hr, old=self.original_shapes, new=shapes), dim=-1 - ) - rays_embedding_8 = F.normalize( - flat_interpolate( - rays_hr, old=self.original_shapes, new=[x * 2 for x in shapes] - ), - dim=-1, - ) - rays_embedding_4 = F.normalize( - flat_interpolate( - rays_hr, old=self.original_shapes, new=[x * 4 for x in shapes] - ), - dim=-1, - ) + rays_embedding_16 = flat_interpolate(rays_hr, old=self.original_shapes, new=shapes) + rays_embedding_8 = flat_interpolate(rays_hr, old=self.original_shapes, new=[x * 2 for x in shapes]) + rays_embedding_4 = flat_interpolate(rays_hr, old=self.original_shapes, new=[x * 4 for x in shapes]) rays_embedding_16 = self.project_rays16(rsh_cart_8(rays_embedding_16)) rays_embedding_8 = self.project_rays8(rsh_cart_8(rays_embedding_8)) rays_embedding_4 = self.project_rays4(rsh_cart_8(rays_embedding_4))