cvg / Hierarchical-Localization

Visual localization made easy with hloc
Apache License 2.0
3.24k stars 600 forks source link

Adding groups of images incrementally #379

Closed jstaker7 closed 8 months ago

jstaker7 commented 8 months ago

I have multiple lists of images where each list should have intrinsics shared within that list. This is similar to pycolmap.CameraMode.PER_FOLDER but I'd like to build the database programmatically instead of the usual images being prearranged into separate directories.

For example, something like:

from hloc import reconstruction

for list_of_image_names in all_images_grouped:
     reconstruction.import_images(image_dir, database_path, pycolmap.CameraMode.SINGLE, list_of_image_names)

My hope is that the database would eventually contain all images, but each group would be assigned the same camera and share intrinsics.

What is happening is that the first list gets loaded fine but all subsequent lists get ignored (even though they take a while, as if they are getting loaded). No errors are thrown, it just seems like all but the first list get silently ignored.

Am I trying to do something that isn't supported, or am I missing something?

jstaker7 commented 8 months ago

My apologies; this is working as expected and I had an issue on my side. Turns out that if there is a name clash with an image in the DB then adding images fails silently. Once I fixed the names between sets to be fully unique then they got added as they should.