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
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |
save_colmap(root, cameras, image_names, points, point_colors, point_errors=None)
¶
Write a COLMAP binary sparse model to root/sparse/0.
The inverse of :func:load_colmap (2D observations/tracks are not stored).
Identical intrinsics are deduplicated into a shared COLMAP camera. Colors
are float in [0, 1]; points/colors accept MLX or NumPy arrays.
Returns the sparse model directory.
Source code in src/mlx3d/datasets/colmap.py
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 | |
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 | |