Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Project Aria datasets. #2617

Merged
merged 14 commits into from
Dec 12, 2023

Conversation

sweeneychris
Copy link
Contributor

@sweeneychris sweeneychris commented Nov 16, 2023

  1. An export script for processing Project Aria datasets
  2. Add support for Fisheye624 cameras
  3. Add support for center-crop masking and sampling

Example commands for running nerfstudio on Project Aria data:

python scripts/datasets/process_project_aria.py --vrs_file=<path_to_vrs> --mps_data_dir=<path to MPS directory> --output_dir=<nerfstudio_data_dir>

ns-train nerfacto --data <nerfstudio_data_dir>  nerfstudio-data --orientation-method none

1) An export script for processing Project Aria datasets
2) Add support for Fisheye624 cameras
3) Add support for center-crop masking and sampling

Example commands for running nerfstudio on Project Aria data:

python scripts/datasets/process_project_aria.py --vrs_file=<path_to_vrs> --mps_data_dir=<path to MPS directory> --output_dir=<nerfstudio_data_dir>

ns-train nerfacto --data <nerfstudio_data_dir>  nerfstudio-data --orientation-method none
@brentyi
Copy link
Collaborator

brentyi commented Nov 19, 2023

Had to fiddle with the transforms.json image paths, but I just gave this a try and it worked for me!

From Aria captures in Berkeley:

image

image

@sweeneychris
Copy link
Contributor Author

Awesome! @brentyi could you expand a bit on what changes you needed to make in your transforms.json paths? Is it something I can update in the code?

Copy link
Collaborator

@brentyi brentyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the PR is intentionally still in draft mode, but I left some comments!

nerfstudio/scripts/datasets/process_project_aria.py Outdated Show resolved Hide resolved
nerfstudio/scripts/datasets/process_project_aria.py Outdated Show resolved Hide resolved


# unproject 2D point to 3D with fisheye624 model
def fisheye624_unproject(coords: torch.Tensor, distortion_params: torch.Tensor) -> torch.Tensor:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would nice to annotate (or comment, or assert) the shapes here

nerfstudio/scripts/datasets/process_project_aria.py Outdated Show resolved Hide resolved
@vye16
Copy link
Collaborator

vye16 commented Nov 22, 2023 via email

@sweeneychris
Copy link
Contributor Author

@vye16 Agreed -- it would be a nightmare to write custom kernels for each projection function. It would be nice if you could use jax or functorch to compute the jacobian of the projection functions dynamically (which would allow 3d -> 2d gaussian projection with correct covariance).

Undistorting Aria images for now is the right approach. I'd prefer to leave that for a followup PR if possible

@brentyi
Copy link
Collaborator

brentyi commented Nov 22, 2023

Ok, makes sense to me! Undistortion in a separate PR seems fine. 🙂

@brentyi
Copy link
Collaborator

brentyi commented Dec 11, 2023

Just wondering @sweeneychris, did you have next steps / a timeline in mind for this PR?

@sweeneychris
Copy link
Contributor Author

I plan to work on this today and tomorrow so its ready to check in!

@sweeneychris sweeneychris marked this pull request as ready for review December 11, 2023 18:24
@brentyi
Copy link
Collaborator

brentyi commented Dec 12, 2023

Left a last question above but things look ready to me! I made some minor tweaks: a docs update, dependencies, and exposed the Aria executable via ns-process-data aria.

Also checked the whole pipeline on my machine; here's a render from the data I collected earlier:

aria-nerfstudio-render.mp4

@brentyi brentyi enabled auto-merge (squash) December 12, 2023 22:09
@brentyi brentyi merged commit 6ccbc2d into nerfstudio-project:main Dec 12, 2023
4 checks passed
print("Creating NerfStudio frames...")
CANONICAL_RGB_VALID_RADIUS = 707.5
CANONICAL_RGB_WIDTH = 1408
rgb_valid_radius = CANONICAL_RGB_VALID_RADIUS * (aria_frames[0].camera.width / CANONICAL_RGB_WIDTH)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you get these numbers? On the project aria github linked here, I see different numbers; Is there a reason why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the width? This is just from different recording profiles; the RGB camera can be configured to record at either 1408x1408 (2MP) or 2880x2880 (8MP).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! that makes sense why the comment says "(full res during calibration)"

@brentyi brentyi mentioned this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants