MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / get_pixel_width

Function get_pixel_width

eval_code/recons/models/moge/utils3d/torch/nerf.py:95–107  ·  view source on GitHub ↗

Args: intrinsics: (..., 3, 3) intrinsics matrices. width: width of the image. height: height of the image. Returns: pixel_width: (...) pixel width. = 1 / (normalized focal length * width)

(intrinsics: Tensor, width: int, height: int)

Source from the content-addressed store, hash-verified

93
94
95def get_pixel_width(intrinsics: Tensor, width: int, height: int) -> Tensor:
96 """
97 Args:
98 intrinsics: (..., 3, 3) intrinsics matrices.
99 width: width of the image.
100 height: height of the image.
101
102 Returns:
103 pixel_width: (...) pixel width. = 1 / (normalized focal length * width)
104 """
105 assert width == height, "Currently, only square images are supported."
106 pixel_width = torch.reciprocal((intrinsics[..., 0, 0] * intrinsics[..., 1, 1]).sqrt() * width)
107 return pixel_width
108
109
110def volume_rendering(color: Tensor, sigma: Tensor, z_vals: Tensor, ray_length: Tensor, rgb: bool = True, depth: bool = True) -> Tuple[Tensor, Tensor, Tensor]:

Callers 1

mipnerf_render_viewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected