mlx3d.datasets¶
mlx3d.datasets
¶
ColmapDataset
dataclass
¶
Source code in src/mlx3d/datasets/colmap.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
scene_extent
property
¶
Radius of the camera-centers bounding sphere (used to scale densification thresholds, as in 3DGS).
ImageCollection
¶
A list-like view over training images with configurable storage.
Always yields (H, W, 3) float32 MLX arrays in [0, 1], regardless of the underlying storage mode.
Source code in src/mlx3d/datasets/images.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
nbytes_resident
property
¶
Approximate resident memory of the stored images, in bytes.
append_file(path)
¶
Register an image file, decoding it now or later per the cache mode.
Source code in src/mlx3d/datasets/images.py
65 66 67 68 69 70 71 72 73 74 | |
shape_of(i)
¶
(height, width) of image i (decodes it in disk mode).
Source code in src/mlx3d/datasets/images.py
76 77 78 79 | |
load_blender(root, split='train', downscale=1, white_background=True, cache='ram')
¶
Load a Blender-synthetic scene (lego, chair, ...).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str
|
scene directory containing |
required |
split
|
str
|
|
'train'
|
downscale
|
int
|
integer image downscaling factor. |
1
|
white_background
|
bool
|
composite the RGBA renders onto white (else black). |
True
|
cache
|
str
|
image storage policy ( |
'ram'
|
Source code in src/mlx3d/datasets/blender.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
load_colmap(root, images_dir='images', downscale=1, load_images=True, cache='ram')
¶
Load a COLMAP scene laid out as root/sparse/0 + root/<images_dir>.
COLMAP already uses the OpenCV camera convention, so extrinsics map
directly onto :class:~mlx3d.cameras.Camera.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache
|
str
|
image storage policy — |
'ram'
|
Source code in src/mlx3d/datasets/colmap.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
load_instant_ngp(root, transforms_file='transforms.json', downscale=1, white_background=False, cache='ram')
¶
Load an Instant-NGP / nerfstudio scene.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str
|
scene directory containing |
required |
transforms_file
|
str
|
name of the transforms JSON (default |
'transforms.json'
|
downscale
|
int
|
integer image downscaling factor (intrinsics are scaled to match). |
1
|
white_background
|
bool
|
composite RGBA images onto white (else black). |
False
|
cache
|
str
|
image storage policy; see :class: |
'ram'
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
BlenderDataset
|
class: |
Source code in src/mlx3d/datasets/instant_ngp.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |