Render cameras with render times for dynamic nerfs (#1199)

* Render cameras with render times for dynamic nerfs

* Add --dynamic flag to cmd. Clamp render times.

* Fix for issues with clamping renderTime

* Only add render_time to camera path if dynamic nerf

* change DEFAULT_TIME to DEFAULT_RENDER_TIME

Co-authored-by: Liam Schoneveld <liam.schoneveld@woven-planet.global>
This commit is contained in:
Liam SchoneveldandLiam Schoneveld authored and GitHub committed 2023-01-03 21:23:20 -08:00
1 parent 102c00a9be
commit 31be97d59c
3 files changed
+211 -6

No files matched your search

+7
View File
@@ -152,6 +152,12 @@ def get_path_from_json(camera_path: Dict[str, Any]) -> Cameras:
fxs.append(focal_length)
fys.append(focal_length)
# Iff ALL cameras in the path have a "time" value, construct Cameras with times
if all("render_time" in camera for camera in camera_path["camera_path"]):
times = torch.tensor([camera["render_time"] for camera in camera_path["camera_path"]])
else:
times = None
camera_to_worlds = torch.stack(c2ws, dim=0)
fx = torch.tensor(fxs)
fy = torch.tensor(fys)
@@ -162,4 +168,5 @@ def get_path_from_json(camera_path: Dict[str, Any]) -> Cameras:
cy=image_height / 2,
camera_to_worlds=camera_to_worlds,
camera_type=camera_type,
times=times,
)