cvg / pixel-perfect-sfm

Pixel-Perfect Structure-from-Motion with Featuremetric Refinement (ICCV 2021, Best Student Paper Award)
Apache License 2.0
1.34k stars 139 forks source link

error running demo.ipynb #59

Open guijuzhejiang opened 2 years ago

guijuzhejiang commented 2 years ago

I run it on ubnutu18, cuda11.2

but when i preceed : "

run pixsfm

    sfm = PixSfM({"dense_features": {"max_edge": 1024}})
    refined, sfm_outputs = sfm.reconstruction(ref_dir, images, sfm_pairs, features, matches, image_list=references)
    # here ref is pycolmap.Reconstruction object

    # run the raw geometric SfM for comparison
    raw_sfm = PixSfM({"KA":{"apply": False}, "BA": {"apply": False}})
    raw, _ = raw_sfm.reconstruction(raw_dir, images, sfm_pairs, features, matches, image_list=references)

"

result: " [2022/05/23 16:19:41 hloc INFO] Finished exporting matches. [2022/05/23 16:19:43 pixsfm.features.models.s2dnet INFO] Loading S2DNet checkpoint at /home/ray/Workspace/project/ORB_SLAM3/src/ref/pixel-perfect-sfm/pixsfm/features/models/checkpoints/s2dnet_weights.pth. [2022/05/23 16:19:43 pixsfm INFO] Loaded dense extractor with configuration: {'cache_format': 'chunked', 'device': 'auto', 'dtype': 'half', 'fast_image_load': False, 'l2_normalize': True, 'load_cache_on_init': False, 'max_edge': 1024, 'model': {'name': 's2dnet'}, 'overwrite_cache': False, 'patch_size': 16, 'pyr_scales': [1.0], 'resize': 'LANCZOS', 'sparse': True, 'use_cache': False} [2022/05/23 16:19:43 pixsfm INFO] Building matching graph... [2022/05/23 16:19:43 pixsfm INFO] Extracting dense features... 100%|██████████| 10/10 [00:03<00:00, 2.78it/s] [2022/05/23 16:19:47 pixsfm INFO] Computing tracks... [2022/05/23 16:19:47 pixsfm INFO] # graph nodes: 10926 [2022/05/23 16:19:47 pixsfm INFO] # graph edges: 17937 [2022/05/23 16:19:47 pixsfm INFO] # tracks: 3224 [2022/05/23 16:19:47 pixsfm INFO] Start feature-metric keypoint adjustment. 100%[████████████████████] 10926/10926 [00:01, 5827.20it/s] [2022/05/23 16:19:49 hloc INFO] Creating an empty database... [2022/05/23 16:19:49 pixsfm INFO] KA Time: 1.87487s, cost change: 0.0232185 --> 0.0214045 [2022/05/23 16:19:49 hloc INFO] Importing images into the database... [2022/05/23 16:19:49 hloc INFO] Importing features into the database... 100%|██████████| 10/10 [00:00<00:00, 2381.50it/s] [2022/05/23 16:19:49 hloc INFO] Importing matches into the database... 100%|██████████| 45/45 [00:00<00:00, 1683.36it/s] [2022/05/23 16:19:49 hloc INFO] Performing geometric verification of the matches...

    Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

"

please help

yuxiang-wen commented 2 years ago

收到,谢谢 

guijuzhejiang commented 2 years ago

這裏出錯 hloc/triangulation.py:line 98:

def geometric_verification(database_path, pairs_path, verbose=True): logger.info('Performing geometric verification of the matches...') with OutputCapture(True): with pycolmap.ostream(): pycolmap.verify_matches( database_path, pairs_path, max_num_trials=20000, min_inlier_ratio=0.1)

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Phil26AT commented 2 years ago

Hello, unfortunately I could not reproduce your problem on any of my machines, but it seems this issue is related to hloc/pycolmap, not pixsfm. Without further information, my best guess is that you have incompatible library versions. I suggest reinstalling hloc and colmap/pycolmap/pixsfm from source.

guijuzhejiang commented 2 years ago

[2022/05/25 11:01:31 hloc INFO] Performing geometric verification of the matches... [2022/05/25 11:01:32 hloc INFO] Running 3D reconstruction... [2022/05/25 11:01:35 hloc INFO] Reconstructed 1 model(s). [2022/05/25 11:01:35 hloc INFO] Largest model is #0 with 10 images. [2022/05/25 11:01:35 hloc INFO] Reconstruction statistics: Reconstruction: num_reg_images = 10 num_cameras = 10 num_points3D = 1859 num_observations = 8087 mean_track_length = 4.35019 mean_observations_per_image = 808.7 mean_reprojection_error = 0.819388 num_input_images = 10 100%[████████████████████] 1859/1859 [00:00, 92950.0it/s] [2022/05/25 11:01:35 pixsfm INFO] Extracting references. [2022/05/25 11:01:35 pixsfm INFO] Reference Extraction Time: 0.020332s [2022/05/25 11:01:35 pixsfm INFO] Start feature-reference bundle adjustment.

Process finished with exit code 139 (interrupted by signal11: SIGSEGV)

Screenshot from 2022-05-25 11-10-20

i change colmap to 'c419bba98a8a987f61a363d6f542c3d050fb7743', then i got different error, seems like the problem is colmap version ? could you tell me which colmap commit id you use