mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 03:14:00 +08:00
fixed not cache images for full image datamanager (#2692)
* rm no-cache option --------- Co-authored-by: Matias Turkulainen <30566358+maturk@users.noreply.github.com> Co-authored-by: maturk <matiasturkulainen@gmail.com> Co-authored-by: Justin Kerr <justin.g.kerr@gmail.com>
This commit is contained in:
1 file changed
+3
-3
@@ -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]):
|
||||
@@ -122,6 +122,7 @@ class FullImageDatamanager(DataManager, Generic[TDataset]):
|
||||
|
||||
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
|
||||
@@ -195,7 +196,6 @@ class FullImageDatamanager(DataManager, Generic[TDataset]):
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user