mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 10:34:29 +08:00
fix config.pixel_sampler check
This commit is contained in:
parent
745d2b1423
commit
4ceae420a6
@ -461,7 +461,7 @@ class VanillaDataManager(DataManager, Generic[TDataset]):
|
||||
|
||||
def _get_pixel_sampler(self, dataset: TDataset, num_rays_per_batch: int) -> PixelSampler:
|
||||
"""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(
|
||||
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",
|
||||
) -> Int[Tensor, "batch_size 3"]:
|
||||
if isinstance(mask, Tensor):
|
||||
# Note: if there is a mask, should switch to the base PixelSampler class
|
||||
raise NotImplementedError(
|
||||
"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",
|
||||
) -> Int[Tensor, "batch_size 3"]:
|
||||
if isinstance(mask, Tensor):
|
||||
# Note: if there is a mask, should switch to the base PixelSampler class
|
||||
raise NotImplementedError(
|
||||
"Masked sampling not implemented for PairPixelSampler. Change Config to PixelSamplerConfig instead."
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user