1 rendering.efm3d_depth_renderer

rendering.efm3d_depth_renderer

CPU ray-based depth renderer using trimesh.

This renderer mirrors the public API of Pytorch3DDepthRenderer but uses pure CPU ray-mesh intersection so it works without a GPU. It is intended as a correctness-oriented fallback and for lightweight testing.

This module provides Efm3dDepthRendererConfig and the trimesh-backed renderer, owning mesh preparation, optional proxy walls, ray construction, and chunked intersection. Candidate selection, depth-to-point-cloud conversion, and RRI scoring remain outside this backend.

1.1 Key features

  • Config-as-factory pattern (BaseConfig.setup_target()).
  • Optional proxy-wall insertion to seal incomplete meshes, using the union of mesh bounds and semidense occupancy extents.
  • Chunked ray casting to avoid excessive memory use on high-res images.
  • Optional PyEmbree backend when available for faster intersections.

1.2 Classes

Name Description
Efm3dDepthRenderer CPU depth renderer built on trimesh ray tracing.
Efm3dDepthRendererConfig Configure correctness-oriented CPU ray casting for metric depth.

1.2.1 Efm3dDepthRenderer

rendering.efm3d_depth_renderer.Efm3dDepthRenderer(config)

CPU depth renderer built on trimesh ray tracing.

1.2.1.1 Attributes

Name Description
device Return the Torch device receiving rendered Tensor["H W"] maps.

1.2.1.2 Methods

Name Description
render_depth Render a depth map for a single pose.
render_batch Render depth for a batch of poses (iterative CPU fallback).
1.2.1.2.1 render_depth
rendering.efm3d_depth_renderer.Efm3dDepthRenderer.render_depth(
    pose_world_cam,
    mesh,
    camera,
    *,
    frame_index=None,
    occupancy_extent=None,
)

Render a depth map for a single pose.

1.2.1.2.1.1 Parameters
Name Type Description Default
pose_world_cam PoseTW T_world_camera pose to render from. required
mesh Trimesh Trimesh instance in world coordinates. required
camera CameraTW Camera intrinsics/extrinsics (CameraTW). required
frame_index int | None Optional frame index for the calib tensor; defaults to the last frame if omitted. None
occupancy_extent Tensor | None Optional [6] tensor [xmin,xmax,ymin,ymax,zmin,zmax] to expand bounds when synthesising proxy walls. None
1.2.1.2.1.2 Returns
Name Type Description
Tensor Tensor[H, W] on config.device filled with zfar on misses.
1.2.1.2.2 render_batch
rendering.efm3d_depth_renderer.Efm3dDepthRenderer.render_batch(
    poses,
    mesh,
    camera,
    *,
    frame_index=None,
    occupancy_extent=None,
)

Render depth for a batch of poses (iterative CPU fallback).

1.2.2 Efm3dDepthRendererConfig

rendering.efm3d_depth_renderer.Efm3dDepthRendererConfig()

Configure correctness-oriented CPU ray casting for metric depth.

Proxy-wall and chunk controls compensate for incomplete ASE room meshes and cap host-memory use. The backend always traces in world geometry, then returns camera z-depth in metres on the configured Torch output device.

1.2.2.1 Attributes

Name Description
target_type Factory target for BaseConfig.setup_target.
device Torch device for the returned depth tensor.
zfar Depth value (metres) for rays that miss the mesh.
add_proxy_walls If True seal missing walls with thin box proxies.
proxy_wall_area_threshold Minimum fraction of expected wall area required to skip proxies.
proxy_eps Epsilon (metres) for detecting faces near bounds.
chunk_rays Number of rays processed per chunk to limit memory.
backend Ray backend: 'auto' (pyembree if available else native),
verbosity Enable structured logging.
is_debug Enable extra debug logging.
Back to top