Cameras (.cameras)#

framing#

infinigen2.cameras.framing.camera_with_distance_framing_objects(...) CameraObject[source]#
Parameters:
  • margin_pct (float) -- What percent of the image width/height should remain empty around the object

  • query_distance -- distance to use for an initial projection of the target object.

  • target_objects (list[pf.MeshObject])

  • direction (pf.Vector)

  • center_location (pf.Vector | None) -- (default: None)

  • camera (CameraObject | None) -- (default: None)

  • use_bbox (bool) -- (default: False)

monocular#

infinigen2.cameras.monocular.linear_pan_camera_rand(...) list[CameraObject][source]#

Dolly travelling in a straight line between two points drawn uniformly in the room interior, at up to speed metres/frame, holding a random fixed yaw and slight downward pitch so the scene slides across the view.

Parameters:
infinigen2.cameras.monocular.monocular_360_camera_rand(...) list[CameraObject][source]#
Parameters:
infinigen2.cameras.monocular.monocular_camera_in_bbox_rand(...) list[CameraObject][source]#
Parameters:
infinigen2.cameras.monocular.orbit_90_camera_rand(...) list[CameraObject][source]#

Eye-level 90-degree orbit around the room centre over the full frame range, for spinout clips. Pair with exporter_frames to render shards (the orbit is deterministic, so every shard follows the identical path).

When bbox is given, the orbit is computed from that interior box so exterior meshes (extruded wall slabs, skylight shafts) can’t inflate the radius and push the camera through the walls; otherwise it falls back to the object bbox.

Parameters:

random_walk#

infinigen2.cameras.random_walk.random_walk_camera(...) CameraObject[source]#
Parameters:

rrt#

exception infinigen2.cameras.rrt.RRTPolicyError[source]#

Bases: ValueError

infinigen2.cameras.rrt.rrt_camera(...) CameraObject[source]#
Parameters:
  • rng (Generator)

  • colliders (CollisionSet)

  • objects (list[pf.MeshObject])

  • frame_start (int) -- (default: 1)

  • frame_end (int) -- (default: 1)

  • focal_length_mm (float) -- (default: 15)

  • margin (float) -- (default: 0.05)

  • step_range (tuple[float, float]) -- (default: (1, 2))

  • stride_range (tuple[int, int]) -- (default: (64, 128))

  • min_node_dist_to_obstacle (float) -- (default: 0.4)

  • max_rrt_iter (int) -- (default: 2000)

  • max_goal_attempts (int) -- (default: 200)

  • max_path_retries (int) -- (default: 80)

  • speed_mps_range (tuple[float, float]) -- (default: (1.0, 1.5))

  • rot_std_deg (tuple[float, float, float]) -- (default: (20.0, 20.0, 20.0))

  • max_abs_roll_deg (float) -- (default: 25.0)

  • max_abs_pitch_offset_deg (float) -- (default: 25.0)

  • step_predicate (Callable[[ndarray], bool] | None) -- (default: None)

  • n_intermediate_checks (int) -- (default: 4)

infinigen2.cameras.rrt.rrt_camera_fast(...) CameraObject[source]#
Parameters:

stereo#

infinigen2.cameras.stereo.attach_stereo_right(
camera_left,
baseline,
focal_length_mm=15,
) list[CameraObject][source]#

Create a right camera parented to camera_left with a baseline offset.

Parameters:
infinigen2.cameras.stereo.sample_baseline(rng, baseline=None) float[source]#
Parameters:
infinigen2.cameras.stereo.stereo_accept_pred(
baseline,
accept_pred=None,
) Callable[[CameraObject, CollisionSet], bool][source]#

Wrap a left-camera accept predicate so the baseline-offset right camera is collision-validated too. Pass to any monocular camera placement (e.g. random_walk_camera) so both eyes are checked at every pose, then realize the right camera with attach_stereo_right().

Parameters:

util#

infinigen2.cameras.util.attach_stereo_right(
camera_left,
baseline,
focal_length_mm=15,
) list[CameraObject][source]#

Create a right camera parented to camera_left with a baseline offset.

Parameters:
infinigen2.cameras.util.camera_collision_check(...) bool[source]#

Return True if camera pose is acceptable (no collision).

Parameters:
infinigen2.cameras.util.camera_transform_collision_check(...) bool[source]#

Return True if a camera collision box at transform is acceptable.

Parameters:
infinigen2.cameras.util.pose_and_filter(...) tuple | None[source]#
Parameters:
infinigen2.cameras.util.total_bbox(objects) tuple[ndarray, ndarray][source]#
Parameters:

objects (list[pf.MeshObject])

Module contents#

infinigen2.cameras.camera_with_distance_framing_objects(...) CameraObject[source]#
Parameters:
  • margin_pct (float) -- What percent of the image width/height should remain empty around the object

  • query_distance -- distance to use for an initial projection of the target object.

  • target_objects (list[pf.MeshObject])

  • direction (pf.Vector)

  • center_location (pf.Vector | None) -- (default: None)

  • camera (CameraObject | None) -- (default: None)

  • use_bbox (bool) -- (default: False)

infinigen2.cameras.monocular_camera_in_bbox_rand(...) list[CameraObject][source]#

Example renders

Parameters:
infinigen2.cameras.monocular_360_camera_rand(...) list[CameraObject][source]#

Example renders

Parameters:
infinigen2.cameras.linear_pan_camera_rand(...) list[CameraObject][source]#

Dolly travelling in a straight line between two points drawn uniformly in the room interior, at up to speed metres/frame, holding a random fixed yaw and slight downward pitch so the scene slides across the view.

Example renders

Parameters:
infinigen2.cameras.orbit_90_camera_rand(...) list[CameraObject][source]#

Eye-level 90-degree orbit around the room centre over the full frame range, for spinout clips. Pair with exporter_frames to render shards (the orbit is deterministic, so every shard follows the identical path).

When bbox is given, the orbit is computed from that interior box so exterior meshes (extruded wall slabs, skylight shafts) can’t inflate the radius and push the camera through the walls; otherwise it falls back to the object bbox.

Example renders

Parameters:
infinigen2.cameras.random_walk_camera(...) CameraObject[source]#

Example renders

Parameters:
infinigen2.cameras.attach_stereo_right(
camera_left,
baseline,
focal_length_mm=15,
) list[CameraObject][source]#

Create a right camera parented to camera_left with a baseline offset.

Parameters:
infinigen2.cameras.sample_baseline(rng, baseline=None) float[source]#
Parameters:
infinigen2.cameras.stereo_accept_pred(
baseline,
accept_pred=None,
) Callable[[CameraObject, CollisionSet], bool][source]#

Wrap a left-camera accept predicate so the baseline-offset right camera is collision-validated too. Pass to any monocular camera placement (e.g. random_walk_camera) so both eyes are checked at every pose, then realize the right camera with attach_stereo_right().

Parameters:
infinigen2.cameras.rrt_camera(...) CameraObject[source]#

Example renders

Parameters:
  • rng (Generator)

  • colliders (CollisionSet)

  • objects (list[pf.MeshObject])

  • frame_start (int) -- (default: 1)

  • frame_end (int) -- (default: 1)

  • focal_length_mm (float) -- (default: 15)

  • margin (float) -- (default: 0.05)

  • step_range (tuple[float, float]) -- (default: (1, 2))

  • stride_range (tuple[int, int]) -- (default: (64, 128))

  • min_node_dist_to_obstacle (float) -- (default: 0.4)

  • max_rrt_iter (int) -- (default: 2000)

  • max_goal_attempts (int) -- (default: 200)

  • max_path_retries (int) -- (default: 80)

  • speed_mps_range (tuple[float, float]) -- (default: (1.0, 1.5))

  • rot_std_deg (tuple[float, float, float]) -- (default: (20.0, 20.0, 20.0))

  • max_abs_roll_deg (float) -- (default: 25.0)

  • max_abs_pitch_offset_deg (float) -- (default: 25.0)

  • step_predicate (Callable[[ndarray], bool] | None) -- (default: None)

  • n_intermediate_checks (int) -- (default: 4)

infinigen2.cameras.rrt_camera_fast(...) CameraObject[source]#

Example renders

Parameters:
infinigen2.cameras.camera_collision_check(...) bool[source]#

Return True if camera pose is acceptable (no collision).

Parameters:
infinigen2.cameras.camera_transform_collision_check(...) bool[source]#

Return True if a camera collision box at transform is acceptable.

Parameters:
infinigen2.cameras.total_bbox(objects) tuple[ndarray, ndarray][source]#
Parameters:

objects (list[pf.MeshObject])