limap
limap copied to clipboard
Issues related to the example of Localization with points&lines in doc
Hello, first of all, thank you very much for contributing the code!
I followed the example step by step, but when I reached this python code: python runners/7scenes/localization.py --dataset $dataset -s stairs --skip_exists --use_dense_depth --localization.optimize.loss_func TrivialLoss
The following error occurs:
[LOG] Output dir: tmp/7scenes/stairs
[LOG] Loading dir: tmp/7scenes/stairs
[LOG] weight dir: /home/danson/.limap/models
[2023/12/09 13:50:15 JointLoc INFO] Working on scene "stairs".
[2023/12/09 13:50:15 hloc INFO] Extracting local features with configuration:
{'model': {'max_keypoints': 4096, 'name': 'superpoint', 'nms_radius': 3},
'output': 'feats-superpoint-n4096-r1024',
'preprocessing': {'globs': ['*.color.png'],
'grayscale': True,
'resize_max': 1024}}
[2023/12/09 13:50:15 hloc INFO] Found 3000 images in root datasets/7scenes/stairs.
[2023/12/09 13:50:16 hloc INFO] Skipping the extraction.
[2023/12/09 13:50:17 hloc INFO] Creating the reference model.
[2023/12/09 13:50:21 hloc INFO] Kept 2000 images out of 3000.
[2023/12/09 13:50:22 hloc INFO] Matching local features with configuration:
{'model': {'name': 'superglue', 'sinkhorn_iterations': 5, 'weights': 'outdoor'},
'output': 'matches-superglue'}
[2023/12/09 13:50:22 hloc INFO] Skipping the matching.
[2023/12/09 13:50:22 hloc INFO] Matching local features with configuration:
{'model': {'name': 'superglue', 'sinkhorn_iterations': 5, 'weights': 'outdoor'},
'output': 'matches-superglue'}
[2023/12/09 13:50:22 hloc INFO] Skipping the matching.
[2023/12/09 13:50:23 hloc INFO] Correcting sfm using depth...
100%|████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:15<00:00, 131.40it/s]
[2023/12/09 13:50:39 JointLoc INFO] Running Point-only localization...
[2023/12/09 13:50:39 hloc.utils.parsers INFO] Imported 1000 images from query_list_with_intrinsics.txt
[2023/12/09 13:50:39 hloc INFO] Reading the 3D model...
[2023/12/09 13:50:39 hloc INFO] Starting localization...
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:25<00:00, 38.76it/s]
[2023/12/09 13:51:05 hloc INFO] Localized 1000 / 1000 images.
[2023/12/09 13:51:05 hloc INFO] Writing poses to outputs/localization/7scenes/stairs/results_dense_point.txt...
[2023/12/09 13:51:05 hloc INFO] Writing logs to outputs/localization/7scenes/stairs/results_dense_point.txt_logs.pkl...
[2023/12/09 13:51:06 hloc INFO] Done!
[2023/12/09 13:51:06 JointLoc INFO] Coarse pose saved at outputs/localization/7scenes/stairs/results_dense_point.txt
[2023/12/09 13:51:07 hloc.pipelines.Cambridge.utils INFO] Results for file results_dense_point.txt:
Median errors: 0.047m, 1.252deg
Percentage of test images localized within:
1cm, 1deg : 2.10%
2cm, 2deg : 12.90%
3cm, 3deg : 29.10%
5cm, 5deg : 53.10%
25cm, 2deg : 68.60%
50cm, 5deg : 91.40%
500cm, 10deg : 97.10%
[2023/12/09 13:51:07 JointLoc INFO] Coarse pose read from outputs/localization/7scenes/stairs/results_dense_point.txt
[2023/12/09 13:51:08 JointLoc INFO] Running LIMAP fit&merge
[LOG] Number of images: 2000
[LOG] Output dir: tmp/7scenes/stairs
[LOG] Loading dir: tmp/7scenes/stairs
[LOG] weight dir: /home/danson/.limap/models
[LOG] Start 2D line detection and description (detector = lsd, extractor = sold2, n_images = 2000)...
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:00<00:00, 607034.37it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [02:17<00:00, 14.57it/s]
[LOG] Start 2D line detection and description (detector = lsd, extractor = sold2, n_images = 2000)...
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:00<00:00, 585061.24it/s]
[LOG] Start 2D line detection and description (detector = lsd, extractor = sold2, n_images = 1000)...
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 574877.19it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:00<00:00, 593841.71it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 590830.26it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [00:00<00:00, 299123.09it/s]
[LOG] Starting localization with points+lines...
0%| | 0/1000 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/danson/Code_center/limap/runners/7scenes/localization.py", line 164, in
Invoked with: 1.0
I need help!
try to run only: python runners/7scenes/localization.py --dataset $dataset -s stairs --skip_exists --use_dense_depth It will work :).
Thank you so much for answering my questions so quickly!
I tried your suggestion and it worked. But the process of "Starting localization with points+lines..." is very, very slow. 1/2000 takes about 200s, my CPU is I7-12700H. I would like to ask, does "--localization.optimize.loss_func TrivialLoss" require the installation of a specified version of Ceres Solver to run correctly? Or what conditions do I need to meet to run "--localization.optimize.loss_func TrivialLoss"?
Thank you again for your help!
非常感谢您这么快回答我的问题!
我尝试了你的建议并且有效。但“用点+线开始定位……”的过程非常非常慢。 1/2000大约需要200s,我的CPU是I7-12700H。 我想问一下,“--localization.optimize.loss_func TrivialLoss”是否需要安装指定版本的Ceres Solver才能正确运行?或者我需要满足什么条件才能运行“--localization.optimize.loss_func TrivialLoss”?
再次感谢你的帮助!
你好,我在安装limap的时候遇到了一些问题。我看到您成功安装了,想请问关于您的环境版本,比如python、cmake、cuda、pytorch等,万分感谢您的回复!
Thank you so much for answering my questions so quickly!
I tried your suggestion and it worked. But the process of "Starting localization with points+lines..." is very, very slow. 1/2000 takes about 200s, my CPU is I7-12700H. I would like to ask, does "--localization.optimize.loss_func TrivialLoss" require the installation of a specified version of Ceres Solver to run correctly? Or what conditions do I need to meet to run "--localization.optimize.loss_func TrivialLoss"?
Thank you again for your help!
To run with TrivialLoss you need to change the config localization.optimize.loss_func_args to an umpty list [] in https://github.com/cvg/limap/blob/main/cfgs/localization/7scenes.yaml. Or adding --localization.optimize.loss_func_args with an empty value might also work. This is a flaw in the config design, sorry for the confusion :(.
The slow speed might also due to your Ceres version, we observed significantly lower speed when using Ceres 2.2.0 (with the Manifold parameterization instead of quaternion parameterization). I would recommend using Ceres 2.0.0/2.1.0 for faster speed.
Sorry for the late reply :)