We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c06b472 commit 7498c43Copy full SHA for 7498c43
gluefactory/datasets/megadepth.py
@@ -283,9 +283,9 @@ def _read_view(self, scene, idx):
283
k = 0
284
if np.random.rand() < p:
285
k = np.random.choice(2, 1, replace=False)[0] * 2 - 1
286
- img = np.rot90(img, k=-k, axes=(-2, -1))
+ img = torch.rot90(img, k=-k, dims=[1, 2])
287
if self.conf.read_depth:
288
- depth = np.rot90(depth, k=-k, axes=(-2, -1)).copy()
+ depth = torch.rot90(depth, k=-k, dims=[1, 2]).clone()
289
K = rotate_intrinsics(K, img.shape, k + 2)
290
T = rotate_pose_inplane(T, k + 2)
291
@@ -311,8 +311,8 @@ def _read_view(self, scene, idx):
311
features = self.feature_loader({k: [v] for k, v in data.items()})
312
if do_rotate and k != 0:
313
# ang = np.deg2rad(k * 90.)
314
- kpts = features["keypoints"].copy()
315
- x, y = kpts[:, 0].copy(), kpts[:, 1].copy()
+ kpts = features["keypoints"].clone()
+ x, y = kpts[:, 0].clone(), kpts[:, 1].clone()
316
w, h = data["image_size"]
317
if k == 1:
318
kpts[:, 0] = w - y
0 commit comments