From a8ab6a76a7870e232b1f0f507aea87270f6ea5e7 Mon Sep 17 00:00:00 2001 From: Realcat Date: Tue, 29 Oct 2024 16:35:00 +0000 Subject: [PATCH] fix: https://github.com/verlab/accelerated_features/pull/71 --- hloc/matchers/xfeat_lightglue.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hloc/matchers/xfeat_lightglue.py b/hloc/matchers/xfeat_lightglue.py index f875361..37cd980 100644 --- a/hloc/matchers/xfeat_lightglue.py +++ b/hloc/matchers/xfeat_lightglue.py @@ -37,7 +37,11 @@ def _forward(self, data): ] out0.update({"image_size": (im0.shape[-1], im0.shape[-2])}) # W H out1.update({"image_size": (im1.shape[-1], im1.shape[-2])}) # W H - mkpts_0, mkpts_1 = self.net.match_lighterglue(out0, out1) + pred = self.net.match_lighterglue(out0, out1) + if len(pred) == 3: + mkpts_0, mkpts_1, _ = pred + else: + mkpts_0, mkpts_1 = pred mkpts_0 = torch.from_numpy(mkpts_0) # n x 2 mkpts_1 = torch.from_numpy(mkpts_1) # n x 2 pred = {