Skip to content

Commit

Permalink
Revise IMU/TUM docs, enable exporting them by default
Browse files Browse the repository at this point in the history
  • Loading branch information
araistrick authored and pvl-bot committed Aug 13, 2024
1 parent a2667df commit 17ab1fb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
19 changes: 11 additions & 8 deletions docs/GroundTruthAnnotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ To visualize point trajectories for a scene, run:
python infinigen/tools/results/visualize_traj.py path/to/your/scene/frames
```

### Camera Intrinsics & Extrinsics
### Camera Pose

##### Intrinsic & Extrinsic Matrices

Camera intrinsics and extrinsics are stored as a numpy ".npz" file inside the "camview" folder.

Expand All @@ -155,21 +157,22 @@ The camera pose is stored as a 4 x 4 numpy matrix mapping from camera coordinate

As is standard in computer vision, the assumed world coordinate system in the saved camera poses is +X -> Right, +Y -> Down, +Z Forward. This is opposed to how Blender internally represents geometry, with flipped Y and Z axes.

### IMU and TUM

IMU and TUM output is stored as ".txt" files inside the "imu_tum" folder. Enable IMU and TUM collection with config `infinigen_examples/configs_nature/extras/imu.gin`:
##### Camera Velocity / Acceleration (IMU)

```
--configs imu
```
Camera velocity / acceleration is stored as ".txt" files inside the "frames/imu_tum" folder.

Inertial Measurement Unit (IMU) records the rotational velocity and linear acceleration of each camera at each frame. Each row contains the timestamp, rotational velocity (x y z), and linear acceleration (x y z) with each value separated by a space:

```
timestamp rv_x rv_y rv_z a_x a_y a_z
```

The [TUM trajectory format](https://github.com/MichaelGrupp/evo/wiki/Formats#tum---tum-rgb-d-dataset-trajectory-format) records the pose of the camera at each frame. Each row contains the timestamp, position, and rotation (as quarternion) with each value separated by a space:
##### TUM Trajectory Format

For convenience, we also save the trajectories of any animated cameras in the [TUM trajectory format](https://github.com/MichaelGrupp/evo/wiki/Formats#tum---tum-rgb-d-dataset-trajectory-format).


Each row contains the timestamp, position, and rotation (as quarternion) with each value separated by a space:

```
timestamp x y z q_x q_y q_z q_w
Expand Down
2 changes: 0 additions & 2 deletions infinigen_examples/configs_nature/extras/imu.gin

This file was deleted.

10 changes: 3 additions & 7 deletions infinigen_examples/generate_indoors.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,9 @@ def pose_cameras():
def animate_cameras():
cam_util.animate_cameras(camera_rigs, solved_bbox, scene_preprocessed, pois=[])

save_imu_tum_data = overrides.get("save_imu_tum_data")
if save_imu_tum_data:
frames_folder = output_folder.parent / "frames"
animated_cams = [
cam for cam in camera_rigs if cam.animation_data is not None
]
save_imu_tum_files(frames_folder / "imu_tum", animated_cams)
frames_folder = output_folder.parent / "frames"
animated_cams = [cam for cam in camera_rigs if cam.animation_data is not None]
save_imu_tum_files(frames_folder / "imu_tum", animated_cams)

p.run_stage(
"animate_cameras", animate_cameras, use_chance=False, prereq="pose_cameras"
Expand Down
8 changes: 3 additions & 5 deletions infinigen_examples/generate_nature.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,9 @@ def flying_creatures():
def animate_cameras():
cam_util.animate_cameras(camera_rigs, bbox, scene_preprocessed, pois=pois)

save_imu_tum_data = params.get("save_imu_tum_data")
if save_imu_tum_data:
frames_folder = output_folder.parent / "frames"
animated_cams = [cam for cam in camera_rigs if cam.animation_data is not None]
save_imu_tum_files(frames_folder / "imu_tum", animated_cams)
frames_folder = output_folder.parent / "frames"
animated_cams = [cam for cam in camera_rigs if cam.animation_data is not None]
save_imu_tum_files(frames_folder / "imu_tum", animated_cams)

p.run_stage(
"animate_cameras",
Expand Down

0 comments on commit 17ab1fb

Please sign in to comment.