mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-19 22:25:44 +08:00
Add cropping options to data processing (#1236)
This commit is contained in:
1 parent
bd1060ee83
commit
5b50740f45
5 files changed
+159
-3
No files matched your search
@@ -99,6 +99,9 @@ class InputDataset(Dataset):
|
||||
if self.has_masks:
|
||||
mask_filepath = self._dataparser_outputs.mask_filenames[image_idx]
|
||||
data["mask"] = get_image_mask_tensor_from_path(filepath=mask_filepath, scale_factor=self.scale_factor)
|
||||
assert (
|
||||
data["mask"].shape[:2] == data["image"].shape[:2]
|
||||
), f"Mask and image have different shapes. Got {data['mask'].shape[:2]} and {data['image'].shape[:2]}"
|
||||
metadata = self.get_metadata(data)
|
||||
data.update(metadata)
|
||||
return data
|
||||
|
||||
Reference in new issue
Block a user