colmap / colmap

COLMAP - Structure-from-Motion and Multi-View Stereo
https://colmap.github.io/
Other
7.03k stars 1.44k forks source link

AttributeError: module 'pycolmap' has no attribute 'patch_match_stereo' #2457

Open hyebinyoo opened 3 months ago

hyebinyoo commented 3 months ago

I tried to run the example code in this link https://github.com/colmap/pycolmap?tab=readme-ov-file , but I got the following error:

output_path: pathlib.Path
image_dir: pathlib.Path

output_path.mkdir()
mvs_path = output_path / "mvs"
database_path = output_path / "database.db"

pycolmap.extract_features(database_path, image_dir)
pycolmap.match_exhaustive(database_path)
maps = pycolmap.incremental_mapping(database_path, image_dir, output_path)
maps[0].write(output_path)
# dense reconstruction
pycolmap.undistort_images(mvs_path, output_path, image_dir)
pycolmap.patch_match_stereo(mvs_path)  # requires compilation with CUDA
pycolmap.stereo_fusion(mvs_path / "dense.ply", mvs_path)

AttributeError: module 'pycolmap' has no attribute 'patch_match_stereo'

How can I fix it?

shilem2 commented 2 months ago

According to the comment on the relevant line you need to compile with CUDA:

pycolmap.patch_match_stereo(mvs_path) # requires compilation with CUDA

see also here

BowMonk commented 1 month ago

Hello there, I've been trying to solve this issue for a while now, but even though I'm pretty sure im building colmap from source with CUDA, this function still doesn't work. Is there anything that can tell me exactly when pycolmap is aware that it's using a certain COLMAP install?

SARAH-HADDAD commented 2 weeks ago

Same here

BowMonk commented 2 weeks ago

Same here

The comment by Linusnie on this thread helped me out. https://github.com/colmap/colmap/issues/2481# I forgot that you also have to setup pycolmap through the version found inside the colmap folder (can't use pycolmap installed separately, at least I couldn't get that to work).