MCPcopy Create free account
hub / github.com/Atrovast/THGS / normalize

Function normalize

utils/render_utils.py:28–30  ·  view source on GitHub ↗

Normalization helper function.

(x: np.ndarray)

Source from the content-addressed store, hash-verified

26import torch
27
28def normalize(x: np.ndarray) -> np.ndarray:
29 """Normalization helper function."""
30 return x / np.linalg.norm(x)
31
32def pad_poses(p: np.ndarray) -> np.ndarray:
33 """Pad [..., 3, 4] pose matrices with a homogeneous bottom row [0,0,0,1]."""

Callers 2

viewmatrixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected