Remove check in database_cache.cc that breaks backwards compatibility with image_list_file_path#3478
Remove check in database_cache.cc that breaks backwards compatibility with image_list_file_path#3478ahojnnes merged 7 commits intocolmap:maincolmap/colmap:mainfrom pd-karoly-harsanyi:patch-image-list-backwards-compatibilitypd-karoly-harsanyi/colmap:patch-image-list-backwards-compatibilityCopy head branch name to clipboard
Conversation
|
Hey. Thanks for reporting! Could you share the database and the command? I cannot reproduce this error with my legacy database, which seems to work fine for me. Are you sure that your image is not missing in the image_list_path? |
|
I see the issue now. It happens when you specify image_list_path and has only partial set of images in the image_names. Rather than removing the check, I would move this line up before the check, which simply becomes: Indeed, this seems to be a big issue in terms of backwards compatibility and needs attention. |
|
So, the else block would look like this? I changed the code as suggested. I re-ran the code that failed here, and the issue seems resolved. |
|
If at all possible, it can be good to have a unit test for this bug. |
I added a unit test. |
|
Thank you for the fix. |
… with image_list_file_path (#3478) If we try to load a pre-3.12 (pre sensor rig support) db, and we also pass `--image_list_path`, the db loading will fail mainly due to the lines I am removing in this PR. Not sure why we have those in there. The error that pops up without this change: ``` I20250711 11:43:48.726486 140208169588800 incremental_pipeline.cc:253] Loading database I20250711 11:43:48.728317 140208169588800 database_cache.cc:66] Loading rigs... I20250711 11:43:48.728328 140208169588800 database_cache.cc:76] 0 in 0.000s I20250711 11:43:48.728333 140208169588800 database_cache.cc:84] Loading cameras... I20250711 11:43:48.728343 140208169588800 database_cache.cc:102] 1 in 0.000s I20250711 11:43:48.728346 140208169588800 database_cache.cc:110] Loading frames... I20250711 11:43:48.728351 140208169588800 database_cache.cc:127] 0 in 0.000s I20250711 11:43:48.728355 140208169588800 database_cache.cc:135] Loading matches... I20250711 11:43:48.756288 140208169588800 database_cache.cc:140] 9644 in 0.028s I20250711 11:43:48.756310 140208169588800 database_cache.cc:156] Loading images... terminate called after throwing an instance of 'std::out_of_range' what(): unordered_map::at *** Aborted at 1752227028 (unix time) try "date -d @1752227028" if you are using GNU date *** PC: @ 0x7f84c62ef00b signal ``` The actual error is coming from here: ``` const frame_t frame_id1 = image_to_frame_id.at(image_id1); const frame_t frame_id2 = image_to_frame_id.at(image_id2); ``` line 205, 206 --------- Co-authored-by: Shaohui Liu <b1ueber2y@gmail.com> Co-authored-by: Johannes Schönberger <jsch@demuc.de> Co-authored-by: Johannes Schönberger <jsch@meta.com>
If we try to load a pre-3.12 (pre sensor rig support) db, and we also pass
--image_list_path, the db loading will fail mainly due to the lines I am removing in this PR. Not sure why we have those in there.The error that pops up without this change:
The actual error is coming from here:
line 205, 206