MCPcopy Index your code
hub / github.com/apple/ml-pointersect / render_pcd_with_pointersect

Function render_pcd_with_pointersect

pointersect/inference/main.py:2141–2264  ·  view source on GitHub ↗

Convenient function to render a point cloud with pointersect. Args: input_point_cloud: the filename of a ply file containing the point cloud output_dir: folder storing all outputs model_filename: a pt checkpoint file containing th

(
        input_point_cloud: str,
        output_dir: str,
        model_filename: T.Optional[T.Union[str, T.List[str]]] = None,
        k: int = 40,
        output_camera_trajectory: T.Optional[str] = 'spiral',
        fov: float = 30,
        width_px: int = 200,
        height_px: int = 200,
        n_output_imgs: T.Optional[int] = None,
        ray_chunk_size_ratio: float = 1.,
        render_surfel: bool = True,
        render_poisson: bool = True,
        **kwargs,
)

Source from the content-addressed store, hash-verified

2139
2140
2141def render_pcd_with_pointersect(
2142 input_point_cloud: str,
2143 output_dir: str,
2144 model_filename: T.Optional[T.Union[str, T.List[str]]] = None,
2145 k: int = 40,
2146 output_camera_trajectory: T.Optional[str] = 'spiral',
2147 fov: float = 30,
2148 width_px: int = 200,
2149 height_px: int = 200,
2150 n_output_imgs: T.Optional[int] = None,
2151 ray_chunk_size_ratio: float = 1.,
2152 render_surfel: bool = True,
2153 render_poisson: bool = True,
2154 **kwargs,
2155):
2156 """
2157 Convenient function to render a point cloud with pointersect.
2158
2159 Args:
2160 input_point_cloud:
2161 the filename of a ply file containing the point cloud
2162 output_dir:
2163 folder storing all outputs
2164 model_filename:
2165 a pt checkpoint file containing the pretrained pointersect model.
2166 If `None`, the function uses the default pointersect model.
2167 k:
2168 number of neighboring points used in the rendering per ray
2169 output_camera_trajectory:
2170 The camera trajectory to render the point cloud.
2171 It can be a string containing the preset trajectory
2172 (see :py:`pointersect.structures.CameraTrajectory`),
2173 or it can be a json file in the format described below.
2174 If `None`, it uses `spiral` with 144 images.
2175
2176 Json file format:
2177 H_c2w:
2178 (b, q, 4, 4), a nested list containing the camera pose in the world coord.
2179 `b` is the batch dimension, `q` is number of camera poses in a batch.
2180 For example, `H_c2w[i,j]` is the 4x4 camera pose matrix that converts
2181 a point in the camera coordinate to the world coordinate.
2182
2183 fov:
2184 the horizontal field of view in degree of the output images
2185 width_px:
2186 number of horizontal pixels in the rendered image
2187 height_px:
2188 number of vertial pixels in the rendered image
2189
2190 n_output_imgs:
2191 Total number of output images. It will interpolate the camera trajectory uniformly.
2192 If `None` and `output_camera_trajectory` is provided as a json file, it will use the
2193 camera poses in the json file.
2194
2195 ray_chunk_size_ratio:
2196 The setting controls the number of rays to render per batch. We use some simple
2197 logic to determine the number to try to fill the memory as much as possible.
2198 If run out of memory, please decrease the number. For example, if set to `0.5`,

Callers

nothing calls this directly

Calls 2

render_point_cloudFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected