train
train
#
train — a splat from posed images, on the GPU one call at a time.
- Toolchain. The trainer runs in the GPU interpreter
gpu_runfinds: torch, gsplat and nerfstudio live there, never in the library's own environment. - Manifest. The frames are handed over explicitly as
frames.jsonunder the work directory: one record per frame, in input order, holding the image's path, thePose's JSON and the paths of the depth and confidence planes staged beside it (nullwhere none was measured). A depth plane is float32 metres at its native resolution, an absent return 0; its confidence float32 in[0, 1], 1 when the map carries none. The trainer resizes them to the image on load and supervises its rendered depth atdepth_weight; frames stage no depth at weight 0. - Lock. The whole run holds
cgr.gpu_lock(), so calls from every page worker, process and script on the machine train one after another and a waiting call says so in its progress. - Progress. The driver writes
progress.jsonas it trains; a watcher thread reads it into aTrainingcount, so the step, loss and gaussian count reach a page or terminal while the run is live, and finally how far camera refinement moved the cameras.
train(frames, seed, iterations=15000, optimize_cameras=False, depth_weight=0.2)
#
A 3D Gaussian splat trained on frames from seed with nerfstudio's splatfacto.
frames = cgr.splats.scene_dataset(session.capture)
splat = cgr.splats.train(frames, cgr.splats.depth_seed(frames))
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
Array[PosedImage]
|
The posed images to fit. |
required |
seed
|
PointCloud
|
The coloured points the gaussians start from. |
required |
iterations
|
int
|
How many optimizer steps to run. |
15000
|
optimize_cameras
|
bool
|
Whether to refine the camera poses while training, for poses a sensor estimated rather than a tracker. The splat is then carried back by the similarity that realigns the refined cameras onto the given ones, so it stays where the poses put it, and the progress says how far the cameras moved. |
False
|
depth_weight
|
float
|
The weight of the depth term, pulling the rendered
depth toward each frame's measured depth, relative to the
photometric loss; |
0.2
|
Raises:
| Type | Description |
|---|---|
ScratchError
|
If no GPU interpreter can be found. |
CalledProcessError
|
If training fails; the exception carries the tail of the trainer's log. |