MCPcopy Create free account
hub / github.com/XPandora/PhysGaussian / transform2origin

Function transform2origin

utils/transformation_utils.py:6–16  ·  view source on GitHub ↗
(position_tensor, scale = 1.0)

Source from the content-addressed store, hash-verified

4
5
6def transform2origin(position_tensor, scale = 1.0):
7 min_pos = torch.min(position_tensor, 0)[0]
8 max_pos = torch.max(position_tensor, 0)[0]
9 max_diff = torch.max(max_pos - min_pos)
10 original_mean_pos = (min_pos + max_pos) / 2.0
11 scale = scale / max_diff
12 original_mean_pos = original_mean_pos.to(device="cuda")
13 scale = scale.to(device="cuda")
14 new_position_tensor = (position_tensor - original_mean_pos) * scale
15
16 return new_position_tensor, scale, original_mean_pos
17
18
19def undotransform2origin(position_tensor, scale, original_mean_pos):

Callers 1

gs_simulation.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected