(inputs, depth_p)
| 136 | return -n / norm |
| 137 | |
| 138 | def visualize_normal(inputs, depth_p): |
| 139 | # Normals |
| 140 | uv = th.stack( |
| 141 | th.meshgrid( |
| 142 | th.arange(depth_p.shape[2]), th.arange(depth_p.shape[1]), indexing="xy" |
| 143 | ), |
| 144 | dim=0, |
| 145 | )[None].float().cuda() |
| 146 | position = depthImgToPosCam_Batched( |
| 147 | depth_p[None, ...], uv, inputs["focal"], inputs["princpt"] |
| 148 | ) |
| 149 | normal = 0.5 * (computeNormalsFromPosCam_Batched(position) + 1.0) |
| 150 | normal = normal[0, [2, 1, 0], :, :] # legacy code assumes BGR format |
| 151 | normal_p = tensor2image(normal, label="normal_p") |
| 152 | |
| 153 | return normal_p |
nothing calls this directly
no test coverage detected