Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch.tensor(camera["camera_to_world"]).view(4, 4)[:3] #3093

Open
tslgithub opened this issue Apr 19, 2024 · 5 comments
Open

torch.tensor(camera["camera_to_world"]).view(4, 4)[:3] #3093

tslgithub opened this issue Apr 19, 2024 · 5 comments

Comments

@tslgithub
Copy link

torch.tensor(camera["camera_to_world"]).view(4, 4)[:3]

@maturk
Copy link
Collaborator

maturk commented Apr 19, 2024

what is the issue exactly?

@tslgithub
Copy link
Author

tslgithub commented Apr 19, 2024

when i run the command:
ns-render camera-path --load-config outputs/poster/nerfacto/2024-04-19_201438/config.yml --camera-path-filename /home/accer2/project/people/nerfstudio/data/nerfstudio/poster/camera_paths/2024-04-19-20-14-45.json --output-path renders/poster/2024-04-19-20-14-45.mp4

and it runs:
Loading latest checkpoint from load_dir
✅ Done loading checkpoint from outputs/poster/nerfacto/2024-04-19_201438/nerfstudio_models/step-000059999.ckpt
camera_path -> {'default_fov': 75.0, 'default_transition_sec': 2.0, 'keyframes': [], 'camera_type': 'perspective', 'render_height': 1080.0, 'render_width': 1920.0, 'fps': 30.0, 'seconds': 0.0, 'is_cycle': False, 'smoothness_value': 0.0, 'camera_path': ['/home/accer2/project/people/nerfstudio/data/nerfstudio/poster/images']}

then i meet the error:
Traceback (most recent call last):
File "/home/accer2/anaconda3/envs/nerfstudio/bin/ns-render", line 8, in
sys.exit(entrypoint())
File "/home/accer2/project/people/nerfstudio/nerfstudio/scripts/render.py", line 896, in entrypoint
tyro.cli(Commands).main()
File "/home/accer2/project/people/nerfstudio/nerfstudio/scripts/render.py", line 457, in main
camera_path = get_path_from_json(camera_path)
File "/home/accer2/project/people/nerfstudio/nerfstudio/cameras/camera_paths.py", line 155, in get_path_from_json
c2w = torch.tensor(camera["camera_to_world"]).view(4, 4)[:3]
TypeError: string indices must be integers

@tslgithub
Copy link
Author

when i run the command: ns-render camera-path --load-config outputs/poster/nerfacto/2024-04-19_201438/config.yml --camera-path-filename /home/accer2/project/people/nerfstudio/data/nerfstudio/poster/camera_paths/2024-04-19-20-14-45.json --output-path renders/poster/2024-04-19-20-14-45.mp4

and it runs: Loading latest checkpoint from load_dir ✅ Done loading checkpoint from outputs/poster/nerfacto/2024-04-19_201438/nerfstudio_models/step-000059999.ckpt camera_path -> {'default_fov': 75.0, 'default_transition_sec': 2.0, 'keyframes': [], 'camera_type': 'perspective', 'render_height': 1080.0, 'render_width': 1920.0, 'fps': 30.0, 'seconds': 0.0, 'is_cycle': False, 'smoothness_value': 0.0, 'camera_path': ['/home/accer2/project/people/nerfstudio/data/nerfstudio/poster/images']}

then i meet the error: Traceback (most recent call last): File "/home/accer2/anaconda3/envs/nerfstudio/bin/ns-render", line 8, in sys.exit(entrypoint()) File "/home/accer2/project/people/nerfstudio/nerfstudio/scripts/render.py", line 896, in entrypoint tyro.cli(Commands).main() File "/home/accer2/project/people/nerfstudio/nerfstudio/scripts/render.py", line 457, in main camera_path = get_path_from_json(camera_path) File "/home/accer2/project/people/nerfstudio/nerfstudio/cameras/camera_paths.py", line 155, in get_path_from_json c2w = torch.tensor(camera["camera_to_world"]).view(4, 4)[:3] TypeError: string indices must be integers

and my camera-path folder is :
{"default_fov": 75.0,
"default_transition_sec": 2.0,
"keyframes": [],
"camera_type": "perspective",
"render_height": 1080.0,
"render_width": 1920.0,
"fps": 30.0,
"seconds": 0.0,
"is_cycle": false,
"smoothness_value": 0.0,
"camera_path": ["/home/accer2/project/people/nerfstudio/data/nerfstudio/poster/images"]
}

@tslgithub
Copy link
Author

torch.tensor(camera["camera_to_world"]).view(4, 4)[:3]

I found is my "camera_path": []", camera_path is empty, but what "camera_path" means ???

@KevinXu02
Copy link
Contributor

torch.tensor(camera["camera_to_world"]).view(4, 4)[:3]

I found is my "camera_path": []", camera_path is empty, but what "camera_path" means ???

Hi! This should be the camera path to render your video, which can be created in the viewer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants