When generating depth images, use torch_compile with ZoeDepth for compatibility (#2303)

* Use torch_compile with Zoe for compatibility

torch_compile module support

Previously the compatibility utility torch.compile worked for functions, but not for modules as torch.compile was originally employed here.

* torch_compile -> Any
This commit is contained in:
machenmusik authored and GitHub committed 2023-08-09 17:08:17 -07:00
1 parent cf2d90d009
commit cb2405d3ea
2 files changed
+11 -4

No files matched your search

+2 -1
View File
@@ -24,6 +24,7 @@ from nerfstudio.data.dataparsers.base_dataparser import DataparserOutputs
from nerfstudio.model_components import losses
from nerfstudio.data.datasets.base_dataset import InputDataset
from nerfstudio.data.utils.data_utils import get_depth_image_from_path
from nerfstudio.utils.misc import torch_compile
from nerfstudio.utils.rich_utils import CONSOLE
from typing import Union
@@ -72,7 +73,7 @@ class DepthDataset(InputDataset):
filenames = dataparser_outputs.image_filenames
repo = "isl-org/ZoeDepth"
self.zoe = torch.compile(torch.hub.load(repo, "ZoeD_NK", pretrained=True).to(device))
self.zoe = torch_compile(torch.hub.load(repo, "ZoeD_NK", pretrained=True).to(device))
for i in track(range(len(filenames)), description="Generating depth images"):
image_filename = filenames[i]