diff --git a/lightglue/dog_hardnet.py b/lightglue/dog_hardnet.py index 37c4fbc..2fc606a 100644 --- a/lightglue/dog_hardnet.py +++ b/lightglue/dog_hardnet.py @@ -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)