Cameras (.cameras)#
framing#
- infinigen2.cameras.framing.camera_with_distance_framing_object(...)[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_object (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:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
dimensions (pf.Vector | None) -- (default:
None)frame_start (int) -- (default:
0)frame_end (int) -- (default:
72)focal_length_mm (float) -- (default:
15)speed (float) -- (default:
0.04)footprint_frac (float) -- (default:
0.4)forward_clearance (float) -- (default:
0.75)max_tries (int) -- (default:
200)
- infinigen2.cameras.monocular.material_orbit_camera_rand(...) list[CameraObject][source]#
Full 360-degree orbit at fixed radius/height around the world Z axis while aiming at (0, 0, target_z), for material-preview turntables. Matches the material_sphere default camera (radius/height/lens). Geometry is fixed (not derived from the scene bbox) so the path is identical across materials/seeds and exporter-frame shards stitch seamlessly. lens_mm is deliberately not named focal_length_mm so the --focal_length_mm pipeline arg can’t override it.
- infinigen2.cameras.monocular.monocular_360_camera_rand(...) list[CameraObject][source]#
- Parameters:
objects (list[pf.MeshObject])
camera (CameraObject | None) -- (default:
None)radius (float | None) -- (default:
None)height (float | None) -- (default:
None)frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)focal_length_mm (float) -- (default:
15)total_angle_rad (float) -- (default:
6.283)
- infinigen2.cameras.monocular.monocular_camera_in_bbox_rand(...) list[CameraObject][source]#
- Parameters:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)margin (float) -- (default:
0.05)max_tries (int) -- (default:
100)focal_length_mm (float) -- (default:
15)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)
- 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 dimensions is given, the orbit is computed from the room interior 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.
random_walk#
- infinigen2.cameras.random_walk.random_walk_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)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)max_retries (int) -- (default:
20)speed_mps_range (tuple[float, float]) -- (default:
(1.33, 2.0))loc_step_range (tuple[float, float]) -- (default:
(1.0, 4.0))rot_std_deg (tuple[float, float, float]) -- (default:
(15.0, 15.0, 30.0))roll_range_deg (tuple[float, float]) -- (default:
(-25.0, 25.0))pitch_range_deg (tuple[float, float]) -- (default:
(45.0, 135.0))height_range (tuple[float, float] | None) -- (default:
(0.5, 2.2))loc_bias (ndarray | None) -- (default:
None)
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)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:
rng (Generator)
colliders (CollisionSet)
objects (list[pf.MeshObject])
frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)focal_length_mm (float) -- (default:
15)speed_mps_range (tuple[float, float]) -- (default:
(5.0, 7.5))step_predicate (Callable[[ndarray], bool] | None) -- (default:
None)n_intermediate_checks (int) -- (default:
4)
stereo#
- infinigen2.cameras.stereo.stereo_camera_rig_rand(
- rng,
- focal_length_mm=15,
- baseline=None,
- infinigen2.cameras.stereo.stereo_cameras_in_bbox_rand(...) list[CameraObject][source]#
- Parameters:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)margin (float) -- (default:
0.05)max_tries (int) -- (default:
100)focal_length_mm (float) -- (default:
15)baseline (float | None) -- (default:
None)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)
- infinigen2.cameras.stereo.stereo_random_walk_camera(...) list[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)baseline (float | None) -- (default:
None)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)max_retries (int) -- (default:
20)speed_mps_range (tuple[float, float]) -- (default:
(2.0, 3.0))loc_step_range (tuple[float, float]) -- (default:
(1.0, 4.0))rot_std_deg (tuple[float, float, float]) -- (default:
(15.0, 15.0, 30.0))roll_range_deg (tuple[float, float]) -- (default:
(-25.0, 25.0))pitch_range_deg (tuple[float, float]) -- (default:
(45.0, 135.0))height_range (tuple[float, float] | None) -- (default:
None)loc_bias (ndarray | None) -- (default:
None)
util#
- infinigen2.cameras.util.attach_stereo_right(
- camera_left,
- baseline,
- focal_length_mm=15,
Create a right camera parented to camera_left with a baseline offset.
- Parameters:
camera_left (CameraObject)
baseline (float)
focal_length_mm (float) -- (default:
15)
- infinigen2.cameras.util.camera_collision_check(...) bool[source]#
Return True if camera pose is acceptable (no collision).
- Parameters:
camera (CameraObject)
colliders (CollisionSet)
probe_offset (float) -- (default:
0.0)probe_size (float) -- (default:
0.75)forward_clearance (float) -- (default:
0.0)
- infinigen2.cameras.util.pose_and_filter(...) tuple | None[source]#
- Parameters:
r (Generator)
cam (CameraObject)
colliders (CollisionSet | None)
accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)
Module contents#
- infinigen2.cameras.camera_with_distance_framing_object(...)[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_object (pf.MeshObject)
direction (pf.Vector)
center_location (pf.Vector | None) -- (default:
None)camera (CameraObject | None) -- (default:
None)use_bbox (bool) -- (default:
False)
- infinigen2.cameras.stereo_cameras_in_bbox_rand(...) list[CameraObject][source]#
- Parameters:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)margin (float) -- (default:
0.05)max_tries (int) -- (default:
100)focal_length_mm (float) -- (default:
15)baseline (float | None) -- (default:
None)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)
- infinigen2.cameras.stereo_random_walk_camera(...) list[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)baseline (float | None) -- (default:
None)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)max_retries (int) -- (default:
20)speed_mps_range (tuple[float, float]) -- (default:
(2.0, 3.0))loc_step_range (tuple[float, float]) -- (default:
(1.0, 4.0))rot_std_deg (tuple[float, float, float]) -- (default:
(15.0, 15.0, 30.0))roll_range_deg (tuple[float, float]) -- (default:
(-25.0, 25.0))pitch_range_deg (tuple[float, float]) -- (default:
(45.0, 135.0))height_range (tuple[float, float] | None) -- (default:
None)loc_bias (ndarray | None) -- (default:
None)
- infinigen2.cameras.monocular_camera_in_bbox_rand(...) list[CameraObject][source]#
- Parameters:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)margin (float) -- (default:
0.05)max_tries (int) -- (default:
100)focal_length_mm (float) -- (default:
15)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)
- infinigen2.cameras.monocular_360_camera_rand(...) list[CameraObject][source]#
- Parameters:
objects (list[pf.MeshObject])
camera (CameraObject | None) -- (default:
None)radius (float | None) -- (default:
None)height (float | None) -- (default:
None)frame_start (int) -- (default:
1)frame_end (int) -- (default:
1)focal_length_mm (float) -- (default:
15)total_angle_rad (float) -- (default:
6.283)
- 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.
- Parameters:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
dimensions (pf.Vector | None) -- (default:
None)frame_start (int) -- (default:
0)frame_end (int) -- (default:
72)focal_length_mm (float) -- (default:
15)speed (float) -- (default:
0.04)footprint_frac (float) -- (default:
0.4)forward_clearance (float) -- (default:
0.75)max_tries (int) -- (default:
200)
- 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 dimensions is given, the orbit is computed from the room interior 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.
- infinigen2.cameras.material_orbit_camera_rand(...) list[CameraObject][source]#
Full 360-degree orbit at fixed radius/height around the world Z axis while aiming at (0, 0, target_z), for material-preview turntables. Matches the material_sphere default camera (radius/height/lens). Geometry is fixed (not derived from the scene bbox) so the path is identical across materials/seeds and exporter-frame shards stitch seamlessly. lens_mm is deliberately not named focal_length_mm so the --focal_length_mm pipeline arg can’t override it.
- infinigen2.cameras.random_walk_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)accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)max_retries (int) -- (default:
20)speed_mps_range (tuple[float, float]) -- (default:
(1.33, 2.0))loc_step_range (tuple[float, float]) -- (default:
(1.0, 4.0))rot_std_deg (tuple[float, float, float]) -- (default:
(15.0, 15.0, 30.0))roll_range_deg (tuple[float, float]) -- (default:
(-25.0, 25.0))pitch_range_deg (tuple[float, float]) -- (default:
(45.0, 135.0))height_range (tuple[float, float] | None) -- (default:
(0.5, 2.2))loc_bias (ndarray | None) -- (default:
None)
- infinigen2.cameras.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)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]#
- 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)speed_mps_range (tuple[float, float]) -- (default:
(5.0, 7.5))step_predicate (Callable[[ndarray], bool] | None) -- (default:
None)n_intermediate_checks (int) -- (default:
4)
- infinigen2.cameras.camera_collision_check(...) bool[source]#
Return True if camera pose is acceptable (no collision).
- Parameters:
camera (CameraObject)
colliders (CollisionSet)
probe_offset (float) -- (default:
0.0)probe_size (float) -- (default:
0.75)forward_clearance (float) -- (default:
0.0)