pc: NxC, return NxC
(pc)
| 50 | |
| 51 | |
| 52 | def pc_norm(pc): |
| 53 | """ pc: NxC, return NxC """ |
| 54 | xyz = pc[:, :3] |
| 55 | other_feature = pc[:, 3:] |
| 56 | |
| 57 | centroid = torch.mean(xyz, dim=0) |
| 58 | xyz = xyz - centroid |
| 59 | m = torch.max(torch.sqrt(torch.sum(xyz ** 2, dim=1))) |
| 60 | xyz = xyz / m |
| 61 | |
| 62 | pc = torch.cat((xyz, other_feature), dim=1) |
| 63 | return pc |
| 64 | |
| 65 | |
| 66 | def make_audio_features(wav_name, mel_bins=128, target_length=1024, aug=False): |
no test coverage detected