diff --git a/hloc/extract_features.py b/hloc/extract_features.py index 53130ab5..c53e68f0 100644 --- a/hloc/extract_features.py +++ b/hloc/extract_features.py @@ -114,6 +114,34 @@ "resize_max": 1600, }, }, + "aliked-n16-rot": { + "output": "feats-aliked-n16-rot", + "model": { + "name": "aliked", + "model_name": "aliked-n16-rot", + "max_num_keypoints": -1, + "detection_threshold": 0.2, + "nms_radius": 2, + }, + "preprocessing": { + "grayscale": False, + "resize_max": 1024, + }, + }, + "aliked-n32": { + "output": "feats-aliked-n32", + "model": { + "name": "aliked", + "model_name": "aliked-n32", + "max_num_keypoints": -1, + "detection_threshold": 0.2, + "nms_radius": 2, + }, + "preprocessing": { + "grayscale": False, + "resize_max": 1024, + }, + }, # Global descriptors "dir": { "output": "global-feats-dir", diff --git a/hloc/extractors/aliked.py b/hloc/extractors/aliked.py new file mode 100644 index 00000000..00f34634 --- /dev/null +++ b/hloc/extractors/aliked.py @@ -0,0 +1,26 @@ +from lightglue import ALIKED as ALIKED_ + +from ..utils.base_model import BaseModel + + +class ALIKED(BaseModel): + default_conf = { + "model_name": "aliked-n16", + "max_num_keypoints": -1, + "detection_threshold": 0.2, + "nms_radius": 2, + } + required_inputs = ["image"] + + def _init(self, conf): + conf.pop("name") + self.model = ALIKED_(**conf) + + def _forward(self, data): + features = self.model(data) + + return { + "keypoints": [f for f in features["keypoints"]], + "keypoint_scores": [f for f in features["keypoint_scores"]], + "descriptors": [f.t() for f in features["descriptors"]], + } diff --git a/hloc/match_features.py b/hloc/match_features.py index be8cc682..679e81e9 100644 --- a/hloc/match_features.py +++ b/hloc/match_features.py @@ -35,6 +35,13 @@ "features": "disk", }, }, + "aliked+lightglue": { + "output": "matches-aliked-lightglue", + "model": { + "name": "lightglue", + "features": "aliked", + }, + }, "superglue": { "output": "matches-superglue", "model": {