Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lamar/tasks/feature_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,25 @@ class RetrievalFeatureExtraction(FeatureExtraction):
'preprocessing': {'resize_max': 640},
}
},
'cosplace': {
'name': 'cosplace',
'hloc': {
'model': {'name': 'cosplace'},
'preprocessing': {'resize_max': 640},
}
},
Comment on lines +150 to +156

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cvg/Hierarchical-Localization@d0e8494 removes Cos/EigenPlaces but adds MegaLoc, which is much more robust (and has results on LaMAR).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info, I'll go ahead and replace with MegaLoc and will also try that one on a currently private data split (to be released) to see where it stands (SALAD seems kinda good 😄 )

'openibl': {
'name': 'openibl',
'hloc': {
'model': {'name': 'openibl'},
'preprocessing': {'resize_max': 640},
}
},
'salad': {
'name': 'salad',
'hloc': {
'model': {'name': 'salad'},
'preprocessing': {'resize_max': 640},
}
}
}
9 changes: 9 additions & 0 deletions lamar/tasks/feature_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class FeatureMatching:
},
},
},
'lightglue': {
'name': 'lightglue',
'hloc': {
'model': {
'name': 'lightglue',
'features': 'superpoint',
},
},
},
'mnn': {
'name': 'mnn',
'hloc': {
Expand Down
31 changes: 20 additions & 11 deletions lamar/tasks/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def __init__(self, config, outputs, capture, session_id,
self.name2key[image.name]: image.image_id
for image in self.reconstruction.images.values()
}
self.points3d_cache = {}

def run(self, capture):
run_capture_to_empty_colmap.run(capture, [self.session_id], self.paths.sfm_empty)
Expand All @@ -107,18 +108,26 @@ def run(self, capture):
)

def get_points3D(self, key, point2D_indices):
image = self.reconstruction.images[self.key2imageid[key]]
valid = []
xyz = []
ids = []
if len(image.points2D) > 0:
for idx in point2D_indices:
p = image.points2D[idx]
valid.append(p.has_point3D())
if valid[-1]:
ids.append(p.point3D_id)
# TODO(WIP): This cache should have a size limit, maybe LRU.
if key not in self.points3d_cache:
image = self.reconstruction.images[self.key2imageid[key]]
ids = []
xyz = []
for p2d in image.points2D:
if p2d.has_point3D():
ids.append(p2d.point3D_id)
xyz.append(self.reconstruction.points3D[ids[-1]].xyz)
return np.array(valid, bool), xyz, ids
else:
ids.append(-1)
xyz.append([np.nan, np.nan, np.nan])
self.points3d_cache[key] = (np.array(ids), np.array(xyz))
Comment thread
mihaidusmanu marked this conversation as resolved.
Outdated
ids, xyz = self.points3d_cache[key]
if len(ids) == 0:
# Not registered.
return np.array([], bool), [], []
valid = ids[point2D_indices] != -1
return valid, xyz[point2D_indices][valid], ids[point2D_indices][valid]



class MeshLifting(Mapping):
Expand Down
2 changes: 1 addition & 1 deletion lamar/tasks/pose_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PoseEstimation:
method2class = {}
method = None
evaluation = {
'Rt_thresholds': [(1, 0.1), (5, 1.)],
'Rt_thresholds': [(1, .1), (5, .5), (5, 1), (10, .25), (10, .5), (10, 1), (10, 2.5), (10, 5), (10, 10)],
}

def __init_subclass__(cls):
Expand Down
6 changes: 3 additions & 3 deletions scantools/proc/overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def trajectory_overlap(self, keys_q: List, session_q: Session,
if is_self:
keys_r, session_r, poses_r = keys_q, session_q, poses_q

overlap_matrix = np.full((len(keys_q), len(keys_r)), -1, float)
overlap_matrix = np.full((len(keys_q), len(keys_r)), -1, dtype=np.float16)
overlap_matrix[discard] = 0

# cache the image poses as they might be compositions of rig poses
Expand Down Expand Up @@ -195,8 +195,8 @@ def compute_overlaps_for_sequence(capture: Capture, id_q: str, id_ref: str,
valid_image_indices_list = [np.array(list(range(len(keys_ref))))]
selected_keys_ref_list = [keys_ref]

ov_q2r = np.zeros([len(keys_q), len(keys_ref)])
ov_r2q = np.zeros([len(keys_ref), len(keys_q)])
ov_q2r = np.zeros([len(keys_q), len(keys_ref)], dtype=np.float16)
ov_r2q = np.zeros([len(keys_ref), len(keys_q)], dtype=np.float16)
for sub_info in zip(sub_mesh_id_list, valid_image_indices_list, selected_keys_ref_list):
sub_mesh_id, valid_image_indices, selected_keys_ref = sub_info
sub_mesh_path = capture.proc_path(id_ref) / session_ref.proc.meshes[sub_mesh_id]
Expand Down