In colmap_to_json, on this line:
if image_rename_map is not None:
name = image_rename_map[name]
the image_rename_map Dict keys look like 'images/'+name, but we're trying to index it using just name, which results in a KeyError.
I ran into this because I built a colmap model that uses a cube rig. Each face of the cube is its own camera. So the images hierachy looks like:
rig1/front/imageN.jpg
rig1/back/imageN.jpg
rig1/left/imageN.jpg
rig1/right/imageN.jpg
rig1/up/imageN.jpg
rig1/down/imageN.jpg
for my N frames. When importing to ns, the image hierarchy gets flattened and numbered as frame_#.jpg, with the key being 'images/rig1/front/imageN.jpg'. Then when we go to use the dict, we try to look up using the key 'rig1/front/imageN.jpg' which results in the KeyError.
I don't see this when my images aren't already in a nested hierarchy, so maybe there is a separate path further up the callstack that is creating the bad keys.
Steps to reproduce the behavior:
- Create a colmap model with a rig that has multiple cameras
- Use the folder-per-camera option
- Copy the trained colmap files into
{PROCESSED_DATA_DIR}
- Use
ns-process-data images --data {DATA_PATH} --output-dir {PROCESSED_DATA_DIR} --skip-colmap to import the images, rename them, downsample them, and attempt to generate the transforms.json
Expected Behavior:
No KeyError. Image rename mapping works. json is created without issue.
In colmap_to_json, on this line:
the image_rename_map Dict keys look like
'images/'+name, but we're trying to index it using justname, which results in aKeyError.I ran into this because I built a colmap model that uses a cube rig. Each face of the cube is its own camera. So the images hierachy looks like:
for my N frames. When importing to ns, the image hierarchy gets flattened and numbered as
frame_#.jpg, with the key being'images/rig1/front/imageN.jpg'. Then when we go to use the dict, we try to look up using the key'rig1/front/imageN.jpg'which results in the KeyError.I don't see this when my images aren't already in a nested hierarchy, so maybe there is a separate path further up the callstack that is creating the bad keys.
Steps to reproduce the behavior:
{PROCESSED_DATA_DIR}ns-process-data images --data {DATA_PATH} --output-dir {PROCESSED_DATA_DIR} --skip-colmapto import the images, rename them, downsample them, and attempt to generate the transforms.jsonExpected Behavior:
No KeyError. Image rename mapping works. json is created without issue.