out_cameras = []
for camera_name in frame:
camera = frame[camera_name]
out_camera = dict(camera.attrs)
out_camera["image"] = camera["image"].value
out_camera["depth"] = camera["depth"].value
out_cameras.append(out_camera)
if save_png_dir is not None:
save_camera(out_camera["image"], out_camera["depth"], save_dir=save_png_dir, name=str(i).zfill(10))
out_frame["cameras"] = out_cameras
After Change
for i, frame_name in enumerate(file):
out_frame = read_frame(file, frame_name, i, save_png_dir)
if out_frame is None:
log.error("Could not read frame, skipping")
else:
ret.append(out_frame)
if overfit:
log.info("overfitting to %r, image// %d", filename, i)