Skip to content

Commit

Permalink
I hate 80 char limit
Browse files Browse the repository at this point in the history
  • Loading branch information
ducha-aiki committed Jan 15, 2024
1 parent 853464a commit 12d4254
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lightglue/dog_hardnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ def extract_single_image(self, image: torch.Tensor):
if num_points is not None and len(pred["keypoints"]) > num_points:
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)
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)
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 Down

0 comments on commit 12d4254

Please sign in to comment.