-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added a pytorch implementation of OmniCV's to remove equilib package usage #2350
Conversation
img: torch.Tensor, shape (batch_size, channels, height, width) | ||
fov: int, field of view | ||
theta: int, left/right angle | ||
phi: int, up/down angle | ||
hd: int, height of perspective image | ||
wd: int, width of perspective image | ||
|
||
return: torch.Tensor, shape (batch_size, channels, hd, wd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow nerfstudio format for docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix
axis: torch.Tensor, shape (3,) | ||
theta: torch.float | ||
|
||
return: torch.Tensor, shape (3, 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow nerfstudio format for docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh oops I'll fix that soon
|
||
from nerfstudio.utils.rich_utils import CONSOLE, ItersPerSecColumn | ||
|
||
|
||
# https://gist.github.com/fgolemo/94b5caf0e209a6e71ab0ce2d75ad3ed8 | ||
def rotation_matrix(axis: torch.Tensor, theta: torch.float) -> torch.Tensor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this functionality already exists -
nerfstudio/nerfstudio/cameras/camera_utils.py
Line 451 in 53c7c8e
def rotation_matrix(a: Float[Tensor, "3"], b: Float[Tensor, "3"]) -> Float[Tensor, "3 3"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh awesome, I'll use that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it turns out the functions were different enough so I just kept the new one but renamed it to decrease confusion. The new one implements Euler-Rodriquez rotation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Looks good, but need to remove the library from the dependency list. |
done |
The equilib package was under a GPL so we couldn't use it in nerfstudio since nerfstudio is MIT. I just implemented the equirectangular to perspective method from this MIT licensed library in pytorch and then used it instead.