From 05d002fd5f8ca484a16a073682451297b7a8eb1e Mon Sep 17 00:00:00 2001 From: Torsten Sattler Date: Wed, 10 Mar 2021 20:55:01 +0100 Subject: [PATCH] Update triangulation.py Handles case where the match file contains image names not in the database. --- hloc/triangulation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hloc/triangulation.py b/hloc/triangulation.py index 737e92a8..3797a9b2 100644 --- a/hloc/triangulation.py +++ b/hloc/triangulation.py @@ -64,6 +64,9 @@ def import_matches(image_ids, database_path, pairs_path, matches_path, matched = set() for name0, name1 in tqdm(pairs): + if name0 not in image_ids or name1 not in image_ids: + continue + id0, id1 = image_ids[name0], image_ids[name1] if len({(id0, id1), (id1, id0)} & matched) > 0: continue