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:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
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.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 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.
random_walk#
- infinigen2.cameras.random_walk.random_walk_camera(...) CameraObject[source]#
- Parameters:
rng (Generator)
colliders (CollisionSet)
objects (list[pf.MeshObject])
camera (CameraObject | None) -- (default:
None)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_tries (int) -- (default:
20)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))
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.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.stereo.stereo_accept_pred(
- baseline,
- accept_pred=None,
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 withattach_stereo_right().- Parameters:
baseline (float)
accept_pred (Callable[[CameraObject, CollisionSet], bool] | 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.camera_transform_collision_check(...) bool[source]#
Return True if a camera collision box at transform is acceptable.
- Parameters:
transform (ndarray)
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_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:
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]#
Example renders
- 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.
Example renders
- Parameters:
rng (Generator)
objects (list[pf.MeshObject])
colliders (CollisionSet)
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 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
- infinigen2.cameras.random_walk_camera(...) CameraObject[source]#
Example renders
- Parameters:
rng (Generator)
colliders (CollisionSet)
objects (list[pf.MeshObject])
camera (CameraObject | None) -- (default:
None)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_tries (int) -- (default:
20)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))
- infinigen2.cameras.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.stereo_accept_pred(
- baseline,
- accept_pred=None,
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 withattach_stereo_right().- Parameters:
baseline (float)
accept_pred (Callable[[CameraObject, CollisionSet], bool] | None) -- (default:
None)
- 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)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:
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)
- infinigen2.cameras.camera_transform_collision_check(...) bool[source]#
Return True if a camera collision box at transform is acceptable.
- Parameters:
transform (ndarray)
colliders (CollisionSet)
probe_offset (float) -- (default:
0.0)probe_size (float) -- (default:
0.75)forward_clearance (float) -- (default:
0.0)