mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-24 00:26:08 +08:00
Reduce GPU memory usage in CacheDataloader (#1730)
* Reduce GPU memory usage in CacheDataloader * Move also masks and seg.masks, depths to cpu * Fix linter issues
This commit is contained in:
1 parent
d4b04376ab
commit
3b0f7581d8
10 files changed
+29
-11
No files matched your search
@@ -42,6 +42,7 @@ class InputDataset(Dataset):
|
||||
scale_factor: The scaling factor for the dataparser outputs
|
||||
"""
|
||||
|
||||
exclude_batch_keys_from_device: List[str] = ["image", "mask"]
|
||||
cameras: Cameras
|
||||
|
||||
def __init__(self, dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0):
|
||||
|
||||
@@ -31,6 +31,8 @@ class DepthDataset(InputDataset):
|
||||
scale_factor: The scaling factor for the dataparser outputs.
|
||||
"""
|
||||
|
||||
exclude_batch_keys_from_device = InputDataset.exclude_batch_keys_from_device + ["depth_image"]
|
||||
|
||||
def __init__(self, dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0):
|
||||
super().__init__(dataparser_outputs, scale_factor)
|
||||
assert (
|
||||
|
||||
@@ -34,6 +34,8 @@ class SDFDataset(InputDataset):
|
||||
scale_factor: The scaling factor for the dataparser outputs.
|
||||
"""
|
||||
|
||||
exclude_batch_keys_from_device = InputDataset.exclude_batch_keys_from_device + ["depth", "normal"]
|
||||
|
||||
def __init__(self, dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0):
|
||||
super().__init__(dataparser_outputs, scale_factor)
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ class SemanticDataset(InputDataset):
|
||||
dataparser_outputs: description of where and how to read input images.
|
||||
"""
|
||||
|
||||
exclude_batch_keys_from_device = InputDataset.exclude_batch_keys_from_device + ["mask", "semantics"]
|
||||
|
||||
def __init__(self, dataparser_outputs: DataparserOutputs, scale_factor: float = 1.0):
|
||||
super().__init__(dataparser_outputs, scale_factor)
|
||||
assert "semantics" in dataparser_outputs.metadata.keys() and isinstance(self.metadata["semantics"], Semantics)
|
||||
|
||||
Reference in new issue
Block a user