I followed the instructions from the README.md, ran the code and it turned out that the compiler complained about some kind of python grammatical errors as "list indices must be integers or slices, not tuple". The compiler also pinned the problem source to the function generate_rays() defined at the 202th line in the datasets.py.
I changed
camera_directions = [v @ p2c[:3, :3].T for v, p2c in zip(pixel_directions, self.pix2cam)]directions = [v @ c2w[:3, :3].T for v, c2w in zip(camera_directions, self.cam_to_world)]origins = [np.broadcast_to(c2w[:3, -1], v.shape) for v, c2w in zip(directions, self.cam_to_world)]
to
camera_directions = [v @ np.array(p2c)[:3, :3].T for v, p2c in zip(pixel_directions, self.pix2cam)]directions = [v @ np.array(c2w)[:3, :3].T for v, c2w in zip(camera_directions, self.cam_to_world)]origins = [np.broadcast_to(np.array(c2w)[:3, -1], v.shape) for v, c2w in zip(directions, self.cam_to_world)]
then it seemed everything was alright. I am not sure whether this is caused by the python version mismatch or something like this.
I followed the instructions from the README.md, ran the code and it turned out that the compiler complained about some kind of python grammatical errors as "list indices must be integers or slices, not tuple". The compiler also pinned the problem source to the function generate_rays() defined at the 202th line in the datasets.py.
I changed
camera_directions = [v @ p2c[:3, :3].T for v, p2c in zip(pixel_directions, self.pix2cam)]
directions = [v @ c2w[:3, :3].T for v, c2w in zip(camera_directions, self.cam_to_world)]
origins = [np.broadcast_to(c2w[:3, -1], v.shape) for v, c2w in zip(directions, self.cam_to_world)]
tocamera_directions = [v @ np.array(p2c)[:3, :3].T for v, p2c in zip(pixel_directions, self.pix2cam)]
directions = [v @ np.array(c2w)[:3, :3].T for v, c2w in zip(camera_directions, self.cam_to_world)]
origins = [np.broadcast_to(np.array(c2w)[:3, -1], v.shape) for v, c2w in zip(directions, self.cam_to_world)]
then it seemed everything was alright. I am not sure whether this is caused by the python version mismatch or something like this.