(path)
| 193 | print("Loading pre-computed neck features from tests/ref/") |
| 194 | # Load neck features |
| 195 | def load_tensor(path): |
| 196 | shape = list(map(int, open(path + ".shape").read().strip().split(","))) |
| 197 | data = np.fromfile(path + ".bin", dtype=np.float32).reshape(shape) |
| 198 | return torch.tensor(data) |
| 199 | |
| 200 | # Neck det features: [1, 256, H, H] for scale 2 (72x72) |
| 201 | neck_det_2 = load_tensor(os.path.join(ref_dir, "neck_det_2")) # [1, 256, 72, 72] |