cvg/Hierarchical-Localization

verify_matches(): incompatible function arguments. The following argument types are supported:

applefb opened this issue · 2 comments

when i run the demo.ipynb ,it comes

verify_matches(): incompatible function arguments. The following argument types are supported:

[2024/04/11 10:17:48 hloc INFO] Creating an empty database...
[2024/04/11 10:17:48 hloc INFO] Importing images into the database...
[2024/04/11 10:17:48 hloc INFO] Importing features into the database...
100%
 10/10 [00:00<00:00, 1516.82it/s]
[2024/04/11 10:17:48 hloc INFO] Importing matches into the database...
100%
 45/45 [00:00<00:00, 2641.43it/s]
[2024/04/11 10:17:48 hloc INFO] Performing geometric verification of the matches...
[2024/04/11 10:17:48 hloc ERROR] Failed with output:


TypeError Traceback (most recent call last)
Cell In[5], line 1
----> 1 model = reconstruction.main(
2 sfm_dir, images, sfm_pairs, features, matches, image_list=references
3 )
4 fig = viz_3d.init_figure()
5 viz_3d.plot_reconstruction(
6 fig, model, color="rgba(255,0,0,0.5)", name="mapping", points_rgb=True
7 )

File ~/桌面/Hierarchical-Localization-1.4/hloc/reconstruction.py:121, in main(sfm_dir, image_dir, pairs, features, matches, camera_mode, verbose, skip_geometric_verification, min_match_score, image_list, image_options, mapper_options)
118 import_matches(image_ids, database, pairs, matches,
119 min_match_score, skip_geometric_verification)
120 if not skip_geometric_verification:
--> 121 estimation_and_geometric_verification(database, pairs, verbose)
122 reconstruction = run_reconstruction(
123 sfm_dir, database, image_dir, verbose, mapper_options)
124 if reconstruction is not None:

File ~/桌面/Hierarchical-Localization-1.4/hloc/triangulation.py:109, in estimation_and_geometric_verification(database_path, pairs_path, verbose)
107 with OutputCapture(verbose):
108 with pycolmap.ostream():
--> 109 pycolmap.verify_matches(
110 database_path, pairs_path,
111 max_num_trials=20000, min_inlier_ratio=0.1)

TypeError: verify_matches(): incompatible function arguments. The following argument types are supported:
1. (database_path: str, pairs_path: str, options: pycolmap.TwoViewGeometryOptions = <pycolmap.TwoViewGeometryOptions object at 0x7658381e7770>) -> None

Invoked with: PosixPath('outputs/demo/sfm/database.db'), PosixPath('outputs/demo/pairs-sfm.txt'); kwargs: max_num_trials=20000, min_inlier_ratio=0.1

fixed,i removed my pycolmap 0.7.0,and reinstall hloc,
git clone --recursive https://github.com/cvg/Hierarchical-Localization/
cd Hierarchical-Localization/
python -m pip install -e .

it will auto install pycolmap 0.6.1