From 0224017a50039efef5fbbf92ade07a70d737525f Mon Sep 17 00:00:00 2001 From: pablovela5620 Date: Wed, 4 Dec 2024 12:41:39 -0600 Subject: [PATCH] more linter fixes --- hloc/extract_features.py | 2 +- hloc/extractors/xfeat.py | 2 +- hloc/matchers/lighterglue.py | 5 ++--- hloc/pairs_from_sequential.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hloc/extract_features.py b/hloc/extract_features.py index 309018e8..5594d567 100644 --- a/hloc/extract_features.py +++ b/hloc/extract_features.py @@ -125,7 +125,7 @@ "resize_max": 1024, }, }, - "xfeat": { + "xfeat": { "output": "feats-xfeat-n5000-r1600", "model": { "name": "xfeat", diff --git a/hloc/extractors/xfeat.py b/hloc/extractors/xfeat.py index 342dec0e..5dc230f2 100644 --- a/hloc/extractors/xfeat.py +++ b/hloc/extractors/xfeat.py @@ -30,4 +30,4 @@ def _forward(self, data): "scores": pred["scores"][None], "descriptors": pred["descriptors"].T[None], } - return pred \ No newline at end of file + return pred diff --git a/hloc/matchers/lighterglue.py b/hloc/matchers/lighterglue.py index 52244f47..0bcef9fb 100644 --- a/hloc/matchers/lighterglue.py +++ b/hloc/matchers/lighterglue.py @@ -32,9 +32,8 @@ class LighterGlue(BaseModel): def _init(self, conf): LightGlue_.default_conf = self.default_conf_xfeat self.net = LightGlue_(None, **conf) - state_dict = torch.hub.load_state_dict_from_url( - "https://github.com/verlab/accelerated_features/raw/main/weights/xfeat-lighterglue.pt" - ) + url = "https://github.com/verlab/accelerated_features/raw/main/weights/xfeat-lighterglue.pt" # noqa: E501 + state_dict = torch.hub.load_state_dict_from_url(url) # rename old state dict entries for i in range(self.net.conf.n_layers): diff --git a/hloc/pairs_from_sequential.py b/hloc/pairs_from_sequential.py index 2db13d3d..2f240827 100644 --- a/hloc/pairs_from_sequential.py +++ b/hloc/pairs_from_sequential.py @@ -78,7 +78,7 @@ def main( pairs.append((names_q[i], names_q[i + q])) if use_loop_closure: - retrieval_pairs_tmp: Path = output.parent / f"retrieval-pairs-tmp.txt" + retrieval_pairs_tmp: Path = output.parent / "retrieval-pairs-tmp.txt" # match mask describes for each image, which images NOT to include in retrevial # match search I.e., no reason to get retrieval matches for matches