mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 15:59:16 +08:00
remove redundant code in full_images_datamanager.py (#3155)
remove redundant code
This commit is contained in:
1 parent
8d5502db1a
commit
742963e073
1 file changed
+1
-9
@@ -307,15 +307,7 @@ class FullImageDatamanager(DataManager, Generic[TDataset]):
|
|||||||
"""Returns the next evaluation batch
|
"""Returns the next evaluation batch
|
||||||
|
|
||||||
Returns a Camera instead of raybundle"""
|
Returns a Camera instead of raybundle"""
|
||||||
image_idx = self.eval_unseen_cameras.pop(random.randint(0, len(self.eval_unseen_cameras) - 1))
|
return self.next_eval_image(step=step)
|
||||||
# Make sure to re-populate the unseen cameras list if we have exhausted it
|
|
||||||
if len(self.eval_unseen_cameras) == 0:
|
|
||||||
self.eval_unseen_cameras = [i for i in range(len(self.eval_dataset))]
|
|
||||||
data = deepcopy(self.cached_eval[image_idx])
|
|
||||||
data["image"] = data["image"].to(self.device)
|
|
||||||
assert len(self.eval_dataset.cameras.shape) == 1, "Assumes single batch dimension"
|
|
||||||
camera = self.eval_dataset.cameras[image_idx : image_idx + 1].to(self.device)
|
|
||||||
return camera, data
|
|
||||||
|
|
||||||
def next_eval_image(self, step: int) -> Tuple[Cameras, Dict]:
|
def next_eval_image(self, step: int) -> Tuple[Cameras, Dict]:
|
||||||
"""Returns the next evaluation batch
|
"""Returns the next evaluation batch
|
||||||
|
|||||||
Reference in new issue
Block a user