| 327 | self.kf_unoptimized_voxels[0] = False |
| 328 | |
| 329 | def voxel_field_insert_kf(self, insert_ratio): |
| 330 | # compute intersection |
| 331 | voxel_no_repeat, cout = torch.unique(torch.cat([self.last_kf_seen_voxel, |
| 332 | self.seen_voxel], dim=0), return_counts=True, sorted=False, |
| 333 | dim=0) |
| 334 | N_i = voxel_no_repeat[cout > 1].shape[0] |
| 335 | N_a = voxel_no_repeat.shape[0] |
| 336 | ratio = N_i / N_a |
| 337 | if ratio < insert_ratio: |
| 338 | return True |
| 339 | return False |
| 340 | |
| 341 | def get_margin_vox(self, inverse_indices, margin_mask, unique_vox_counts, unique_vox): |
| 342 | unique_inv_id, counts_2 = torch.unique(inverse_indices[margin_mask], dim=0, return_counts=True) |