MCPcopy Create free account
hub / github.com/dcharatan/flowmap / project_camera_space

Function project_camera_space

flowmap/model/projection.py:49–58  ·  view source on GitHub ↗
(
    points: Float[Tensor, "*#batch dim"],
    intrinsics: Float[Tensor, "*#batch dim dim"],
    epsilon: float = 1e-5,
    infinity: float = 1e8,
)

Source from the content-addressed store, hash-verified

47
48
49def project_camera_space(
50 points: Float[Tensor, "*#batch dim"],
51 intrinsics: Float[Tensor, "*#batch dim dim"],
52 epsilon: float = 1e-5,
53 infinity: float = 1e8,
54) -> Float[Tensor, "*batch dim-1"]:
55 points = points / (points[..., -1:] + epsilon)
56 points = points.nan_to_num(posinf=infinity, neginf=-infinity)
57 points = einsum(intrinsics, points, "... i j, ... j -> ... i")
58 return points[..., :-1]
59
60
61def project(

Callers 3

projectFunction · 0.85
reproject_pointsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected