Skip to content

Commit

Permalink
fixed not cache images for full image datamanager (#2692)
Browse files Browse the repository at this point in the history
* rm no-cache option

---------

Co-authored-by: Matias Turkulainen <[email protected]>
Co-authored-by: maturk <[email protected]>
Co-authored-by: Justin Kerr <[email protected]>
  • Loading branch information
4 people authored Jan 8, 2024
1 parent 638180c commit 581ba95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nerfstudio/data/datamanagers/full_images_datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class FullImageDatamanagerConfig(DataManagerConfig):
new images. If -1, never pick new images."""
eval_image_indices: Optional[Tuple[int, ...]] = (0,)
"""Specifies the image indices to use during eval; if None, uses all."""
cache_images: Literal["no-cache", "cpu", "gpu"] = "cpu"
"""Whether to cache images in memory. If "numpy", caches as numpy arrays, if "torch", caches as torch tensors."""
cache_images: Literal["cpu", "gpu"] = "cpu"
"""Whether to cache images in memory. If "cpu", caches on cpu. If "gpu", caches on device."""


class FullImageDatamanager(DataManager, Generic[TDataset]):
Expand Down Expand Up @@ -122,6 +122,7 @@ def __init__(

def cache_images(self, cache_images_option):
cached_train = []
cached_eval = []
CONSOLE.log("Caching / undistorting train images")
for i in tqdm(range(len(self.train_dataset)), leave=False):
# cv2.undistort the images / cameras
Expand Down Expand Up @@ -195,7 +196,6 @@ def cache_images(self, cache_images_option):
self.train_dataset.cameras.cx[i] = float(K[0, 2])
self.train_dataset.cameras.cy[i] = float(K[1, 2])

cached_eval = []
CONSOLE.log("Caching / undistorting eval images")
for i in tqdm(range(len(self.eval_dataset)), leave=False):
# cv2.undistort the images / cameras
Expand Down

0 comments on commit 581ba95

Please sign in to comment.