Spaces:
Runtime error
Runtime error
File size: 497 Bytes
c7f097c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import torch
import torch.nn as nn
import torch.nn.functional as F
class DepthNormalizer(nn.Module):
def __init__(self, opt):
super(DepthNormalizer, self).__init__()
self.opt = opt
def forward(self, z, calibs=None, index_feat=None):
'''
Normalize z_feature
:param z_feat: [B, 1, N] depth value for z in the image coordinate system
:return:
'''
z_feat = z * (self.opt.loadSize // 2) / self.opt.z_size
return z_feat
|