From 12d425410296f44824437ad29b0a057ebfc0ae0f Mon Sep 17 00:00:00 2001 From: Dmytro Mishkin Date: Mon, 15 Jan 2024 13:15:54 +0100 Subject: [PATCH] I hate 80 char limit --- lightglue/dog_hardnet.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)