4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 18:44:21 +08:00

Addressed TODO in full_images_datamanager.py to return image resolution as train rays (#3312)

* addressed a todo in full_images_datamanager.py that should return the resolution of the image being rendered

* fixed docstring get_train_rays_per_batch
This commit is contained in:
Alex Jean 2024-08-21 14:59:44 -07:00 committed by GitHub
parent a281d99eac
commit 36d5e35801
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -332,8 +332,13 @@ class FullImageDatamanager(DataManager, Generic[TDataset]):
return {}
def get_train_rays_per_batch(self):
# TODO: fix this to be the resolution of the last image rendered
return 800 * 800
"""Returns resolution of the image returned from datamanager."""
if len(self.cached_train) != 0:
h = self.cached_train[0]["image"].shape[0]
w = self.cached_train[0]["image"].shape[1]
return h * w
else:
return 800 * 800
def next_train(self, step: int) -> Tuple[Cameras, Dict]:
"""Returns the next training batch