MCPcopy Create free account
hub / github.com/Gabesarch/ICAL / normalize_gridcloud3d

Function normalize_gridcloud3d

TEACh/utils/basic.py:207–221  ·  view source on GitHub ↗
(xyz, Z, Y, X, clamp_extreme=True)

Source from the content-addressed store, hash-verified

205 return grid_y, grid_x
206
207def normalize_gridcloud3d(xyz, Z, Y, X, clamp_extreme=True):
208 # make things in [-1,1]
209 x = xyz[...,0]
210 y = xyz[...,1]
211 z = xyz[...,2]
212
213 z = 2.0*(z / float(Z-1)) - 1.0
214 y = 2.0*(y / float(Y-1)) - 1.0
215 x = 2.0*(x / float(X-1)) - 1.0
216
217 xyz = torch.stack([x,y,z], dim=-1)
218
219 if clamp_extreme:
220 xyz = torch.clamp(xyz, min=-2.0, max=2.0)
221 return xyz
222
223def normalize_gridcloud2d(xy, Y, X, clamp_extreme=True):
224 # make things in [-1,1]

Callers 2

resample3dFunction · 0.85
sample3dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected