mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 13:28:59 +08:00
fix config.pixel_sampler check
This commit is contained in:
1 parent
745d2b1423
commit
4ceae420a6
2 files changed
+1
-3
No files matched your search
@@ -461,7 +461,7 @@ class VanillaDataManager(DataManager, Generic[TDataset]):
|
|||||||
|
|
||||||
def _get_pixel_sampler(self, dataset: TDataset, num_rays_per_batch: int) -> PixelSampler:
|
def _get_pixel_sampler(self, dataset: TDataset, num_rays_per_batch: int) -> PixelSampler:
|
||||||
"""Infer pixel sampler to use."""
|
"""Infer pixel sampler to use."""
|
||||||
if self.config.patch_size > 1 and isinstance(self.config.pixel_sampler, PixelSamplerConfig):
|
if self.config.patch_size > 1 and type(self.config.pixel_sampler) is PixelSamplerConfig:
|
||||||
return PatchPixelSamplerConfig().setup(
|
return PatchPixelSamplerConfig().setup(
|
||||||
patch_size=self.config.patch_size, num_rays_per_batch=num_rays_per_batch
|
patch_size=self.config.patch_size, num_rays_per_batch=num_rays_per_batch
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -318,7 +318,6 @@ class PatchPixelSampler(PixelSampler):
|
|||||||
device: Union[torch.device, str] = "cpu",
|
device: Union[torch.device, str] = "cpu",
|
||||||
) -> Int[Tensor, "batch_size 3"]:
|
) -> Int[Tensor, "batch_size 3"]:
|
||||||
if isinstance(mask, Tensor):
|
if isinstance(mask, Tensor):
|
||||||
# Note: if there is a mask, should switch to the base PixelSampler class
|
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
"Masked sampling not implemented for PairPixelSampler. Change Config to PixelSamplerConfig instead."
|
"Masked sampling not implemented for PairPixelSampler. Change Config to PixelSamplerConfig instead."
|
||||||
)
|
)
|
||||||
@@ -382,7 +381,6 @@ class PairPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods
|
|||||||
device: Union[torch.device, str] = "cpu",
|
device: Union[torch.device, str] = "cpu",
|
||||||
) -> Int[Tensor, "batch_size 3"]:
|
) -> Int[Tensor, "batch_size 3"]:
|
||||||
if isinstance(mask, Tensor):
|
if isinstance(mask, Tensor):
|
||||||
# Note: if there is a mask, should switch to the base PixelSampler class
|
|
||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
"Masked sampling not implemented for PairPixelSampler. Change Config to PixelSamplerConfig instead."
|
"Masked sampling not implemented for PairPixelSampler. Change Config to PixelSamplerConfig instead."
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user