Skip to content

Commit 086a6b8

Browse files
committed
Better debug message
1 parent 97a4575 commit 086a6b8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

nerf/learned_regularisation/patch_regulariser.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import numpy as np
1010
import torch
1111
import torch.nn as nn
12+
from pytorch3d.transforms import matrix_to_euler_angles
1213
from torch.nn.functional import grid_sample
1314

1415
from .diffusion.denoising_diffusion_pytorch import Unet, GaussianDiffusion, Trainer, \
@@ -331,9 +332,12 @@ def get_loss_for_patch(self, depth_patch, rgb_patch, time, render_outputs,
331332

332333
def _render_random_patch(self, model: NeRFRenderer):
333334
pose = self._pose_generator.generate_random().to(self._device)
334-
print('Pose', pose)
335335
intrinsics = self._get_random_patch_intrinsics(pose)
336-
print('Patch intrinsics', intrinsics)
336+
print('R', np.array_str(
337+
matrix_to_euler_angles(pose[:3, :3], 'XYZ').cpu().numpy(), precision=2
338+
), 'T', np.array_str(
339+
pose[:3, 3].cpu().numpy(), precision=2
340+
), 'f %0.1f %0.1f %0.1f %0.1f' % (intrinsics.fx, intrinsics.fy, intrinsics.cx, intrinsics.cy))
337341
pred_depth, pred_rgb, _, render_outputs = self._render_patch_with_intrinsics(intrinsics=intrinsics,
338342
pose=pose, model=model)
339343
return pred_depth, pred_rgb, render_outputs

0 commit comments

Comments
 (0)