mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-14 19:36:23 +08:00
Deprecate so3_exponential_map
Summary: Deprecate the `so3_exponential_map()` function in favor of its alias `so3_exp_map()`: this aligns with the naming of `so3_log_map()` and the recently introduced `se3_exp_map()` / `se3_log_map()` pair. Reviewed By: bottler Differential Revision: D29329966 fbshipit-source-id: b6f60b9e86b2995f70b1fbeb16f9feea05c55de9
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f593bfd3c2
commit
5284de6e97
@@ -41,7 +41,7 @@
|
||||
"Our optimization seeks to align the estimated (orange) cameras with the ground truth (purple) cameras, by minimizing the discrepancies between pairs of relative cameras. Thus, the solution to the problem should look as follows:\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"In practice, the camera extrinsics $g_{ij}$ and $g_i$ are represented using objects from the `SfMPerspectiveCameras` class initialized with the corresponding rotation and translation matrices `R_absolute` and `T_absolute` that define the extrinsic parameters $g = (R, T); R \\in SO(3); T \\in \\mathbb{R}^3$. In order to ensure that `R_absolute` is a valid rotation matrix, we represent it using an exponential map (implemented with `so3_exponential_map`) of the axis-angle representation of the rotation `log_R_absolute`.\n",
|
||||
"In practice, the camera extrinsics $g_{ij}$ and $g_i$ are represented using objects from the `SfMPerspectiveCameras` class initialized with the corresponding rotation and translation matrices `R_absolute` and `T_absolute` that define the extrinsic parameters $g = (R, T); R \\in SO(3); T \\in \\mathbb{R}^3$. In order to ensure that `R_absolute` is a valid rotation matrix, we represent it using an exponential map (implemented with `so3_exp_map`) of the axis-angle representation of the rotation `log_R_absolute`.\n",
|
||||
"\n",
|
||||
"Note that the solution to this problem could only be recovered up to an unknown global rigid transformation $g_{glob} \\in SE(3)$. Thus, for simplicity, we assume knowledge of the absolute extrinsics of the first camera $g_0$. We set $g_0$ as a trivial camera $g_0 = (I, \\vec{0})$.\n"
|
||||
]
|
||||
@@ -122,7 +122,7 @@
|
||||
"# imports\n",
|
||||
"import torch\n",
|
||||
"from pytorch3d.transforms.so3 import (\n",
|
||||
" so3_exponential_map,\n",
|
||||
" so3_exp_map,\n",
|
||||
" so3_relative_angle,\n",
|
||||
")\n",
|
||||
"from pytorch3d.renderer.cameras import (\n",
|
||||
@@ -328,7 +328,7 @@
|
||||
"\n",
|
||||
"As mentioned earlier, `log_R_absolute` is the axis angle representation of the rotation part of our absolute cameras. We can obtain the 3x3 rotation matrix `R_absolute` that corresponds to `log_R_absolute` with:\n",
|
||||
"\n",
|
||||
"`R_absolute = so3_exponential_map(log_R_absolute)`\n"
|
||||
"`R_absolute = so3_exp_map(log_R_absolute)`\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -378,7 +378,7 @@
|
||||
" # compute the absolute camera rotations as \n",
|
||||
" # an exponential map of the logarithms (=axis-angles)\n",
|
||||
" # of the absolute rotations\n",
|
||||
" R_absolute = so3_exponential_map(log_R_absolute * camera_mask)\n",
|
||||
" R_absolute = so3_exp_map(log_R_absolute * camera_mask)\n",
|
||||
"\n",
|
||||
" # get the current absolute cameras\n",
|
||||
" cameras_absolute = SfMPerspectiveCameras(\n",
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
"\n",
|
||||
"# Data structures and functions for rendering\n",
|
||||
"from pytorch3d.structures import Volumes\n",
|
||||
"from pytorch3d.transforms import so3_exponential_map\n",
|
||||
"from pytorch3d.transforms import so3_exp_map\n",
|
||||
"from pytorch3d.renderer import (\n",
|
||||
" FoVPerspectiveCameras, \n",
|
||||
" NDCGridRaysampler,\n",
|
||||
@@ -803,7 +803,7 @@
|
||||
"def generate_rotating_nerf(neural_radiance_field, n_frames = 50):\n",
|
||||
" logRs = torch.zeros(n_frames, 3, device=device)\n",
|
||||
" logRs[:, 1] = torch.linspace(-3.14, 3.14, n_frames, device=device)\n",
|
||||
" Rs = so3_exponential_map(logRs)\n",
|
||||
" Rs = so3_exp_map(logRs)\n",
|
||||
" Ts = torch.zeros(n_frames, 3, device=device)\n",
|
||||
" Ts[:, 2] = 2.7\n",
|
||||
" frames = []\n",
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
" NDCGridRaysampler,\n",
|
||||
" EmissionAbsorptionRaymarcher\n",
|
||||
")\n",
|
||||
"from pytorch3d.transforms import so3_exponential_map\n",
|
||||
"from pytorch3d.transforms import so3_exp_map\n",
|
||||
"\n",
|
||||
"# add path for demo utils functions \n",
|
||||
"sys.path.append(os.path.abspath(''))\n",
|
||||
@@ -405,7 +405,7 @@
|
||||
"def generate_rotating_volume(volume_model, n_frames = 50):\n",
|
||||
" logRs = torch.zeros(n_frames, 3, device=device)\n",
|
||||
" logRs[:, 1] = torch.linspace(0.0, 2.0 * 3.14, n_frames, device=device)\n",
|
||||
" Rs = so3_exponential_map(logRs)\n",
|
||||
" Rs = so3_exp_map(logRs)\n",
|
||||
" Ts = torch.zeros(n_frames, 3, device=device)\n",
|
||||
" Ts[:, 2] = 2.7\n",
|
||||
" frames = []\n",
|
||||
|
||||
Reference in New Issue
Block a user