Skip to content

Commit

Permalink
lint2?
Browse files Browse the repository at this point in the history
  • Loading branch information
ducha-aiki committed Jan 15, 2024
1 parent d928473 commit 853464a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lightglue/dog_hardnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def extract_single_image(self, image: torch.Tensor):
indices = torch.topk(pred["keypoint_scores"], num_points).indices
pred = {k: v[indices] for k, v in pred.items()}
lafs = laf_from_center_scale_ori(pred["keypoints"].reshape(1, -1, 2),
6.0 * pred["scales"].reshape(1, -1, 1, 1),
torch.rad2deg(pred["oris"]).reshape(1, -1, 1)).to(device)
6.0 * pred["scales"].reshape(1, -1, 1, 1),
torch.rad2deg(pred["oris"]).reshape(1, -1, 1)).to(device)
self.laf_desc = self.laf_desc.to(device)
self.laf_desc.descriptor = self.laf_desc.descriptor.eval()
pred["descriptors"] = self.laf_desc(image[None], lafs).reshape(-1, 128)
Expand All @@ -220,4 +220,3 @@ def _forward(self, data: dict) -> dict:
pred.append(p)
pred = {k: torch.stack([p[k] for p in pred], 0).to(device) for k in pred[0]}
return pred

0 comments on commit 853464a

Please sign in to comment.