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

Function normalize_gridcloud2d

TEACh/utils/basic.py:223–235  ·  view source on GitHub ↗
(xy, Y, X, clamp_extreme=True)

Source from the content-addressed store, hash-verified

221 return xyz
222
223def normalize_gridcloud2d(xy, Y, X, clamp_extreme=True):
224 # make things in [-1,1]
225 x = xy[...,0]
226 y = xy[...,1]
227
228 y = 2.0*(y / float(Y-1)) - 1.0
229 x = 2.0*(x / float(X-1)) - 1.0
230
231 xy = torch.stack([x,y], dim=-1)
232
233 if clamp_extreme:
234 xy = torch.clamp(xy, min=-2.0, max=2.0)
235 return xy
236
237def meshgrid3d_yxz(B, Y, X, Z):
238 # returns a meshgrid sized B x Y x X x Z

Callers 1

resample2dFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected