(self, x)
| 122 | return g |
| 123 | |
| 124 | def common_forward(self, x): |
| 125 | # x: [N, 3], in [-bound, bound] |
| 126 | |
| 127 | # sigma |
| 128 | h = self.encoder(x, bound=self.bound) |
| 129 | |
| 130 | h = self.sigma_net(h) |
| 131 | |
| 132 | sigma = trunc_exp(h[..., 0] + self.gaussian(x)) |
| 133 | albedo = torch.sigmoid(h[..., 1:]) |
| 134 | |
| 135 | return sigma, albedo |
| 136 | |
| 137 | # ref: https://github.com/zhaofuq/Instant-NSR/blob/main/nerf/network_sdf.py#L192 |
| 138 | def finite_difference_normal(self, x, epsilon=1e-2): |
no test coverage detected