Skip to content

Commit 0af094d

Browse files
authored
Merge pull request #1602 from dorado-ai-devops/fix-transform-matrix-keyerror
Fix KeyError in run.py when transform_matrix_start is missing
2 parents d6bbefb + bdcb5a7 commit 0af094d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/run.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,14 @@ def get_scene(scene):
282282
print(args.screenshot_frames)
283283
for idx in args.screenshot_frames:
284284
f = ref_transforms["frames"][int(idx)]
285-
cam_matrix = f.get("transform_matrix", f["transform_matrix_start"])
285+
286+
if 'transform_matrix' in f:
287+
cam_matrix = f['transform_matrix']
288+
elif 'transform_matrix_start' in f:
289+
cam_matrix = f['transform_matrix_start']
290+
else:
291+
raise KeyError("Missing both 'transform_matrix' and 'transform_matrix_start'")
292+
286293
testbed.set_nerf_camera_matrix(np.matrix(cam_matrix)[:-1,:])
287294
outname = os.path.join(args.screenshot_dir, os.path.basename(f["file_path"]))
288295

0 commit comments

Comments
 (0)