I think there's an enumeration problem in the preprocessing step around line 364. Here its iterating over valid images in each block but its trying to get values using i+1 which is in fact the image id. Furthermore, it doesn't make much sense to get a cam with id i+1, rather it should get camera of img?
for id, i in enumerate(valid_ids):
aoi_bbox = aoi_bboxs[id]
width = aoi_bbox[1] - aoi_bbox[0]
height = aoi_bbox[3] - aoi_bbox[2]
cam = cams[i + 1]
img = imgs[i + 1]
I think there's an enumeration problem in the preprocessing step around line 364. Here its iterating over valid images in each block but its trying to get values using i+1 which is in fact the image id. Furthermore, it doesn't make much sense to get a cam with id i+1, rather it should get camera of img?